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

Merge remote-tracking branch 'origin/master'

aihua лет назад: 3
Родитель
Сommit
28645d3148

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

@@ -3,6 +3,7 @@ package com.chinaitop.depot.risk.controller;
3 3
 import com.chinaitop.depot.risk.model.HumidityAlarm;
4 4
 import com.chinaitop.depot.risk.service.HumidityAlarmService;
5 5
 import com.chinaitop.depot.unissoft.model.ResponseEntity;
6
+import com.chinaitop.depot.utils.ParameterUtil;
6 7
 import com.github.pagehelper.PageHelper;
7 8
 import com.github.pagehelper.PageInfo;
8 9
 import com.google.common.collect.Maps;
@@ -55,17 +56,15 @@ public class HumidityAlarmController {
55 56
         }
56 57
         Map<String, Object> queryMap = Maps.newHashMap();
57 58
         if (StringUtils.isNotBlank(startDate)) {
58
-            queryMap.put("startDate", startDate);
59
+            queryMap.put("startDate", ParameterUtil.string2datetime(startDate));
59 60
         }
60 61
         if (StringUtils.isNotBlank(endDate)) {
61
-            queryMap.put("endDate", endDate);
62
+            queryMap.put("endDate", ParameterUtil.string2datetime(endDate));
62 63
         }
63 64
         if (StringUtils.isNotBlank(storehouseName)) {
64 65
             queryMap.put("storehouseName", storehouseName);
65 66
         }
66 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 21
         <if test="storehouseName != null">
22 22
             and bs.storehouse_name = #{storehouseName}
23 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 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 29
         </if>
30 30
     </select>
31 31
 </mapper>