| | |
| | | <select id="selectAlarmPage" resultMap="alarmResultMap"> |
| | | select |
| | | a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.content,a.waringType,a.bz, |
| | | a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress, |
| | | a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid, |
| | | a.deviceNumber,a.region,a.district,a.vaddress,a.aaddress, |
| | | a.alarmId,a.LEVEL,a.jd,a.wd,a.jtype,a.rname,a.jjTime,a.province,a.city,a.cid, |
| | | a.securityArr,a.securityId, |
| | | e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone, |
| | | e.stype, |
| | |
| | | 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> |
| | |
| | | e.threeId, |
| | | e.deptId, |
| | | e.deviceName, |
| | | e.street as place, |
| | | a.place as place, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | WHERE |
| | | |
| | | <if test="alarm.securityArr!=null and alarm.securityArr!=''"> |
| | | securityId = "" or securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityArr},'%') |
| | |
| | | <if test="alarm.id!=null and alarm.id!=''"> |
| | | a.id = #{alarm.id} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getAlarming" resultMap="alarmResultMap"> |
| | |
| | | e.threeId, |
| | | e.deptId, |
| | | e.deviceName, |
| | | e.street as place, |
| | | a.place as place, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm a |
| | |
| | | WHERE |
| | | securityId =#{alarm.securityId} and jtype != 2 |
| | | |
| | | </select> |
| | | |
| | | |
| | | <sql id="getAlarmListSqlParam"> |
| | | select a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.content,a.waringType,a.bz, |
| | | a.deviceNumber,a.region,e.district,a.vaddress,a.aaddress, |
| | | a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid, |
| | | a.securityArr,a.securityId, |
| | | e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone, |
| | | e.stype, |
| | | e.oneId, |
| | | e.twoId, |
| | | e.threeId, |
| | | e.deptId, |
| | | e.deviceName, |
| | | a.place as place, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | WHERE |
| | | 1=1 |
| | | </sql> |
| | | |
| | | <!--查询当前保安所有警情信息--> |
| | | <select id="getAllAlarmList" resultMap="alarmResultMap"> |
| | | (select * from ( |
| | | <include refid="getAlarmListSqlParam"/> |
| | | and securityId =#{alarm.securityId} and jtype = 1 order by alarmTime limit 9999 |
| | | )a) |
| | | union |
| | | (select * from ( |
| | | <include refid="getAlarmListSqlParam"/> |
| | | and securityId = "" or securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityId},'%') |
| | | order by alarmTime desc limit 9999 |
| | | )a) |
| | | union |
| | | (select * from ( |
| | | <include refid="getAlarmListSqlParam"/> |
| | | and securityId =#{alarm.securityId} and jtype = 2 order by alarmTime desc limit 9999 |
| | | )a) |
| | | </select> |
| | | |
| | | <!--查询当前保安需要处理和未处理的警情信息--> |
| | | <select id="getAlarmList" resultMap="alarmResultMap"> |
| | | <include refid="getAlarmListSqlParam"/> |
| | | <if test="alarm.status==2"> |
| | | and securityId = "" or securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityId},'%') |
| | | order by alarmTime desc |
| | | </if> |
| | | <if test="alarm.status==3"> |
| | | and securityId =#{alarm.securityId} and jtype = 2 |
| | | order by alarmTime desc |
| | | </if> |
| | | </select> |
| | | |
| | | <!--获取警情数量的集合,全部,未处理,已处理的数量--> |
| | | <select id="getAlarmNumber" resultType="java.lang.Integer"> |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId =#{alarm.securityId} |
| | | or securityId = "" or securityId IS NULL |
| | | and securityArr LIKE concat('%',#{alarm.securityId},'%')) |
| | | |
| | | union |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId = "" or securityId IS NULL |
| | | and securityArr LIKE concat('%',#{alarm.securityId},'%')) |
| | | |
| | | union |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId =#{alarm.securityId} and jtype = 2) |
| | | </select> |
| | | |
| | | <update id="setAlarm"> |
| | |
| | | |
| | | <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> |
| | | |