Commit 4e01f708 authored by maoying's avatar maoying

修改水系统4小查询脚本

parent 1b8d4c86
...@@ -1253,61 +1253,119 @@ ...@@ -1253,61 +1253,119 @@
</select> </select>
<select id="fireWaterSysHydrant" resultType="java.util.Map"> <select id="fireWaterSysHydrant" resultType="java.util.Map">
SELECT SELECT
xhsanhj, xhsanhj,
xhsangz, xhsangz,
xhsanpb, xhsanpb,
ABS(xhsan - xhsanhj- xhsangz-xhsanpb) as xhszc, xhszc,
xhsan xhsan
from FROM
(select (
(SELECT SELECT
count(1) (
FROM `wl_equipment_specific_index` s SELECT
where s.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm' count(1)
and s.`value` = 'true') as xhsanhj, FROM
(SELECT `wl_equipment_specific_index` s
count(1) WHERE
FROM `wl_equipment_specific_index` s s.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm'
where s.equipment_index_key = 'FAS_FireHydrantButton_Fault' AND s.`value` = 'true'
and s.`value` = 'true') as xhsangz, ) AS xhsanhj,
(SELECT (
count(1) SELECT
FROM `wl_equipment_specific_index` s count(1)
where s.equipment_index_key = 'FAS_FireHydrantButton_Shield' FROM
and s.`value` = 'true') as xhsanpb, `wl_equipment_specific_index` s
(SELECT WHERE
count(1) s.equipment_index_key = 'FAS_FireHydrantButton_Fault'
from AND s.`value` = 'true'
`wl_equipment_specific_index` si ) AS xhsangz,
where (
si.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm') as xhsan SELECT
) as hydrant count(1)
FROM
`wl_equipment_specific_index` s
WHERE
s.equipment_index_key = 'FAS_FireHydrantButton_Shield'
AND s.`value` = 'true'
) AS xhsanpb,
(
SELECT
count(1)
FROM
`wl_equipment_specific_index` si
WHERE
si.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm'
) AS xhsan,
(
SELECT
count(
DISTINCT equipment_specific_id
)
FROM
`wl_equipment_specific_index` s
WHERE
(
s.`value` = 'false'
OR s.`value` IS NULL
)
AND (
s.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm'
OR s.equipment_index_key = 'FAS_FireHydrantButton_Fault'
OR s.equipment_index_key = 'FAS_FireHydrantButton_Shield'
)
) AS xhszc
) AS hydrant
</select> </select>
<select id="fireWaterSysCollectingDevice" resultType="java.util.Map"> <select id="fireWaterSysCollectingDevice" resultType="java.util.Map">
SELECT SELECT
sbfcjzzyc, sbfcjzzyc,
sbfcjzzbs, sbfcjzzbs,
(sbfcjzz-sbfcjzzyc-sbfcjzzbs) as sbfcjzzzc, sbfcjzzzc,
sbfcjzz sbfcjzz
from FROM
(select (
(SELECT SELECT
count(1) (
FROM `wl_equipment_specific_index` s SELECT
where s.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal' count(1)
and s.`value` = 'true') as sbfcjzzyc, FROM
(SELECT `wl_equipment_specific_index` s
count(1) WHERE
FROM `wl_equipment_specific_index` s s.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal'
where s.equipment_index_key = 'FHS_CollectingDevice_DeviceLock' AND s.`value` = 'true'
and s.`value` = 'true') as sbfcjzzbs, ) AS sbfcjzzyc,
(SELECT (
count(1) SELECT
from count(1)
`wl_equipment_specific_index` si FROM
where `wl_equipment_specific_index` s
si.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal') as sbfcjzz WHERE
) as collectingDevice s.equipment_index_key = 'FHS_CollectingDevice_DeviceLock'
AND s.`value` = 'true'
) AS sbfcjzzbs,
(
SELECT
count(1)
FROM
`wl_equipment_specific_index` si
WHERE
si.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal'
) AS sbfcjzz,
(
SELECT
count(
DISTINCT equipment_specific_id
)
FROM
`wl_equipment_specific_index` s
WHERE
(
s.`value` = 'false'
OR s.`value` IS NULL
)
AND s.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal'
) AS sbfcjzzzc
) AS collectingDevice
</select> </select>
<select id="fireWaterSysWaterPump" resultType="java.util.Map"> <select id="fireWaterSysWaterPump" resultType="java.util.Map">
select select
......
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