소스 검색

设备和查询追溯新增查询条件

mengy 4 년 전
부모
커밋
4a4ae2c0da

+ 7 - 3
src/main/java/com/chinaitop/depot/supervise/controller/GrainConditionController.java

@@ -41,11 +41,15 @@ public class GrainConditionController {
41 41
             @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
42 42
             @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
43 43
             @ApiImplicitParam(name = "houseNo", value = "仓房id", paramType = "query"),
44
-            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
44
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query"),
45
+            @ApiImplicitParam(name = "TestStartDate", value = "检测日期开始", paramType = "query"),
46
+            @ApiImplicitParam(name = "TestEndDate", value = "检测日期结束", paramType = "query")
45 47
     })
46
-    public PageInfo<Map<String,Object>> getDataList(Integer pageNum, Integer pageSize,String houseNo, String orgId){
48
+    public PageInfo<Map<String,Object>> getDataList(Integer pageNum, Integer pageSize,String houseNo, String orgId, String TestStartDate, String TestEndDate){
47 49
         PageHelper.startPage(pageNum, pageSize);
48
-        List<Map<String,Object>> retList = grainConditionService.getDataList(houseNo, orgId);
50
+
51
+
52
+        List<Map<String,Object>> retList = grainConditionService.getDataList(houseNo, orgId,TestStartDate, TestEndDate);
49 53
         PageInfo<Map<String,Object>> pageInfo = new PageInfo<Map<String,Object>>(retList);
50 54
         return pageInfo;
51 55
     }

+ 6 - 0
src/main/java/com/chinaitop/depot/supervise/mapper/TestDatasMapper.xml

@@ -91,6 +91,12 @@
91 91
       <if test="houseNo != null" >
92 92
           AND si.storehouse_code = #{houseNo,jdbcType=VARCHAR}
93 93
       </if>
94
+      <if test="TestStartDate !=null">
95
+          and STR_TO_DATE(t2.time, '%Y-%m-%d')  <![CDATA[ >= ]]> #{TestStartDate}
96
+      </if>
97
+      <if test="TestEndDate !=null">
98
+          and STR_TO_DATE(t2.time, '%Y-%m-%d')  &lt;= #{TestEndDate}
99
+      </if>
94 100
   </select>
95 101
 
96 102
   <select id="selectByDays" resultType="java.util.Map" parameterType="java.util.Map" >

+ 1 - 1
src/main/java/com/chinaitop/depot/supervise/service/GrainConditionService.java

@@ -7,7 +7,7 @@ public interface GrainConditionService {
7 7
      * 获取最新仓房温度列表
8 8
      * @return
9 9
      */
10
-    List<Map<String,Object>> getDataList(String houseNo, String orgId);
10
+    List<Map<String,Object>> getDataList(String houseNo, String orgId, String TestStartDate, String TestEndDate);
11 11
 
12 12
     List<Map<String,Object>> getThreeCondition(Map<String,Object> example);
13 13
 

+ 5 - 1
src/main/java/com/chinaitop/depot/supervise/service/impl/GrainConditionServiceImpl.java

@@ -25,11 +25,15 @@ public class GrainConditionServiceImpl implements GrainConditionService {
25 25
      * @return
26 26
      */
27 27
     @Override
28
-    public List<Map<String, Object>> getDataList(String houseNo, String orgId) {
28
+    public List<Map<String, Object>> getDataList(String houseNo, String orgId, String TestStartDate, String TestEndDate) {
29 29
         Map<String,String> map = new HashMap<String, String>();
30 30
         if(!StringUtils.isEmpty(houseNo)){
31 31
             map.put("houseNo",houseNo);
32 32
         }
33
+        if(ParameterUtil.isnotnull(TestStartDate) && ParameterUtil.isnotnull(TestEndDate)){
34
+            map.put("TestStartDate",TestStartDate);
35
+            map.put("TestEndDate",TestEndDate);
36
+        }
33 37
         map.put("orgId",orgId);
34 38
         return testDatasMapper.getDataList(map);
35 39
     }