Просмотр исходного кода

智能仓房添加查询条件

hanqingsong лет назад: 5
Родитель
Сommit
3926223855

+ 2 - 3
src/main/java/com/chinaitop/depot/intelligent/grainsituation/controller/InsectPestDetectionController.java

@@ -62,14 +62,13 @@ public class InsectPestDetectionController {
62 62
             @ApiImplicitParam(name = "iEndTdh", value = "结束通道号", paramType = "query"),
63 63
             @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
64 64
     })
65
-    public ResponseEntity<PageInfo<Map<String, Object>>> getList(Integer pageNum, Integer pageSize, String vCfCode,
66
-                                                                 Integer iBeginTdh, Integer iEndTdh,String orgId) {
65
+    public ResponseEntity<PageInfo<Map<String, Object>>> getList(Integer pageNum, Integer pageSize, String vCfCode, Integer iBeginTdh, Integer iEndTdh,String orgId, String startTime, String endTime) {
67 66
         List<Map<String, Object>> list = null;
68 67
         try {
69 68
             if (null != pageNum && null != pageSize) {
70 69
                 PageHelper.startPage(pageNum, pageSize);
71 70
             }
72
-            list = insectPestDetectionService.getList(vCfCode, iBeginTdh, iEndTdh,orgId);
71
+            list = insectPestDetectionService.getList(vCfCode, iBeginTdh, iEndTdh,orgId,startTime,endTime);
73 72
         } catch (Exception e) {
74 73
             e.printStackTrace();
75 74
             return ResponseEntity.failed("查询失败");

+ 2 - 2
src/main/java/com/chinaitop/depot/intelligent/grainsituation/controller/TWarningThresholdHistoryController.java

@@ -48,13 +48,13 @@ public class TWarningThresholdHistoryController {
48 48
             @ApiImplicitParam(name = "searchEndDate", value = "结束时间", paramType = "query"),
49 49
             @ApiImplicitParam(name = "showType", value = "模块名称", paramType = "query")
50 50
     })
51
-    public ResponseEntity<PageInfo<TWarningThresholdHistory>> getList(Integer pageNum, Integer pageSize, String vCfCode, Integer state, String searchStartDate, String searchEndDate, String showType) {
51
+    public ResponseEntity<PageInfo<TWarningThresholdHistory>> getList(Integer pageNum, Integer pageSize, String vCfCode, Integer state, String searchStartDate, String searchEndDate, String showType, String wName) {
52 52
         List<TWarningThresholdHistory> list = null;
53 53
         try {
54 54
             if (null != pageNum && null != pageSize) {
55 55
                 PageHelper.startPage(pageNum, pageSize);
56 56
             }
57
-            list = tWarningThresholdHistoryService.getList(vCfCode, state, searchStartDate, searchEndDate, showType);
57
+            list = tWarningThresholdHistoryService.getList(vCfCode, state, searchStartDate, searchEndDate, showType, wName);
58 58
         } catch (Exception e) {
59 59
             e.printStackTrace();
60 60
             return ResponseEntity.failed("查询失败");

+ 4 - 1
src/main/java/com/chinaitop/depot/intelligent/grainsituation/mapper/TCcdataMapper.xml

@@ -401,12 +401,15 @@
401 401
     t_ccdata td
402 402
     LEFT JOIN t_ccvalue tv ON td.v_update_time = tv.v_update_time
403 403
     WHERE td.org_id = #{orgId} and td.v_cc_code = tv.v_cc_code
404
-    <if test="iBeginTdh != null and test=iEndTdh != null">
404
+    <if test="iBeginTdh != null and iEndTdh != null">
405 405
       and td.i_tdh BETWEEN #{iBeginTdh, jdbcType=INTEGER} AND #{iEndTdh, jdbcType=INTEGER}
406 406
     </if>
407 407
     <if test="vCfCode != null">
408 408
       and tv.v_cf_code = #{vCfCode}
409 409
     </if>
410
+    <if test="startTime != null and endTime != null">
411
+      and td.v_update_time BETWEEN #{startTime} AND #{endTime}
412
+    </if>
410 413
     ORDER BY
411 414
     td.v_update_time DESC
412 415
   </select>

+ 1 - 1
src/main/java/com/chinaitop/depot/intelligent/grainsituation/service/InsectPestDetectionService.java

@@ -20,7 +20,7 @@ public interface InsectPestDetectionService {
20 20
      * @param iEndTdh
21 21
      * @return
22 22
      */
23
-    List<Map<String, Object>> getList(String vCfCode, Integer iBeginTdh, Integer iEndTdh,String orgId);
23
+    List<Map<String, Object>> getList(String vCfCode, Integer iBeginTdh, Integer iEndTdh,String orgId, String startTime, String endTime);
24 24
 
25 25
     /**
26 26
      * 图表展示

+ 1 - 1
src/main/java/com/chinaitop/depot/intelligent/grainsituation/service/TWarningThresholdHistoryService.java

@@ -7,7 +7,7 @@ import java.util.Map;
7 7
 
8 8
 public interface TWarningThresholdHistoryService {
9 9
 
10
-    List<TWarningThresholdHistory> getList(String vCfCode, Integer state,String searchStartDate,String searchEndDate,String showType);
10
+    List<TWarningThresholdHistory> getList(String vCfCode, Integer state,String searchStartDate,String searchEndDate,String showType, String wName);
11 11
 
12 12
     Map<String, List<TWarningThresholdHistory>> getCfCdoeAndTimes(List cfcodes,List times);
13 13
 

+ 5 - 1
src/main/java/com/chinaitop/depot/intelligent/grainsituation/service/impl/InsectPestDetectionServiceImpl.java

@@ -44,7 +44,7 @@ public class InsectPestDetectionServiceImpl implements InsectPestDetectionServic
44 44
      * @return
45 45
      */
46 46
     @Override
47
-    public List<Map<String, Object>> getList(String vCfCode, Integer iBeginTdh, Integer iEndTdh,String orgId) {
47
+    public List<Map<String, Object>> getList(String vCfCode, Integer iBeginTdh, Integer iEndTdh,String orgId, String startTime, String endTime) {
48 48
         Map<String, Object> map = new HashMap<>();
49 49
         map.put("orgId", orgId);
50 50
         if (StringUtils.isNotBlank(vCfCode)) {
@@ -62,6 +62,10 @@ public class InsectPestDetectionServiceImpl implements InsectPestDetectionServic
62 62
             map.put("iBeginTdh", iEndTdh);
63 63
             map.put("iEndTdh", iEndTdh);
64 64
         }
65
+        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
66
+            map.put("startTime", startTime);
67
+            map.put("endTime", endTime);
68
+        }
65 69
         return tCcdataMapper.getList(map);
66 70
     }
67 71
 

+ 4 - 1
src/main/java/com/chinaitop/depot/intelligent/grainsituation/service/impl/TWarningThresholdHistoryServiceImpl.java

@@ -22,7 +22,7 @@ public class TWarningThresholdHistoryServiceImpl implements TWarningThresholdHis
22 22
     private TWarningThresholdHistoryMapper tWarningThresholdHistoryMapper;
23 23
 
24 24
     @Override
25
-    public List<TWarningThresholdHistory> getList(String vCfCode, Integer state, String searchStartDate, String searchEndDate, String showType) {
25
+    public List<TWarningThresholdHistory> getList(String vCfCode, Integer state, String searchStartDate, String searchEndDate, String showType, String wName) {
26 26
         TWarningThresholdHistoryExample example = new TWarningThresholdHistoryExample();
27 27
         TWarningThresholdHistoryExample.Criteria criteria = example.createCriteria();
28 28
         if (StringUtils.isNotBlank(vCfCode)){
@@ -41,6 +41,9 @@ public class TWarningThresholdHistoryServiceImpl implements TWarningThresholdHis
41 41
         if (StringUtils.isNotBlank(searchStartDate) && StringUtils.isNotBlank(searchEndDate)){
42 42
             criteria.andWTimeBetween(DateUtils.stringToData(searchStartDate+DateUtils.startTime),DateUtils.stringToData(searchEndDate+DateUtils.endTime));
43 43
         }
44
+        if (StringUtils.isNotBlank(wName)) {
45
+            criteria.andWNameEqualTo(wName);
46
+        }
44 47
         criteria.andWWarningEqualTo("0");
45 48
         example.setOrderByClause("w_time DESC");
46 49
         List<TWarningThresholdHistory> tWarningThresholdHistories = tWarningThresholdHistoryMapper.selectByExample(example);