Commit 4e01f708 authored by maoying's avatar maoying

修改水系统4小查询脚本

parent 1b8d4c86
...@@ -1256,58 +1256,116 @@ ...@@ -1256,58 +1256,116 @@
xhsanhj, xhsanhj,
xhsangz, xhsangz,
xhsanpb, xhsanpb,
ABS(xhsan - xhsanhj- xhsangz-xhsanpb) as xhszc, xhszc,
xhsan xhsan
from FROM
(select (
(SELECT SELECT
(
SELECT
count(1) count(1)
FROM `wl_equipment_specific_index` s FROM
where s.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm' `wl_equipment_specific_index` s
and s.`value` = 'true') as xhsanhj, WHERE
(SELECT s.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm'
AND s.`value` = 'true'
) AS xhsanhj,
(
SELECT
count(1) count(1)
FROM `wl_equipment_specific_index` s FROM
where s.equipment_index_key = 'FAS_FireHydrantButton_Fault' `wl_equipment_specific_index` s
and s.`value` = 'true') as xhsangz, WHERE
(SELECT s.equipment_index_key = 'FAS_FireHydrantButton_Fault'
AND s.`value` = 'true'
) AS xhsangz,
(
SELECT
count(1) count(1)
FROM `wl_equipment_specific_index` s FROM
where s.equipment_index_key = 'FAS_FireHydrantButton_Shield' `wl_equipment_specific_index` s
and s.`value` = 'true') as xhsanpb, WHERE
(SELECT s.equipment_index_key = 'FAS_FireHydrantButton_Shield'
AND s.`value` = 'true'
) AS xhsanpb,
(
SELECT
count(1) count(1)
from FROM
`wl_equipment_specific_index` si `wl_equipment_specific_index` si
where WHERE
si.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm') as xhsan si.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm'
) as hydrant ) 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
(
SELECT
count(1) count(1)
FROM `wl_equipment_specific_index` s FROM
where s.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal' `wl_equipment_specific_index` s
and s.`value` = 'true') as sbfcjzzyc, WHERE
(SELECT s.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal'
AND s.`value` = 'true'
) AS sbfcjzzyc,
(
SELECT
count(1) count(1)
FROM `wl_equipment_specific_index` s FROM
where s.equipment_index_key = 'FHS_CollectingDevice_DeviceLock' `wl_equipment_specific_index` s
and s.`value` = 'true') as sbfcjzzbs, WHERE
(SELECT s.equipment_index_key = 'FHS_CollectingDevice_DeviceLock'
AND s.`value` = 'true'
) AS sbfcjzzbs,
(
SELECT
count(1) count(1)
from FROM
`wl_equipment_specific_index` si `wl_equipment_specific_index` si
where WHERE
si.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal') as sbfcjzz si.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal'
) as collectingDevice ) 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