Commit b48930f0 authored by xixinzhao's avatar xixinzhao

换流变事故排油卡片查询重复

parent 9d275146
......@@ -481,54 +481,6 @@
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
<if test="code != null and code!='' ">
UNION ALL
(
SELECT
wes.id,
'3' AS type,
(
SELECT
IF
(
wesi.`value` = 'true'
AND wesi.equipment_index_key = 'ONL_DrainOilValve_Open',
( SELECT emergency_level FROM wl_equipment_index WHERE name_key = 'ONL_DrainOilValve_Open' ),
( SELECT emergency_level FROM wl_equipment_index WHERE name_key = 'ONL_DrainOilValve_Close' ))
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.equipment_index_key IN ( 'ONL_DrainOilValve_Open', 'ONL_DrainOilValve_Close' )
AND wesi.`value` = 'true'
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS level,
wes.CODE AS code,
wes.name,
(
SELECT
IF
( wesi.`value` = 'true' AND wesi.equipment_index_key = 'ONL_DrainOilValve_Open', '全开', '全关' )
FROM
wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id
AND wesi.equipment_index_key IN ( 'ONL_DrainOilValve_Open', 'ONL_DrainOilValve_Close' )
AND wesi.`value` = 'true'
ORDER BY
wesi.update_date DESC
LIMIT 1
) AS status
FROM
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921004', '%' )
AND fire.equipment_id != (SELECT id FROM f_equipment WHERE `code` = #{code})
)
</if>
</select>
<select id="selectGasExtinguishing" 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