|
|
|
@ -157,4 +157,18 @@
|
|
|
|
|
order by t1.Order_Flag
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectAlarmCategoryAmountList" parameterType="BaseAlarmModule" resultMap="BaseAlarmModuleDtoResult">
|
|
|
|
|
select a.AlarmModule_Text,sum(a.alarmModuleAmount) as alarmModuleAmount
|
|
|
|
|
from (select t5.AlarmCategory_Name as AlarmModule_Text,count(t4.Alarm_Value) as alarmModuleAmount
|
|
|
|
|
from base_alarm_module t1
|
|
|
|
|
left join base_monitorunit_info t2 on t2.MonitorUnit_Type = t1.MonitorUnit_Id
|
|
|
|
|
left join base_sensor_info t3 on t2.MonitorUnit_Id = t3.MonitorUnit_Id
|
|
|
|
|
left join record_alarm t4 on t3.Sensor_Id = t4.Sensor_Id and t1.AlarmType_Id = t4.AlarmType_Id
|
|
|
|
|
left join base_alarm_category t5 on t1.AlarmCategory_Id = t5.AlarmCategory_Id
|
|
|
|
|
where t5.AlarmCategory_Id is not null
|
|
|
|
|
group by t1.AlarmModule_Text,t1.Order_Flag,t5.AlarmCategory_Name
|
|
|
|
|
order by t1.Order_Flag) a
|
|
|
|
|
group by a.AlarmModule_Text
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|