Commit 462a1045 authored by lisong's avatar lisong

修改bug

parent a3d2aa39
......@@ -381,18 +381,24 @@ public class SupervisionConfigureController extends AbstractBaseController {
} catch (ParseException 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;
}
long finalDiffMinute = diffMinute;
pressurePumpInfo.getRecords().stream(
).map(item -> {
item.put("startAndStopInterval", finalDiffMinute);
// if (finalDiffMinute > 5) {
// item.put("stateDesc", "异常");
// } else {
// item.put("stateDesc", "正常");
// }
if (finalDiffMinute > 5) {
item.put("generalState", "异常");
} else {
item.put("generalState", "正常");
}
item.put("nameKey", pressurePumpStart);
return item;
}).collect(Collectors.toList());
......
......@@ -5009,6 +5009,26 @@
OR ( `is_alarm` = 0 AND `value` = 'false' ))
</select>
<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
i.equipment_specific_id,
DATE_FORMAT(i.update_date,'%Y-%m-%d %H:%i:%S') update_date,
......@@ -5023,10 +5043,11 @@
</foreach>
AND
</if>
i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
i.equipment_index_key in ('FHS_PressurePump_Stop')
ORDER BY
i.update_date DESC
limit 2
limit 1
)
</select>
<select id="queryStateBySpecificId" resultType="java.util.Map">
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