-- or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' 此处由于单位会出现多个,所以无法确定选择哪一个,所以此处默认用一个指标的单位进行单位换算
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0 limit 1) AS 'unit',
IFNULL( rp.volume, 0 ) AS volume,
...
...
@@ -5279,7 +5278,7 @@
c.`status` = #{status}
</if>
</where>
<iftest="sortFlag != null and sortFlag != '' and sortFlag = '1'">
<iftest="sortFlag != null and sortFlag == '1'">
<choose>
<whentest="sortOrder == 'ascend'">
ORDER BY CONVERT(c.bizOrgName USING gbk) ASC
...
...
@@ -5289,7 +5288,7 @@
</otherwise>
</choose>
</if>
<iftest="sortFlag != null and sortFlag != '' and sortFlag = '2'">
<iftest="sortFlag != null and sortFlag == '2'">
<choose>
<whentest="sortOrder == 'ascend'">
ORDER BY d.eligibility ASC
...
...
@@ -5394,7 +5393,6 @@
from
wl_equipment_specific_index ei
where
-- or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' 此处由于单位会出现多个,所以无法确定选择哪一个,所以此处默认用一个指标的单位进行单位换算
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key =
'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0 limit 1) AS 'unit',
...
...
@@ -7158,28 +7156,31 @@
*
FROM
(
(SELECT count( 1 ) AS indexNum FROM wl_equipment_specific_index a LEFT JOIN wl_equipment_index b ON a.equipment_index_id = b.id WHERE b.is_iot = 1
and equipment_specific_id IN
(SELECT
id
FROM
wl_equipment_specific
<where>
<iftest="bizOrgCode!=null and bizOrgCode!=''">
AND biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
</where>)
(SELECT
sum( n.num )
FROM
(
SELECT
a.id,
count( 1 ) AS num
FROM
wl_equipment_specific a
LEFT JOIN (select m.* from wl_equipment_specific_index m left join wl_equipment_index e on e.id = m.equipment_index_id where e.is_iot = 1) b ON a.id = b.equipment_specific_id
<where>
<iftest="bizOrgCode!=null and bizOrgCode!=''">
AND a.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
</where>
GROUP BY
a.id
) n
)
) AS indexNum,
(SELECT count( 1 ) AS equipNum FROM wl_equipment_specific es LEFT JOIN wl_equipment e ON e.`code` = es.equipment_code WHERE e.is_iot = 1
<iftest="bizOrgCode!=null and bizOrgCode!=''">
AND es.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
) AS equipNum,
(SELECT count(1) AS indexMonitorNum FROM wl_equipment_specific_index wesi LEFT JOIN wl_equipment_specific wes on wesi.equipment_specific_id = wes.id WHERE DATE_FORMAT(wesi.update_date, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
<iftest="bizOrgCode!=null and bizOrgCode!=''">
AND wes.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')