Commit 8cc0af05 authored by KeYong's avatar KeYong

修改站水池液位查询逻辑bug

parent c3db7961
......@@ -245,13 +245,8 @@ public class PoolStatisticController {
sortField = sorter.split("@")[0];
sortOrder = sorter.split("@")[1];
}
String sortFlag = null;
if (sortField.equalsIgnoreCase("bizOrgName")) {
sortFlag = "1";
} else if (sortField.equalsIgnoreCase("eligibility")) {
sortFlag = "2";
}
Page<Map<String, Object>> page1 = fireFightingSystemMapper.getWaterInfoList(page, bizOrgCode, sortFlag, sortOrder, status);
Page<Map<String, Object>> page1 = fireFightingSystemMapper.getWaterInfoList(page, bizOrgCode, sortField, sortOrder, status);
List<Map<String, Object>> res = page1.getRecords();
if (!res.isEmpty()) {
for (Map<String, Object> m : res) {
......
......@@ -356,7 +356,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> getWaterInfoList(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("sortFlag") String sortFlag, @Param("sortOrder") String sortOrder, @Param("status") String status);
Page<Map<String, Object>> getWaterInfoList(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder, @Param("status") String status);
/**
* 水源信息统计
......
......@@ -2937,7 +2937,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
strings.addAll(Arrays.asList(equipIds.split(",")));
});
List<String> collect = strings.stream().distinct().collect(Collectors.toList());
List<Map<String, Object>> equipIndexList = this.baseMapper.getEquipIndexList(collect);
List<Map<String, Object>> equipIndexList = new ArrayList<>();
if (!CollectionUtils.isEmpty(collect)) {
equipIndexList = this.baseMapper.getEquipIndexList(collect);
}
Map<String, Map<String, Object>> equipmentSpecificId = equipIndexList.stream().collect(Collectors.toMap(item -> item.get("equipmentSpecificId").toString(), item -> item));
List<Map<String, Object>> resultList = new ArrayList<>();
list.forEach(item -> {
......
......@@ -5147,7 +5147,7 @@
) a
)) b
) c
LEFT JOIN (SELECT SUM(c1.csl) AS totalCsl, (CASE WHEN SUM(c1.csl) <![CDATA[<]]> 4000 THEN '0' ELSE '1' END) AS eligibility, c1.bizOrgName FROM (
LEFT JOIN (SELECT SUM(c1.csl) AS totalCsl, (CASE WHEN SUM(c1.csl) <![CDATA[<]]> 4000 THEN '1' ELSE '0' END) AS eligibility, c1.bizOrgName AS bizOrgName1 FROM (
select
*,
(
......@@ -5272,13 +5272,13 @@
r.sequence_nbr
) a1
)) b1
) c1 GROUP BY bizOrgName) d ON d.bizOrgName = c.bizOrgName
) c1 GROUP BY bizOrgName1) d ON d.bizOrgName1 = c.bizOrgName
<where>
<if test="status != null and status != ''">
c.`status` = #{status}
</if>
</where>
<if test="sortFlag != null and sortFlag == '1'">
<if test="sortField == 'bizOrgName'">
<choose>
<when test="sortOrder == 'ascend'">
ORDER BY CONVERT(c.bizOrgName USING gbk) ASC
......@@ -5288,7 +5288,7 @@
</otherwise>
</choose>
</if>
<if test="sortFlag != null and sortFlag == '2'">
<if test="sortField == 'eligibility'">
<choose>
<when test="sortOrder == 'ascend'">
ORDER BY d.eligibility ASC
......@@ -7186,25 +7186,36 @@
<select id="getFireCannonInfo" resultType="Map">
SELECT
DISTINCT wes.id,
wes.name,
CASE WHEN wesi.equipment_index_key = 'CAFS_GunValve_Open' AND wesi.`value` = 'true' THEN '开启'
WHEN wesi.equipment_index_key = 'CAFS_GunValve_Close' AND wesi.`value` = 'true' THEN '关闭' ELSE '关闭' END AS stateValue,
IFNULL(CASE WHEN wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure' THEN IFNULL(wesi.`value`, 0) END, 0) AS `pressureValue`
*
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_specific_index wesi ON wesi.equipment_specific_id = wes.id
<where>
<if test="list != null and list.length > 0">
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]>
</foreach>
</if>
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND wes.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
</where>
GROUP BY wes.id
(
SELECT
wes.id,
wes.`name`,
IF
( wesi.`value` = 'true', '开启', '关闭' ) AS stateValue
FROM
wl_equipment_specific_index wesi
JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
WHERE
wesi.equipment_index_key = 'CAFS_GunValve_Open' AND wes.equipment_code LIKE CONCAT( '92032200', '%' )
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND wes.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
) a
LEFT JOIN (
SELECT
wes.id AS wesId,
IFNULL( wesi.`value`, 0 ) AS pressureValue
FROM
wl_equipment_specific_index wesi
JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
WHERE
wesi.equipment_index_key = 'CAFS_CAFSFireGun_FireGunPressure' AND wes.equipment_code LIKE CONCAT( '92032200', '%' )
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND wes.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
) b ON b.wesId = a.id
</select>
<select id="getSystemAlarmNum" resultType="Map">
......
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