Commit dd7480c3 authored by tianyiming's avatar tianyiming

修改bug

parent ff9b4ff2
...@@ -321,18 +321,17 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -321,18 +321,17 @@ public class SupervisionConfigureController extends AbstractBaseController {
item.put("equipment_index_name", stateMap.get("equipment_index_name")); item.put("equipment_index_name", stateMap.get("equipment_index_name"));
if ("启动".equals(stateMap.get("equipment_index_name"))) { if ("启动".equals(stateMap.get("equipment_index_name"))) {
long update_time = 0L; long update_time = 0L;
try { try {
update_time = sdf.parse(String.valueOf(stateMap.get("update_date")).replaceAll("T", " ")).getTime(); update_time = sdf.parse(String.valueOf(stateMap.get("update_date")).replaceAll("T", " ")).getTime();
} catch (ParseException e) { } catch (ParseException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
long res = nowDateTime - update_time; long res = nowDateTime - update_time;
long diffMinute = res / 1000 / 60; long diffMinute = res / 1000 / 60;
if (diffMinute <= 5) { if (diffMinute <= 5) {
time = true; time = true;
} }
item.put("upTime",diffMinute);
} }
} }
item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? "正常" : "异常"); item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? "正常" : "异常");
...@@ -341,9 +340,8 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -341,9 +340,8 @@ public class SupervisionConfigureController extends AbstractBaseController {
List<Map<String, Object>> stateMap = fireFightingSystemMapper.queryStartAndStopBySpecificId(ids); List<Map<String, Object>> stateMap = fireFightingSystemMapper.queryStartAndStopBySpecificId(ids);
long diffMinute = 0L; long diffMinute = 0L;
if (!ObjectUtils.isEmpty(stateMap)) { if (!ObjectUtils.isEmpty(stateMap)) {
List<Map<String, Object>> map = fireFightingSystemMapper.queryStateBySpecificId((long) stateMap.get(0).get("equipment_specific_id")); String startTime = stateMap.get(0).get("update_date").toString();
String startTime = map.get(0).get("update_date").toString(); String endTime = stateMap.get(1).get("update_date").toString();
String endTime = map.get(1).get("update_date").toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long start = 0L; long start = 0L;
long end = 0L; long end = 0L;
......
...@@ -1347,7 +1347,7 @@ ...@@ -1347,7 +1347,7 @@
find_in_set( #{param.system}, `wlesal`.`system_codes` ) find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if> </if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''"> <if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wles.equipment_specific_index_key like concat (#{param.fireEquipmentSpecificIndexKey},'%') AND wles.type = #{param.fireEquipmentSpecificIndexKey}
</if> </if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''"> <if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wles.biz_org_code like concat (#{param.bizOrgCode},'%') AND wles.biz_org_code like concat (#{param.bizOrgCode},'%')
......
...@@ -4930,10 +4930,12 @@ ...@@ -4930,10 +4930,12 @@
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=","> <foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
AND
</if> </if>
AND i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop') i.equipment_index_key in ('FHS_PressurePump_Start', 'FHS_PressurePump_Stop')
ORDER BY ORDER BY
i.update_date DESC i.update_date DESC
limit 2
</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