| | |
| | | <select id="selectAlarmCount" resultType="java.lang.Integer"> |
| | | SELECT count(*) FROM `sys_alarm` |
| | | where |
| | | waringType != '系统测试' |
| | | and |
| | | waringType!='主机重新上电' |
| | | waringType = '紧急求救' |
| | | and |
| | | to_days(alarmTime) = to_days(curdate()) |
| | | </select> |
| | |
| | | left join |
| | | ( |
| | | select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm |
| | | where alarmType = '一键求助' |
| | | where waringType = '紧急求救' |
| | | group by DATE_FORMAT(alarmTime,'%Y-%m-%d') |
| | | ) b |
| | | on |
| | |
| | | <!--查询本日,本周,本月 主动报警的数量--> |
| | | <select id="selectAlarmSum" resultType="java.util.HashMap"> |
| | | select '一键求助' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where alarmType = '一键求助' |
| | | where waringType = '紧急求救' |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </if> |
| | |
| | | </if> |
| | | union all |
| | | select '电话报警' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where alarmType = '电话报警' |
| | | where waringType = '电话报警' |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </if> |