Commit 2ee8fac5 authored by 李秀明's avatar 李秀明

查询管网压力最高最低阈值

parent b336bb18
......@@ -54,6 +54,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Autowired
private IEquipmentSpecificIndexSerivce equipmentSpecificIndexService;
@Autowired
private IEquipmentSpecificSerivce equipmentSpecificService;
@Autowired
private IEquipmentSpecificAlarmService equipmentSpecificAlarmService;
......@@ -628,12 +631,15 @@ public class SupervisionConfigureController extends AbstractBaseController {
Map<String, Object> map = fireFightingSystemMapper.selectEquipmentSpecificById(equipmentSpecificId);
String name = "";
String code = "";
String type = "";
if (String.valueOf(map.get("equipment_code")).indexOf("92011000") != -1) {
name = "管网压力";
code = "gwyl";
type = "PipePressure";
} else if (String.valueOf(map.get("equipment_code")).indexOf("92011100") != -1) {
name = "水池液位";
code = "scyw";
type = "PoolLevel";
}
if (ObjectUtils.isEmpty(map) || ObjectUtils.isEmpty(map.get("iot_code"))) {
return CommonResponseUtil.success(null);
......@@ -688,11 +694,13 @@ public class SupervisionConfigureController extends AbstractBaseController {
// }
// return item;
// }).collect(Collectors.toList());
List<Map<String, Object>> resList = new ArrayList<>();
Map<String, Object> threshold = equipmentSpecificService.getThreshold(type, equipmentSpecificId);
Map<String, Object> map1 = new HashMap<>();
map1.put("name", name);
map1.put("xData", res.stream().map(x -> x.get("time")).collect(Collectors.toList()));
map1.put("yData", res.stream().map(x -> x.get("value")).collect(Collectors.toList()));
map1.put("threshold", threshold);
Map<String, Object> resMap = new HashMap<>();
resMap.put(code, map1);
return CommonResponseUtil.success(resMap);
......
......@@ -346,4 +346,6 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
Integer selectEquipmentCountBySystemId(@Param("systemId") Long systemId);
Map<String, Object> getThreshold(@Param("type") String type, @Param("equipmentSpecificId") String equipmentSpecificId);
}
......@@ -329,4 +329,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
Page<Map<String, Object>> getFireEquipListByDefineCode(String code, String equipStatus, String bizOrgCode, Page<Map<String, Object>> pageBean);
void updateCarStatus(String status, String carId);
Map<String, Object> getThreshold(String type, String equipmentSpecificId);
}
......@@ -2306,4 +2306,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return pageBean;
}
@Override
public Map<String, Object> getThreshold(String type, String equipmentSpecificId) {
return equipmentSpecificMapper.getThreshold(type, equipmentSpecificId);
}
}
......@@ -2999,4 +2999,21 @@
</if>
</select>
<select id="getThreshold" resultType="java.util.Map">
SELECT
<if test="type == 'PipePressure'">
MAX( CASE WHEN b.field_name = 'maxPressure' THEN b.field_value END ) AS maxThreshold,
MAX( CASE WHEN b.field_name = 'minPressure' THEN b.field_value END ) AS minThreshold
</if>
<if test="type == 'PoolLevel'">
MAX( CASE WHEN b.field_name = 'maxLevel' THEN b.field_value END ) AS maxThreshold,
MAX( CASE WHEN b.field_name = 'minLevel' THEN b.field_value END ) AS minThreshold
</if>
FROM
wl_equipment_specific AS a
LEFT JOIN wl_form_instance_equip b ON a.id = b.instance_id
WHERE
a.id = #{equipmentSpecificId}
</select>
</mapper>
\ No newline at end of file
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