Commit 6597a33e authored by litengwei's avatar litengwei

bug 提交

parent 9085a7cc
......@@ -58,6 +58,8 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> getSystemAlarmTheCount(@Param("status") String status,@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getSystemAlarmCount(@Param("status") String status,@Param("current") int current,@Param("size") int size,@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getCAFSWaterTankInfo();
......
......@@ -17,7 +17,7 @@ public interface IEmergencyService {
* @return
*/
List<Map<String, Object>> getSystemState(String bizOrgCode);
List<Map<String, Object>> getSystemAlarmCount(String status, int current, int size,String bizOrgCode);
Map<String, Object> getSystemAlarmCount(String status, int current, int size,String bizOrgCode);
/**
* @return
......
......@@ -86,7 +86,10 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override
public List<Map<String, Object>> getSystemAlarmCount(String status, int current, int size, String bizOrgCode) {
public Map<String, Object> getSystemAlarmCount(String status, int current, int size, String bizOrgCode) {
Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> map = emergencyMapper.getSystemAlarmTheCount(status, bizOrgCode);
resultMap.put("total", map.get("total"));
List<Map<String, Object>> list = emergencyMapper.getSystemAlarmCount(status,current,size,bizOrgCode);
if (0 < list.size()) {
list.forEach(x -> {
......@@ -98,7 +101,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
}
});
}
return list;
resultMap.put("records", list);
return resultMap;
}
@Override
......
......@@ -36,6 +36,56 @@
`fs`.`sort`
</select>
<select id="getSystemAlarmTheCount" resultType="java.util.Map">
SELECT
count(*) as total
FROM
(
SELECT
`fs`.`id` AS `key`,
`fs`.`name` AS `name`,
`fs`.system_type_code AS systemTypeCode,
`fs`.`code` AS CODE,
`fs`.`biz_org_code` AS bizOrgCode,
`fs`.`biz_org_name` AS bizOrgName,
(
SELECT
count( * )
FROM
( SELECT id FROM wl_equipment_specific_alarm_log WHERE system_codes = fs.CODE AND clean_time IS NULL GROUP BY equipment_specific_id ) b
) AS alarmNum,
IF
(
(
(
SELECT
count( `wesa`.`equipment_specific_id` )
FROM
`wl_equipment_specific_alarm` `wesa`
WHERE
( 0 <![CDATA[<>]]> find_in_set( `fs`.`id`, `wesa`.`system_ids` ) AND `wesa`.`status` = 1 )
) > 0
),
'异常',
'正常'
) AS `status`
FROM
`f_fire_fighting_system` `fs`
GROUP BY
`fs`.`id`
ORDER BY
fs.biz_org_name
) sys
<where>
<if test="status != null and status != ''">
sys.status = #{status}
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
sys.bizOrgCode like concat('%',#{bizOrgCode},'%')
</if>
</where>
</select>
<select id="getSystemAlarmCount" resultType="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