| | |
| | | on |
| | | a.click_date = b.datetime |
| | | </select> |
| | | |
| | | |
| | | <!--查询本日,本周,本月 主动报警的数量--> |
| | | <select id="selectAlarmSum" resultType="java.util.HashMap"> |
| | | select sa.alarmType name,IFNULL(sb.count, 0) value from (select alarmType from sys_alarm GROUP BY alarmType) sa |
| | | left join |
| | | ( select alarmType,count(*) count from sys_alarm |
| | | where 1=1 |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </if> |
| | | <if test="conditionVo.status==1"> |
| | | and YEARWEEK(date_format(alarmTime,'%Y-%m-%d'),1) = YEARWEEK(now(),1) |
| | | </if> |
| | | <if test="conditionVo.status==2"> |
| | | and date_format(alarmTime,'%Y%m') = date_format(now(),'%Y%m') |
| | | </if> |
| | | group by alarmType |
| | | ) sb |
| | | on |
| | | sa.alarmType = sb.alarmType |
| | | </select> |
| | | </mapper> |