Commit 8fb1a3fa authored by KeYong's avatar KeYong

修改物联报表bug

parent b738135a
......@@ -1316,7 +1316,7 @@
</select>
<select id="dailyMaintenance" resultType="java.util.Map">
SELECT temp.total,temp.notReturned, temp.alarmEquipNum,(temp.alarmEquipNum - temp.notReturned) AS returned
SELECT temp.total,temp.notReturned, temp.alarmEquipNum,(temp.alarmEquipNum - temp.notReturned) AS returned, temp.faultEquipNum
FROM(
select
(SELECT
......@@ -1334,6 +1334,11 @@
WHERE esa.org_code = #{orgCode}
and update_date between #{startTime} and #{endTime}
)AS alarmEquipNum,
(
SELECT COUNT(DISTINCT(esa.iot_code)) FROM wl_equipment_specific_alarm esa
WHERE esa.type = "BREAKDOWN"
and esa.equipment_specific_index_value = "true" and esa.`status`=true and esa.org_code = #{orgCode} and update_date between #{startTime} and #{endTime}
)AS faultEquipNum,
(
SELECT COUNT(DISTINCT(esa.iot_code)) FROM wl_equipment_specific_alarm esa
WHERE esa.org_code = #{orgCode} AND esa.equipment_specific_index_value = "true"
......
......@@ -4184,18 +4184,9 @@
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where FIND_IN_SET( #{systemId},spec.system_id) AND equipment.is_iot = 1
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
) temp
LEFT JOIN
(
SELECT temp.*,
CASE
WHEN wei.is_trend = 0 then "遥信"
......@@ -4244,7 +4235,7 @@
WHERE FIND_IN_SET( #{systemId},spec.system_id)
GROUP BY systemId,code,type_code
GROUP BY systemId,code,type_code,spec_index.id
)temp LEFT JOIN wl_equipment_index wei on temp.equipment_index_id = wei.id
)temp1 on temp.system_id = temp1.systemId and temp.code = temp1.code
......
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