Commit 6da481b5 authored by maoying's avatar maoying

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

parent ecfcf673
...@@ -2349,26 +2349,61 @@ ...@@ -2349,26 +2349,61 @@
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
`wl_equipment_specific` `wes`
WHERE
0 != find_in_set(
`fs`.`id`,
`wes`.`system_id`
)
) AS `totalEquipNum`,
(
SELECT
count(
DISTINCT `eqlog`.`equipment_specific_id`
)
FROM FROM
`wl_equipment_specific_alarm_log` `eqlog` `wl_equipment_specific_alarm_log` `eqlog`
WHERE WHERE
(( (
0 != find_in_set( `fs`.`id`, `eqlog`.`system_ids` )) (
0 != find_in_set(
`fs`.`id`,
`eqlog`.`system_ids`
)
)
AND ( AND (
`eqlog`.`create_date` LIKE concat( date_format( curdate(), '%Y-%m-%d' ), '%' )))) AS `todayAlarmNum`, `eqlog`.`create_date` LIKE concat(
IF date_format(curdate(), '%Y-%m-%d'),
((( '%'
)
)
)
) AS `todayAlarmNum`,
IF (
(
(
SELECT SELECT
count( `eqlog`.`equipment_specific_id` ) count(
`esa`.`equipment_specific_id`
)
FROM FROM
`wl_equipment_specific_alarm_log` `eqlog` `wl_equipment_specific_alarm` `esa`
WHERE WHERE
(( (
0 != find_in_set( `fs`.`id`, `eqlog`.`system_ids` )) (
AND ( `eqlog`.`status` = 1 ))) > 0 0 != find_in_set(
`fs`.`id`,
`esa`.`system_ids`
)
)
AND (`esa`.`status` = 1)
)
) > 0
), ),
'异常', '异常',
'正常' '正常'
...@@ -2376,17 +2411,13 @@ ...@@ -2376,17 +2411,13 @@
IFNULL(ec.image, "") AS image IFNULL(ec.image, "") AS image
FROM FROM
`f_fire_fighting_system` `fs` `f_fire_fighting_system` `fs`
LEFT JOIN `wl_equipment_specific` `wes` ON (
0 != find_in_set( `fs`.`id`, `wes`.`system_id` ))
LEFT JOIN wl_equipment_category ec ON ec.id = fs.system_type 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