| | |
| | | group by cityName,rule_name |
| | | </select> |
| | | |
| | | <!--查询告警统计数据-按三大类--> |
| | | <select id="statisticAlarmRecordByType" resultType="cn.gistack.alerts.alarmRule.vo.StatisticAlarmRecord"> |
| | | select |
| | | a.dict_value as ruleName, |
| | | case when ifnull(b.type,0)='0' then 0 else b.num end as num |
| | | from |
| | | ( |
| | | select dict_value from YWXT.blade_dict_biz where code = 'ALARM_TYPE' and dict_key!= '-1' and is_deleted = 0 |
| | | ) a left join |
| | | ( |
| | | select type,count(*) num |
| | | from YWXT.sm_alarm_record sar |
| | | left join YWXT.sm_alarm_rule e on e.id = sar.alarm_rule_id |
| | | where sar.is_deleted = 0 |
| | | <if test="alarmRecord.startTime!=null and alarmRecord.startTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') >= #{alarmRecord.startTime} |
| | | </if> |
| | | <if test="alarmRecord.endTime!=null and alarmRecord.endTime!=''"> |
| | | and date_format(sar.create_time,'%Y-%m-%d') <= #{alarmRecord.endTime} |
| | | </if> |
| | | group by type |
| | | ) b on a.dict_value = b.type |
| | | </select> |
| | | |
| | | <!--查询符合条件的告警类型--> |
| | | <select id="listAlarmRule" resultType="cn.gistack.alerts.alarmRule.entity.AlarmRule"> |
| | | select * from YWXT.sm_alarm_rule where is_deleted = 0 |