lvzhikai лет назад: 5
Родитель
Сommit
a939a7171c

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

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

+ 3 - 0
src/main/java/com/chinaitop/depot/intelligent/grainsituation/mapper/TCcdataMapper.xml

@@ -407,6 +407,9 @@
407 407
     <if test="vCfCode != null">
408 408
       and tv.v_cf_code = #{vCfCode}
409 409
     </if>
410
+    <if test="createTime != null">
411
+      AND td.v_update_time &lt; #{createTime}
412
+    </if>
410 413
     ORDER BY td.v_update_time DESC
411 414
   </select>
412 415
 </mapper>

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

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

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

@@ -21,6 +21,8 @@ import org.springframework.stereotype.Service;
21 21
 import org.springframework.transaction.annotation.Transactional;
22 22
 
23 23
 import javax.annotation.Resource;
24
+import java.text.ParseException;
25
+import java.text.SimpleDateFormat;
24 26
 import java.util.*;
25 27
 
26 28
 @Service
@@ -43,7 +45,7 @@ public class InsectPestDetectionServiceImpl implements InsectPestDetectionServic
43 45
      * @return
44 46
      */
45 47
     @Override
46
-    public List<Map<String, Object>> getList(String vCfCode, Integer iBeginTdh, Integer iEndTdh,String orgId) {
48
+    public List<Map<String, Object>> getList(String vCfCode, Integer iBeginTdh, Integer iEndTdh,String createTime,String orgId) {
47 49
         Map<String, Object> map = new HashMap<>();
48 50
         map.put("orgId", orgId);
49 51
         if (StringUtils.isNotBlank(vCfCode)) {
@@ -61,6 +63,16 @@ public class InsectPestDetectionServiceImpl implements InsectPestDetectionServic
61 63
             map.put("iBeginTdh", iEndTdh);
62 64
             map.put("iEndTdh", iEndTdh);
63 65
         }
66
+        if (null == createTime && null != createTime) {//归档用
67
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
68
+            Date date = null;
69
+            try {
70
+                date = dateFormat.parse(createTime);
71
+            } catch (ParseException e) {
72
+                e.printStackTrace();
73
+            }
74
+            map.put("createTime", date);
75
+        }
64 76
         return tCcdataMapper.getList(map);
65 77
     }
66 78
 

+ 14 - 0
src/main/java/com/chinaitop/depot/intelligent/grainsituation/service/impl/TWarningThresholdHistoryServiceImpl.java

@@ -12,6 +12,9 @@ import org.apache.commons.lang3.StringUtils;
12 12
 import org.springframework.stereotype.Service;
13 13
 
14 14
 import javax.annotation.Resource;
15
+import java.text.ParseException;
16
+import java.text.SimpleDateFormat;
17
+import java.util.Date;
15 18
 import java.util.HashMap;
16 19
 import java.util.List;
17 20
 import java.util.Map;
@@ -45,6 +48,17 @@ public class TWarningThresholdHistoryServiceImpl implements TWarningThresholdHis
45 48
         if (StringUtils.isNotBlank(searchStartDate) && StringUtils.isNotBlank(searchEndDate)) {
46 49
             criteria.andWTimeBetween(DateUtils.stringToData(searchStartDate + DateUtils.startTime), DateUtils.stringToData(searchEndDate + DateUtils.endTime));
47 50
         }
51
+        if (StringUtils.isNotBlank(searchEndDate)) {
52
+
53
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
54
+            Date date = null;
55
+            try {
56
+                date = dateFormat.parse(searchEndDate);
57
+            } catch (ParseException e) {
58
+                e.printStackTrace();
59
+            }
60
+            criteria.andWTimeLessThan(date);
61
+        }
48 62
         criteria.andWWarningEqualTo(ConstUtils.ZERO);
49 63
         example.setOrderByClause("w_time DESC");
50 64
         List<TWarningThresholdHistory> tWarningThresholdHistories = tWarningThresholdHistoryMapper.selectByExample(example);

+ 12 - 0
src/main/java/com/chinaitop/depot/intelligent/grainsituation/service/impl/TemperatureRecordServiceImpl.java

@@ -15,6 +15,8 @@ import org.springframework.stereotype.Service;
15 15
 import org.springframework.transaction.annotation.Transactional;
16 16
 
17 17
 import javax.annotation.Resource;
18
+import java.text.ParseException;
19
+import java.text.SimpleDateFormat;
18 20
 import java.util.*;
19 21
 import java.util.stream.Collectors;
20 22
 import java.util.stream.Stream;
@@ -41,6 +43,16 @@ public class TemperatureRecordServiceImpl implements TemperatureRecordService {
41 43
         if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
42 44
             criteria.andTTimeBetween(DateUtils.stringToData(startTime + DateUtils.startTime), DateUtils.stringToData(endTime + DateUtils.endTime));
43 45
         }
46
+        if (StringUtils.isNotBlank(endTime)) {
47
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
48
+            Date date = null;
49
+            try {
50
+                date = dateFormat.parse(endTime);
51
+            } catch (ParseException e) {
52
+                e.printStackTrace();
53
+            }
54
+            criteria.andTTimeLessThan(date);
55
+        }
44 56
         if (StringUtils.isNotEmpty(tType)) {
45 57
             criteria.andIlqYqEqualTo(tType);
46 58
         }