| | |
| | | where |
| | | DATE_FORMAT(alarmTime,'%Y-%m-%d') >=#{beginTime} |
| | | and DATE_FORMAT(alarmTime,'%Y-%m-%d') <=#{endTime} |
| | | and a.waringType IN("紧急求救") |
| | | ORDER BY |
| | | a.jtype ASC, |
| | | a.alarmTime DESC |
| | |
| | | <select id="selectAlarmCount" resultType="java.lang.Integer"> |
| | | SELECT count(*) FROM `sys_alarm` |
| | | where |
| | | waringType = '紧急求救' |
| | | 1=1 |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(curdate()) |
| | | </if> |
| | |
| | | left join |
| | | ( |
| | | select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm |
| | | where waringType = '紧急求救' |
| | | where 1=1 |
| | | 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 waringType = '紧急求救' |
| | | where 1=1 |
| | | <if test="conditionVo.status==0"> |
| | | and to_days(alarmTime) = to_days(now()) |
| | | </if> |
| | |
| | | |
| | | <select id="selAlarmTimeCount" resultType="java.lang.Integer"> |
| | | select count(*) from sys_alarm |
| | | where waringType = '紧急求救' |
| | | where 1=1 |
| | | <if test="conditionVo.startTime!=null and conditionVo.startTime!='' and conditionVo.endTime!=null and conditionVo.endTime!=''"> |
| | | and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime} |
| | | </if> |
| | |
| | | <!--查询当前时间段内一键求助报警的数据集合--> |
| | | <select id="selectAlarmList" resultType="org.springblade.jfpt.alarm.entity.Alarm"> |
| | | SELECT waringType,alarmTime,alarmId,alarmPeople,jtype,czTime FROM `sys_alarm` |
| | | where waringType='紧急求救' |
| | | where 1=1 |
| | | and alarmTime between #{conditionVo.startTime} and #{conditionVo.endTime} |
| | | </select> |
| | | |
| | |
| | | left join |
| | | ( |
| | | select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm |
| | | where waringType = '紧急求救' |
| | | where 1=1 |
| | | group by DATE_FORMAT(alarmTime,'%Y-%m-%d') |
| | | ) b |
| | | on |
| | |
| | | YEAR ( alarmTime ) = date_format(now(),'%Y%') |
| | | AND MONTH ( alarmTime ) = #{item} |
| | | |
| | | AND waringType = "紧急求救" |
| | | AND 1=1 |
| | | AND deviceNumber = #{deviceNumber} |
| | | |
| | | </foreach> |
| | |
| | | LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber |
| | | where 1=1 |
| | | <include refid="alarmCondition"></include> |
| | | and a.waringType IN("紧急求救") |
| | | ORDER BY |
| | | a.jtype ASC, |
| | | a.alarmTime DESC |
| | |
| | | <!--获取实时警情图表统计数据--> |
| | | <select id="getAlarmPie" resultType="org.springblade.common.entity.ReportReturnData"> |
| | | select if(1=1,"一键求助",0) type,ifnull(count(*),0) count from sys_alarm |
| | | where waringType="紧急求救" |
| | | where 1=1 |
| | | <include refid="alarmConditionPie"></include> |
| | | </select> |
| | | |