Przeglądaj źródła

碳源投加记录 新增日期筛选

王苗苗 1 tydzień temu
rodzic
commit
6dfed2d164

+ 106 - 0
slibra-admin/src/main/java/com/slibra/web/controller/business/TXinyiMedicineAddRecordController.java

@@ -0,0 +1,106 @@
+package com.slibra.web.controller.business;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.slibra.common.annotation.Log;
+import com.slibra.common.core.controller.BaseController;
+import com.slibra.common.core.domain.AjaxResult;
+import com.slibra.common.enums.BusinessType;
+import com.slibra.business.domain.TXinyiMedicineAddRecord;
+import com.slibra.business.service.ITXinyiMedicineAddRecordService;
+import com.slibra.common.utils.poi.ExcelUtil;
+import com.slibra.common.core.page.TableDataInfo;
+
+/**
+ * 信义碳源投加记录Controller
+ * 
+ * @author slibra
+ * @date 2025-05-09
+ */
+@RestController
+@RequestMapping("/business/medicineAddRecord")
+public class TXinyiMedicineAddRecordController extends BaseController
+{
+    @Autowired
+    private ITXinyiMedicineAddRecordService tXinyiMedicineAddRecordService;
+
+    /**
+     * 查询信义碳源投加记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TXinyiMedicineAddRecord tXinyiMedicineAddRecord)
+    {
+        startPage();
+        List<TXinyiMedicineAddRecord> list = tXinyiMedicineAddRecordService.selectTXinyiMedicineAddRecordList(tXinyiMedicineAddRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出信义碳源投加记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:record:export')")
+    @Log(title = "信义碳源投加记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TXinyiMedicineAddRecord tXinyiMedicineAddRecord)
+    {
+        List<TXinyiMedicineAddRecord> list = tXinyiMedicineAddRecordService.selectTXinyiMedicineAddRecordList(tXinyiMedicineAddRecord);
+        ExcelUtil<TXinyiMedicineAddRecord> util = new ExcelUtil<TXinyiMedicineAddRecord>(TXinyiMedicineAddRecord.class);
+        util.exportExcel(response, list, "信义碳源投加记录数据");
+    }
+
+    /**
+     * 获取信义碳源投加记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:record:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tXinyiMedicineAddRecordService.selectTXinyiMedicineAddRecordById(id));
+    }
+
+    /**
+     * 新增信义碳源投加记录
+     */
+    @PreAuthorize("@ss.hasPermi('business:record:add')")
+    @Log(title = "信义碳源投加记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TXinyiMedicineAddRecord tXinyiMedicineAddRecord)
+    {
+        tXinyiMedicineAddRecord.setCreateBy(getUsername());
+        return toAjax(tXinyiMedicineAddRecordService.insertTXinyiMedicineAddRecord(tXinyiMedicineAddRecord));
+    }
+
+    /**
+     * 修改信义碳源投加记录
+     */
+    @PreAuthorize("@ss.hasPermi('business:record:edit')")
+    @Log(title = "信义碳源投加记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TXinyiMedicineAddRecord tXinyiMedicineAddRecord)
+    {
+        tXinyiMedicineAddRecord.setUpdateBy(getUsername());
+        return toAjax(tXinyiMedicineAddRecordService.updateTXinyiMedicineAddRecord(tXinyiMedicineAddRecord));
+    }
+
+    /**
+     * 删除信义碳源投加记录
+     */
+    @PreAuthorize("@ss.hasPermi('business:record:remove')")
+    @Log(title = "信义碳源投加记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tXinyiMedicineAddRecordService.deleteTXinyiMedicineAddRecordByIds(ids));
+    }
+}

+ 8 - 0
slibra-system/src/main/java/com/slibra/business/domain/TXinyiMedicineAddRecord.java

@@ -103,5 +103,13 @@ public class TXinyiMedicineAddRecord extends BaseEntity
     @Excel(name = "乐观锁")
     private Long revision;
 
+    //2025年05月09日18:59:13 新增请求参数
+    //开始日期
+    private String dateBegin;
+
+    //截止日期
+    private String dateEnd;
+
+
 
 }

+ 30 - 26
slibra-system/src/main/resources/mapper/business/TXinyiMedicineAddRecordMapper.xml

@@ -35,32 +35,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <sql id="selectTXinyiMedicineAddRecordVo">
         select id, relative_id, add_hour, choose_pool, add_pool, kzxs, htfksd, can_add, real_val, calculate_val, one_val, two_val, one_htfksd, two_htfksd, one_kzxs, two_kzxs, zkz_down, zkz_up, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_xinyi_medicine_add_record
     </sql>
-
-    <select id="selectTXinyiMedicineAddRecordList" parameterType="TXinyiMedicineAddRecord" resultMap="TXinyiMedicineAddRecordResult">
-        <include refid="selectTXinyiMedicineAddRecordVo"/>
-        <where>
-            1 = 1
-            <if test="relativeId != null "> and relative_id = #{relativeId}</if>
-            <if test="addHour != null  and addHour != ''"> and add_hour = #{addHour}</if>
-            <if test="choosePool != null "> and choose_pool = #{choosePool}</if>
-            <if test="addPool != null "> and add_pool = #{addPool}</if>
-            <if test="kzxs != null "> and kzxs = #{kzxs}</if>
-            <if test="htfksd != null "> and htfksd = #{htfksd}</if>
-            <if test="canAdd != null "> and can_add = #{canAdd}</if>
-            <if test="realVal != null "> and real_val = #{realVal}</if>
-            <if test="calculateVal != null "> and calculate_val = #{calculateVal}</if>
-            <if test="oneVal != null "> and one_val = #{oneVal}</if>
-            <if test="twoVal != null "> and two_val = #{twoVal}</if>
-            <if test="oneHtfksd != null "> and one_htfksd = #{oneHtfksd}</if>
-            <if test="twoHtfksd != null "> and two_htfksd = #{twoHtfksd}</if>
-            <if test="oneKzxs != null "> and one_kzxs = #{oneKzxs}</if>
-            <if test="twoKzxs != null "> and two_kzxs = #{twoKzxs}</if>
-            <if test="zkzDown != null "> and zkz_down = #{zkzDown}</if>
-            <if test="zkzUp != null "> and zkz_up = #{zkzUp}</if>
-            <if test="revision != null "> and revision = #{revision}</if>
-        </where>
-        and del_flag = 0 order by id desc
-    </select>
     
     <select id="selectTXinyiMedicineAddRecordById" parameterType="Long" resultMap="TXinyiMedicineAddRecordResult">
         <include refid="selectTXinyiMedicineAddRecordVo"/>
@@ -181,4 +155,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY
             id ASC
     </select>
+
+
+    <select id="selectTXinyiMedicineAddRecordList" parameterType="TXinyiMedicineAddRecord" resultMap="TXinyiMedicineAddRecordResult">
+        <include refid="selectTXinyiMedicineAddRecordVo"/>
+        <where>
+            1 = 1
+            <if test="relativeId != null "> and relative_id = #{relativeId}</if>
+            <if test="addHour != null  and addHour != ''"> and add_hour = #{addHour}</if>
+            <if test="choosePool != null "> and choose_pool = #{choosePool}</if>
+            <if test="addPool != null "> and add_pool = #{addPool}</if>
+            <if test="kzxs != null "> and kzxs = #{kzxs}</if>
+            <if test="htfksd != null "> and htfksd = #{htfksd}</if>
+            <if test="canAdd != null "> and can_add = #{canAdd}</if>
+            <if test="realVal != null "> and real_val = #{realVal}</if>
+            <if test="calculateVal != null "> and calculate_val = #{calculateVal}</if>
+            <if test="oneVal != null "> and one_val = #{oneVal}</if>
+            <if test="twoVal != null "> and two_val = #{twoVal}</if>
+            <if test="oneHtfksd != null "> and one_htfksd = #{oneHtfksd}</if>
+            <if test="twoHtfksd != null "> and two_htfksd = #{twoHtfksd}</if>
+            <if test="oneKzxs != null "> and one_kzxs = #{oneKzxs}</if>
+            <if test="twoKzxs != null "> and two_kzxs = #{twoKzxs}</if>
+            <if test="zkzDown != null "> and zkz_down = #{zkzDown}</if>
+            <if test="zkzUp != null "> and zkz_up = #{zkzUp}</if>
+            <if test="revision != null "> and revision = #{revision}</if>
+            <!-- 2025年05月09日18:59:50 新增的筛选条件 -->
+            <if test="dateBegin != null "> and SUBSTRING(add_hour, 1, 10)  &gt;= #{dateBegin}</if>
+            <if test="dateEnd != null "> and SUBSTRING(add_hour, 1, 10)  &lt;= #{dateEnd}</if>
+        </where>
+        and del_flag = 0 order by id desc
+    </select>
 </mapper>