| | |
| | | left join |
| | | ( |
| | | select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm |
| | | where alarmType = '一键求助' |
| | | group by DATE_FORMAT(alarmTime,'%Y-%m-%d') |
| | | ) b |
| | | on |
| | |
| | | </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>--> |
| | | |
| | | <!--查询本日,本周,本月 主动报警的数量--> |
| | | <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 |
| | | select '一键求助' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where alarmType = '一键求助' |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </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 |
| | | union all |
| | | select '电话报警' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where alarmType = '电话报警' |
| | | <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> |
| | | |
| | | </select> |
| | | |
| | | <select id="queryPolice" resultType="java.util.HashMap"> |