Commit 03064ffa authored by 李秀明's avatar 李秀明

fix(物联报表): 告警数据统计错误

parent 90a5fb20
...@@ -1649,9 +1649,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1649,9 +1649,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
alarmMap.put("fault_equip_num", ObjectUtils.isEmpty(alarm.get("fault_equip_num")) ? "" : String.valueOf(alarm.get("fault_equip_num"))); alarmMap.put("fault_equip_num", ObjectUtils.isEmpty(alarm.get("fault_equip_num")) ? "" : String.valueOf(alarm.get("fault_equip_num")));
// 故障信息条数 // 故障信息条数
alarmMap.put("alarm_info_num", ObjectUtils.isEmpty(alarm.get("fault_info_num")) ? "" : String.valueOf(alarm.get("fault_info_num"))); alarmMap.put("alarm_info_num", ObjectUtils.isEmpty(alarm.get("fault_info_num")) ? "" : String.valueOf(alarm.get("fault_info_num")));
if (Integer.parseInt(alarmMap.get("alarm_info_num").toString()) == 0) {
continue;
}
// 设备故障率 // 设备故障率
alarmMap.put("faultEquipPercent", ObjectUtils.isEmpty(alarm.get("faultEquipPercent")) ? "" : String.valueOf(alarm.get("faultEquipPercent"))); alarmMap.put("faultEquipPercent", ObjectUtils.isEmpty(alarm.get("faultEquipPercent")) ? "" : String.valueOf(alarm.get("faultEquipPercent")));
// 报警设备总数 // 报警设备总数
...@@ -1863,9 +1860,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1863,9 +1860,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} else { } else {
listItem.put("alarmEquipNum", String.valueOf(0)); listItem.put("alarmEquipNum", String.valueOf(0));
} }
if (Integer.parseInt(listItem.get("alarmEquipNum").toString()) == 0) {
continue;
}
// listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum"))); // listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum")));
// 7日告警条数 // 7日告警条数
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) { if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) {
...@@ -1874,6 +1868,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1874,6 +1868,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} else { } else {
listItem.put("trueNum", String.valueOf(0)); listItem.put("trueNum", String.valueOf(0));
} }
if (Integer.parseInt(listItem.get("trueNum").toString()) == 0) {
continue;
}
list.add(listItem); list.add(listItem);
} }
} else { } else {
......
...@@ -4222,8 +4222,8 @@ ...@@ -4222,8 +4222,8 @@
and FIND_IN_SET( #{systemId},e.system_id) and FIND_IN_SET( #{systemId},e.system_id)
AND e.equipment_code = spec.equipment_code AND e.equipment_code = spec.equipment_code
AND e.index_key = spec_index.equipment_index_key AND e.index_key = spec_index.equipment_index_key
AND e.report_date >= DATE_FORMAT(#{startDate},'%y-%m-%d') AND e.report_date >= DATE_FORMAT(#{startDate},'%Y-%m-%d')
AND e.report_date &lt;= DATE_FORMAT(#{endDate},'%y-%m-%d') AND e.report_date &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d')
), ),
0 0
) AS alarmEquipNum ) AS alarmEquipNum
...@@ -4239,7 +4239,7 @@ ...@@ -4239,7 +4239,7 @@
)temp LEFT JOIN wl_equipment_index wei on temp.equipment_index_id = wei.id )temp LEFT JOIN wl_equipment_index wei on temp.equipment_index_id = wei.id
)temp1 on temp.system_id = temp1.systemId and temp.code = temp1.code )temp1 on temp.system_id = temp1.systemId and temp.code = temp1.code
group by type_code group by code, type_code
ORDER BY temp.name ORDER BY temp.name
</select> </select>
<select id="selectAlarms" resultType="java.lang.Integer"> <select id="selectAlarms" resultType="java.lang.Integer">
...@@ -4383,7 +4383,7 @@ ...@@ -4383,7 +4383,7 @@
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.id
LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id) left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where FIND_IN_SET(#{systemId} , spec.system_id) and spec.create_date &lt; #{endDate} where FIND_IN_SET(#{systemId} , spec.system_id) AND equipment.is_iot = 1
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1 GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id GROUP BY a1.system_id
) as b ) as b
......
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