Commit f7efafb4 authored by KeYong's avatar KeYong

修改bug

parent 4bb6e495
...@@ -2521,29 +2521,35 @@ ...@@ -2521,29 +2521,35 @@
<!-- LIMIT 5--> <!-- LIMIT 5-->
SELECT SELECT
a.equipName, d.*
count( DISTINCT wesa.equipment_specific_id ) AS total
FROM FROM
( (
SELECT SELECT
eq.`name` AS equipName, a.equipName,
eq.id AS equipmentId, count( DISTINCT wesa.equipment_specific_id ) AS total
eq.`code` AS `code` FROM
FROM (
wl_equipment eq SELECT
LEFT JOIN wl_equipment_detail wed ON eq.id = wed.equipment_id eq.`name` AS equipName,
LEFT JOIN wl_equipment_specific wes ON wed.id = wes.equipment_detail_id eq.id AS equipmentId,
WHERE eq.`code` AS `code`
FIND_IN_SET( #{systemId}, wes.system_id ) > 0 FROM
) a wl_equipment eq
LEFT JOIN wl_equipment_specific_alarm wesa ON wesa.equipment_id = a.equipmentId LEFT JOIN wl_equipment_detail wed ON eq.id = wed.equipment_id
AND FIND_IN_SET( #{systemId}, wesa.system_ids ) > 0 LEFT JOIN wl_equipment_specific wes ON wed.id = wes.equipment_detail_id
AND `wesa`.`create_date` >= ( curdate() - INTERVAL 30 DAY ) WHERE
GROUP BY FIND_IN_SET( #{systemId}, wes.system_id ) > 0
a.equipmentId ) a
ORDER BY LEFT JOIN wl_equipment_specific_alarm wesa ON wesa.equipment_id = a.equipmentId
total DESC AND FIND_IN_SET( #{systemId}, wesa.system_ids ) > 0
LIMIT 5 AND `wesa`.`create_date` >= ( curdate() - INTERVAL 30 DAY )
GROUP BY
a.equipmentId
ORDER BY
total DESC
LIMIT 5
) d
ORDER BY d.total ASC
</select> </select>
<select id="equipmentId" resultType="String"> <select id="equipmentId" resultType="String">
...@@ -2552,8 +2558,7 @@ ...@@ -2552,8 +2558,7 @@
from from
f_fire_fighting_system f_fire_fighting_system
where where
code = #{systemCode} and code = #{systemCode}
biz_org_code like concat(#{bizOrgCode}, '%')
</select> </select>
<select id="equipmentState" resultType="java.util.Map"> <select id="equipmentState" resultType="java.util.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