Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

aihua 3 yıl önce
ebeveyn
işleme
28645d3148

+ 4 - 5
src/main/java/com/chinaitop/depot/risk/controller/HumidityAlarmController.java

@@ -3,6 +3,7 @@ package com.chinaitop.depot.risk.controller;
3
 import com.chinaitop.depot.risk.model.HumidityAlarm;
3
 import com.chinaitop.depot.risk.model.HumidityAlarm;
4
 import com.chinaitop.depot.risk.service.HumidityAlarmService;
4
 import com.chinaitop.depot.risk.service.HumidityAlarmService;
5
 import com.chinaitop.depot.unissoft.model.ResponseEntity;
5
 import com.chinaitop.depot.unissoft.model.ResponseEntity;
6
+import com.chinaitop.depot.utils.ParameterUtil;
6
 import com.github.pagehelper.PageHelper;
7
 import com.github.pagehelper.PageHelper;
7
 import com.github.pagehelper.PageInfo;
8
 import com.github.pagehelper.PageInfo;
8
 import com.google.common.collect.Maps;
9
 import com.google.common.collect.Maps;
@@ -55,17 +56,15 @@ public class HumidityAlarmController {
55
         }
56
         }
56
         Map<String, Object> queryMap = Maps.newHashMap();
57
         Map<String, Object> queryMap = Maps.newHashMap();
57
         if (StringUtils.isNotBlank(startDate)) {
58
         if (StringUtils.isNotBlank(startDate)) {
58
-            queryMap.put("startDate", startDate);
59
+            queryMap.put("startDate", ParameterUtil.string2datetime(startDate));
59
         }
60
         }
60
         if (StringUtils.isNotBlank(endDate)) {
61
         if (StringUtils.isNotBlank(endDate)) {
61
-            queryMap.put("endDate", endDate);
62
+            queryMap.put("endDate", ParameterUtil.string2datetime(endDate));
62
         }
63
         }
63
         if (StringUtils.isNotBlank(storehouseName)) {
64
         if (StringUtils.isNotBlank(storehouseName)) {
64
             queryMap.put("storehouseName", storehouseName);
65
             queryMap.put("storehouseName", storehouseName);
65
         }
66
         }
66
         queryMap.put("orgId", orgId);
67
         queryMap.put("orgId", orgId);
67
-        List<HumidityAlarm> list = humidityAlarmService.selectList(queryMap);
68
-        PageInfo<HumidityAlarm> pageInfo = new PageInfo<>(list);
69
-        return ResponseEntity.ok(pageInfo);
68
+        return ResponseEntity.ok(new PageInfo<>(humidityAlarmService.selectList(queryMap)));
70
     }
69
     }
71
 }
70
 }

+ 4 - 4
src/main/java/com/chinaitop/depot/risk/mapper/HumidityAlarmMapper.xml

@@ -21,11 +21,11 @@
21
         <if test="storehouseName != null">
21
         <if test="storehouseName != null">
22
             and bs.storehouse_name = #{storehouseName}
22
             and bs.storehouse_name = #{storehouseName}
23
         </if>
23
         </if>
24
-        <if test="startDate != null and endDate != null" >
25
-            and tw.w_time BETWEEN #{startDate} AND #{endDate}
24
+        <if test="startDate != null" >
25
+            <![CDATA[ and tw.w_time >= #{startDate} ]]>
26
         </if>
26
         </if>
27
-        <if test="startDate != null and endDate != null" >
28
-            and tw.w_time &lt;= #{endDate}
27
+        <if test="endDate != null" >
28
+            <![CDATA[ and tw.w_time <= #{endDate} ]]>
29
         </if>
29
         </if>
30
     </select>
30
     </select>
31
 </mapper>
31
 </mapper>