Commit cefc24a2 authored by KeYong's avatar KeYong

更新

parent 75f18c5e
......@@ -7,9 +7,7 @@ import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
/**
*
......@@ -25,12 +23,38 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override
public List<Map<String, Object>> getSystemState(String bizOrgCode) {
return emergencyMapper.getSystemState(bizOrgCode);
List<Map<String, Object>> list = emergencyMapper.getSystemState(bizOrgCode);
if (0 < list.size()) {
list.forEach(x -> {
List<Map<String, Object>> list1 = new ArrayList();
Map<String, Object> map = new HashMap<>();
map.put("name", x.get("status"));
if ("正常".equals(String.valueOf(x.get("status")))) {
map.put("level", "success");
} else {
map.put("level", "failure");
}
list1.add(map);
x.put("status", list1);
});
}
return list;
}
@Override
public List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode) {
List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo(bizOrgCode);
// List<Map<String, Object>> res = new ArrayList();
// if (0 < list.size()) {
// list.forEach(x -> {
// Map<String, Object> map = new HashMap<>();
// map.put("key", x.get("specificId"));
// map.put("code", x.get("code"));
// map.put("name", x.get("name"));
// map.put("value", x.get("specificId"));
// map.put("key", x.get("specificId"));
// });
// }
return Optional.ofNullable(list).orElse(Lists.newArrayList());
}
......
......@@ -4,8 +4,10 @@
<select id="getSystemState" resultType="Map">
SELECT
`fs`.`id` AS `id`,
`fs`.`id` AS `key`,
`fs`.`name` AS `name`,
`fs`.system_type_code AS systemTypeCode,
`fs`.`code` AS code,
IF
(((
SELECT
......@@ -18,10 +20,12 @@
),
'异常',
'正常'
) AS `stateDesc`
) AS `status`
FROM
`f_fire_fighting_system` `fs`
<where>
-- 此接口要求过滤掉其他系统
fs.system_type_code IS NOT NULL AND fs.system_type_code != 'otherSys'
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND fs.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
......@@ -36,7 +40,9 @@
wes.`name`,
a.statusDesc,
a.sxyl,
a.`value`
a.`value`,
wes.`code`,
a.sxrj
FROM
wl_equipment_specific wes
LEFT JOIN (
......@@ -52,7 +58,10 @@
'液位低' ELSE '正常'
END AS statusDesc,
CASE
WHEN ( SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ) <![CDATA[<>]]> 0 THEN
CONCAT(( SELECT field_value FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ),'m³') ELSE '--m³'
END AS sxrj,
CASE
WHEN wlesi.`value` IS NULL THEN
'--' ELSE
IF
......
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