| | |
| | | <result column="district" property="district"/> |
| | | <result column="alarmId" property="alarmId"/> |
| | | <result column="level" property="level"/> |
| | | <result column="coordinate" property="coordinate"/> |
| | | <!--<result column="coordinate" property="coordinate"/>--> |
| | | <result column="jd" property="jd"/> |
| | | <result column="wd" property="wd"/> |
| | | <result column="jtype" property="jtype"/> |
| | |
| | | |
| | | |
| | | <select id="selectAlarmPage" resultMap="alarmResultMap"> |
| | | select a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,a.waringType, |
| | | a.deviceNumber,a.region,a.district, a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,a.province,a.city,a.cid, |
| | | e.serialNumber, |
| | | select |
| | | a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,a.waringType,a.bz, |
| | | a.deviceNumber,a.region,a.district, |
| | | a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,a.province,a.city,a.cid, |
| | | e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone, |
| | | e.stype, |
| | | e.channelNumber from sys_alarm a |
| | | LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber |
| | | where 1=1 |
| | | where 1=1 |
| | | <if test="alarm.jtype!=null"> |
| | | and a.jtype like concat('%',#{alarm.jtype},'%') |
| | | </if> |
| | |
| | | <if test="alarm.endTime!=null and alarm.endTime!=''"> |
| | | and a.alarmTime<=#{alarm.endTime} |
| | | </if> |
| | | |
| | | and a.waringType IN("紧急求救") |
| | | |
| | | ORDER BY |
| | | a.jtype ASC, |
| | | a.alarmTime DESC |
| | |
| | | e.stype, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm a LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber LEFT JOIN jfpth.blade_region on jfpth.blade_region.`code`=a.district where 1=1 |
| | | sys_alarm a LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber LEFT JOIN jfpth.blade_region on |
| | | jfpth.blade_region.`code`=a.district where 1=1 |
| | | <if test="jtype!=null and jtype!=''"> |
| | | and a.jtype=#{jtype} |
| | | </if> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--实时提醒--> |
| | | <!--实时提醒--> |
| | | <select id="selecttx" resultMap="alarmResultMap"> |
| | | SELECT |
| | | a.id, |
| | |
| | | a.deviceNumber, |
| | | a.region, |
| | | a.district, |
| | | a.province, |
| | | a.city, |
| | | a.alarmId, |
| | | a.rname, |
| | | a.LEVEL, |
| | |
| | | d.addvnm, |
| | | e.serialNumber, |
| | | e.stype, |
| | | e.channelNumber |
| | | e.channelNumber, |
| | | e.oneContacts, |
| | | e.ThreeContacts, |
| | | e.twoContacts, |
| | | e.onePhone, |
| | | e.twoPhone, |
| | | e.ThreePhone |
| | | FROM |
| | | sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber where 1=1 |
| | | sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district LEFT JOIN sys_equipment e on |
| | | e.deviceNumber=a.deviceNumber where 1=1 |
| | | <if test="id!=null and id!=''"> |
| | | and a.id >#{id} |
| | | </if> |
| | |
| | | |
| | | |
| | | <update id="updateJtype"> |
| | | update sys_alarm SET jtype=1,czTime=#{czTime},bz=#{bz} where id=#{id} |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz},jjTime=#{jjtime} where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updatePoliceStatus"> |
| | | update jfpth.blade_user SET work_status=#{status} where id=#{id} |
| | | </update> |
| | | |
| | | <!--查询当天警情总数--> |
| | | <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> |
| | | |
| | | |
| | | <!--查询警情7天内每天的数据--> |
| | | <select id="selectAlarmData" resultType="java.lang.Integer"> |
| | | select ifnull(b.count,0) as count from |
| | | ( |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 day),'%Y-%m-%d') as click_date |
| | | union all |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 day),'%Y-%m-%d') as click_date |
| | | union all |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 day),'%Y-%m-%d') as click_date |
| | | union all |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 day),'%Y-%m-%d') as click_date |
| | | union all |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 day),'%Y-%m-%d') as click_date |
| | | union all |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 day),'%Y-%m-%d') as click_date |
| | | union all |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m-%d') as click_date |
| | | ) a |
| | | left join |
| | | ( |
| | | select DATE_FORMAT(alarmTime,'%Y-%m-%d') as datetime, count(*) as count from sys_alarm |
| | | where waringType = '紧急求救' |
| | | group by DATE_FORMAT(alarmTime,'%Y-%m-%d') |
| | | ) b |
| | | 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>--> |
| | | |
| | | <!--查询本日,本周,本月 主动报警的数量--> |
| | | <select id="selectAlarmSum" resultType="java.util.HashMap"> |
| | | select '一键求助' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where waringType = '紧急求救' |
| | | <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> |
| | | union all |
| | | select '电话报警' name,ifnull(count(*),0 ) value from sys_alarm |
| | | where waringType = '电话报警' |
| | | <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"> |
| | | SELECT * FROM jfpth.blade_user WHERE is_deleted != '1' and role_id ="1372092102682521602" |
| | | </select> |
| | | |
| | | |
| | | <select id="queryPoliceTime" resultType="java.util.HashMap"> |
| | | |
| | | SELECT |
| | | a.alarmPeople, |
| | | a.alarmId, |
| | | max( a.jjTime ) AS jjTime |
| | | FROM |
| | | sys_alarm a |
| | | WHERE |
| | | 1 =1 |
| | | |
| | | <if test="policeIdArr!=null and policeIdArr.size>0"> |
| | | and alarmId in |
| | | <foreach collection="policeIdArr" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | a.alarmPeople, |
| | | a.alarmId |
| | | ORDER BY |
| | | jjTime |
| | | LIMIT 1 |
| | | |
| | | </select> |
| | | </mapper> |