Commit 6da481b5 authored by maoying's avatar maoying

修改组态系统信息查询脚本

parent ecfcf673
...@@ -2347,46 +2347,77 @@ ...@@ -2347,46 +2347,77 @@
<select id="getSystemAlarmInfo" resultType="java.util.Map"> <select id="getSystemAlarmInfo" resultType="java.util.Map">
SELECT SELECT
`fs`.`id` AS `id`, `fs`.`id` AS `id`,
`fs`.`name` AS `name`, `fs`.`name` AS `name`,
count( `wes`.`id` ) AS `totalEquipNum`,( (
SELECT SELECT
count( DISTINCT `eqlog`.`equipment_specific_id` ) count(1)
FROM FROM
`wl_equipment_specific_alarm_log` `eqlog` `wl_equipment_specific` `wes`
WHERE WHERE
(( 0 != find_in_set(
0 != find_in_set( `fs`.`id`, `eqlog`.`system_ids` )) `fs`.`id`,
AND ( `wes`.`system_id`
`eqlog`.`create_date` LIKE concat( date_format( curdate(), '%Y-%m-%d' ), '%' )))) AS `todayAlarmNum`, )
IF ) AS `totalEquipNum`,
((( (
SELECT SELECT
count( `eqlog`.`equipment_specific_id` ) count(
FROM DISTINCT `eqlog`.`equipment_specific_id`
`wl_equipment_specific_alarm_log` `eqlog` )
WHERE FROM
(( `wl_equipment_specific_alarm_log` `eqlog`
0 != find_in_set( `fs`.`id`, `eqlog`.`system_ids` )) WHERE
AND ( `eqlog`.`status` = 1 ))) > 0 (
), (
'异常', 0 != find_in_set(
'正常' `fs`.`id`,
) AS `stateDesc`, `eqlog`.`system_ids`
IFNULL(ec.image, "") AS image )
FROM )
`f_fire_fighting_system` `fs` AND (
LEFT JOIN `wl_equipment_specific` `wes` ON ( `eqlog`.`create_date` LIKE concat(
0 != find_in_set( `fs`.`id`, `wes`.`system_id` )) date_format(curdate(), '%Y-%m-%d'),
LEFT JOIN wl_equipment_category ec ON ec.id = fs.system_type '%'
)
)
)
) AS `todayAlarmNum`,
IF (
(
(
SELECT
count(
`esa`.`equipment_specific_id`
)
FROM
`wl_equipment_specific_alarm` `esa`
WHERE
(
(
0 != find_in_set(
`fs`.`id`,
`esa`.`system_ids`
)
)
AND (`esa`.`status` = 1)
)
) > 0
),
'异常',
'正常'
) AS `stateDesc`,
IFNULL(ec.image, "") AS image
FROM
`f_fire_fighting_system` `fs`
LEFT JOIN wl_equipment_category ec ON ec.id = fs.system_type
<where> <where>
1=1
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
and fs.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR} and fs.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if> </if>
</where> </where>
GROUP BY ORDER BY fs.sort
`fs`.`id`
</select> </select>
<select id="getEquipAlarmInfoNum" resultType="java.util.Map"> <select id="getEquipAlarmInfoNum" 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