Commit ee155f3b authored by 张森's avatar 张森

中心大屏水池相关信息一一对应

parent b5db64eb
......@@ -161,31 +161,17 @@ public class PoolStatisticController {
@ApiOperation(httpMethod = "GET", value = "获取水池统计信息", notes = "获取水池统计信息")
public ResponseModel getWaterInfo( @RequestParam(required = false) String bizOrgCode) {
List<Map<String, Object>> infoList = fireFightingSystemMapper.getWaterInfoBySuper(bizOrgCode);
List<Map<String, Object>> normalList = new ArrayList<>();
List<Map<String, Object>> abNormalList = new ArrayList<>();
if (!infoList.isEmpty()) {
for (Map<String, Object> m : infoList) {
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(m.get("status"))))) {
if (IndexStatusEnum.LOW.getKey().equals(String.valueOf(m.get("status")))) {
abNormalList.add(m);
} else if (IndexStatusEnum.HIGH.getKey().equals(String.valueOf(m.get("status")))) {
abNormalList.add(m);
} else if (IndexStatusEnum.NORMAL.getKey().equals(String.valueOf(m.get("status")))) {
normalList.add(m);
}
} else {
normalList.add(m);
}
}
}
// List<Map<String, Object>> normalList = new ArrayList<>();
// List<Map<String, Object>> abNormalList = new ArrayList<>();
Map<String, List<Map<String, Object>>> pool = getPoolInfo(infoList);
Map<String, Object> normalMap = new HashMap<>();
normalMap.put("key", "normal");
normalMap.put("name", "液位正常");
normalMap.put("value", normalList.size());
normalMap.put("value", pool.get("normal").size());
Map<String, Object> abNormalMap = new HashMap<>();
abNormalMap.put("key", "abnormal");
abNormalMap.put("name", "液位异常");
abNormalMap.put("value", abNormalList.size());
abNormalMap.put("value", infoList.size() - pool.get("normal").size());
List<Map<String, Object>> res = new ArrayList<>();
res.add(normalMap);
res.add(abNormalMap);
......@@ -265,6 +251,17 @@ public class PoolStatisticController {
} else {
m.put("levelAbs", transResult.get("abs"));
}
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
if (IndexStatusEnum.LOW.getKey().equals(String.valueOf(transResult.get("status")))) {
m.put("status", "1");
} else if (IndexStatusEnum.HIGH.getKey().equals(String.valueOf(transResult.get("status")))) {
m.put("status", "1");
} else {
m.put("status", "0");
}
} else {
m.put("status", "0");
}
}
page1.setRecords(res);
}
......
......@@ -4923,7 +4923,7 @@
IFNULL( rp.output_flow_rate, 0 ) AS outputFlowRate,
-- IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
IFNULL((select
avg(ei.`value`)
avg(IFNULL(ei.`value`, 0))
from
wl_equipment_specific_index ei
where
......
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