Commit 462a1045 authored by lisong's avatar lisong

修改bug

parent a3d2aa39
...@@ -381,18 +381,24 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -381,18 +381,24 @@ public class SupervisionConfigureController extends AbstractBaseController {
} catch (ParseException e) { } catch (ParseException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
long res = start - end; long res = 0;
if (start > end){
res = start - end;
}else {
res = end - start;
}
diffMinute = res / 1000 / 60; diffMinute = res / 1000 / 60;
} }
long finalDiffMinute = diffMinute; long finalDiffMinute = diffMinute;
pressurePumpInfo.getRecords().stream( pressurePumpInfo.getRecords().stream(
).map(item -> { ).map(item -> {
item.put("startAndStopInterval", finalDiffMinute); item.put("startAndStopInterval", finalDiffMinute);
// if (finalDiffMinute > 5) { if (finalDiffMinute > 5) {
// item.put("stateDesc", "异常"); item.put("generalState", "异常");
// } else { } else {
// item.put("stateDesc", "正常"); item.put("generalState", "正常");
// } }
item.put("nameKey", pressurePumpStart); item.put("nameKey", pressurePumpStart);
return item; return item;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -5009,6 +5009,26 @@ ...@@ -5009,6 +5009,26 @@
OR ( `is_alarm` = 0 AND `value` = 'false' )) OR ( `is_alarm` = 0 AND `value` = 'false' ))
</select> </select>
<select id="queryStartAndStopBySpecificId" resultType="java.util.Map"> <select id="queryStartAndStopBySpecificId" resultType="java.util.Map">
( SELECT
i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
i.equipment_index_name
FROM
wl_equipment_specific_index i
WHERE
<if test="ids != null and ids.size > 0">
i.equipment_specific_id IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND
</if>
i.equipment_index_key in ('FHS_PressurePump_Start')
ORDER BY
i.update_date DESC
limit 1
) union
(
SELECT SELECT
i.equipment_specific_id, i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date, DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
...@@ -5023,10 +5043,11 @@ ...@@ -5023,10 +5043,11 @@
</foreach> </foreach>
AND AND
</if> </if>
i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop') i.equipment_index_key in ('FHS_PressurePump_Stop')
ORDER BY ORDER BY
i.update_date DESC i.update_date DESC
limit 2 limit 1
)
</select> </select>
<select id="queryStateBySpecificId" resultType="java.util.Map"> <select id="queryStateBySpecificId" resultType="java.util.Map">
SELECT SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment