| | |
| | | <result column="cid" property="cid"/> |
| | | <result column="vaddress" property="vaddress"/> |
| | | <result column="aaddress" property="aaddress"/> |
| | | <result column="uids" property="uids"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <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.bz, |
| | | a.deviceNumber,a.region,a.district,a.vaddress,a.aaddress, |
| | | 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.oneId, |
| | | e.twoId, |
| | | e.threeId, |
| | | e.deptId, |
| | | e.channelNumber from sys_alarm a |
| | | LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber |
| | | where 1=1 |
| | | <sql id="alarmCondition"> |
| | | <if test="alarm.jtype!=null"> |
| | | and a.jtype like concat('%',#{alarm.jtype},'%') |
| | | </if> |
| | |
| | | and hour(alarmTime)>=22 and hour(alarmTime) <24 |
| | | </if> |
| | | </if> |
| | | </sql> |
| | | <sql id="alarmConditionPie"> |
| | | <if test="alarm.beginTime!=null and alarm.beginTime!=''"> |
| | | and DATE_FORMAT(a.alarmTime,'%Y-%m-%d')>=#{alarm.beginTime} |
| | | </if> |
| | | <if test="alarm.endTime!=null and alarm.endTime!=''"> |
| | | and DATE_FORMAT(a.alarmTime,'%Y-%m-%d')<=#{alarm.endTime} |
| | | </if> |
| | | <if test="alarm.timeDesc!=null and alarm.timeDesc!=''"> |
| | | <if test="alarm.timeDesc=='30分钟以上'"> |
| | | and czTime-alarmTime>1800 |
| | | </if> |
| | | <if test="alarm.timeDesc=='10-30分钟'"> |
| | | and czTime-alarmTime>600 and czTime-alarmTime <1800 |
| | | </if> |
| | | <if test="alarm.timeDesc=='5-10分钟'"> |
| | | and czTime-alarmTime>300 and czTime-alarmTime <600 |
| | | </if> |
| | | <if test="alarm.timeDesc=='小于5分钟'"> |
| | | and czTime-alarmTime>0 and czTime-alarmTime <300 |
| | | </if> |
| | | <if test="alarm.timeDesc=='0-2'"> |
| | | and hour(alarmTime)>=0 and hour(alarmTime) <2 |
| | | </if> |
| | | <if test="alarm.timeDesc=='2-4'"> |
| | | and hour(alarmTime)>=2 and hour(alarmTime) <4 |
| | | </if> |
| | | <if test="alarm.timeDesc=='4-6'"> |
| | | and hour(alarmTime)>=4 and hour(alarmTime) <6 |
| | | </if> |
| | | <if test="alarm.timeDesc=='6-8'"> |
| | | and hour(alarmTime)>=6 and hour(alarmTime) <8 |
| | | </if> |
| | | <if test="alarm.timeDesc=='8-10'"> |
| | | and hour(alarmTime)>=8 and hour(alarmTime) <10 |
| | | </if> |
| | | <if test="alarm.timeDesc=='10-12'"> |
| | | and hour(alarmTime)>=10 and hour(alarmTime) <12 |
| | | </if> |
| | | <if test="alarm.timeDesc=='12-14'"> |
| | | and hour(alarmTime)>=12 and hour(alarmTime) <14 |
| | | </if> |
| | | <if test="alarm.timeDesc=='14-16'"> |
| | | and hour(alarmTime)>=14 and hour(alarmTime) <16 |
| | | </if> |
| | | <if test="alarm.timeDesc=='16-18'"> |
| | | and hour(alarmTime)>=16 and hour(alarmTime) <18 |
| | | </if> |
| | | <if test="alarm.timeDesc=='18-20'"> |
| | | and hour(alarmTime)>=18 and hour(alarmTime) <20 |
| | | </if> |
| | | <if test="alarm.timeDesc=='20-22'"> |
| | | and hour(alarmTime)>=20 and hour(alarmTime) <22 |
| | | </if> |
| | | <if test="alarm.timeDesc=='22-24'"> |
| | | and hour(alarmTime)>=22 and hour(alarmTime) <24 |
| | | </if> |
| | | </if> |
| | | </sql> |
| | | |
| | | |
| | | <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,a.district,a.vaddress,a.aaddress, |
| | | 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.oneId, |
| | | e.twoId, |
| | | e.threeId, |
| | | e.deptId, |
| | | e.street as place, |
| | | e.channelNumber from sys_alarm a |
| | | 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="selectListSe" 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, |
| | | a.jd, |
| | | a.cid, |
| | | a.wd, |
| | | a.jtype, |
| | | a.rname, |
| | | e.serialNumber, |
| | | 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.vaddress,a.aaddress, |
| | | 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.oneId, |
| | | e.twoId, |
| | | e.threeId, |
| | | e.deptId, |
| | | e.channelNumber, |
| | | jfpth.blade_region.`name` as addvnm |
| | | 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 |
| | | DATE_FORMAT(alarmTime,'%Y-%m-%d') >=#{beginTime} and DATE_FORMAT(alarmTime,'%Y-%m-%d') <=#{endTime} and a.waringType IN("紧急求救") ORDER BY alarmTime desc |
| | | 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 |
| | | 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> |
| | | |
| | | |
| | | <update id="updateJtype"> |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz} where id=#{id} |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz} |
| | | |
| | | <if test="securityArr!=null and id!=''"> |
| | | ,securityArr =#{securityArr} |
| | | </if> |
| | | |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updatePoliceStatus"> |
| | |
| | | AND role_id = "1370562810882502657" |
| | | </select> |
| | | |
| | | <select id="getAlarm" resultType="java.util.HashMap"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityArr},'%') |
| | | |
| | | </select> |
| | | |
| | | <update id="updateVaddress"> |
| | | update sys_alarm SET vaddress=#{vaddress} where id=#{jid} |
| | | update sys_alarm SET vaddress=#{vaddress},uids=#{uids} where id=#{jid} |
| | | </update> |
| | | |
| | | <update id="updateAaddress"> |
| | |
| | | </select> |
| | | |
| | | <!--查询符合条件的数据并导出--> |
| | | <select id="exportAlarm" resultType="org.springblade.jfpt.alarm.vo.AlarmExcel"> |
| | | <select id="exportAlarm" resultType="org.springblade.common.entity.AlarmExcel"> |
| | | 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.vaddress,a.aaddress, |
| | |
| | | from sys_alarm a |
| | | LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber |
| | | where 1=1 |
| | | <if test="alarm.jtype!=null"> |
| | | and a.jtype like concat('%',#{alarm.jtype},'%') |
| | | </if> |
| | | <if test="alarm.deviceNumber!=null"> |
| | | and a.deviceNumber like concat('%',#{alarm.deviceNumber},'%') |
| | | </if> |
| | | <if test="alarm.galarmPeople!=null"> |
| | | and a.galarmPeople like concat('%',#{alarm.galarmPeople},'%') |
| | | </if> |
| | | <if test="alarm.district!=null"> |
| | | and a.district like concat('%',#{alarm.district},'%') |
| | | </if> |
| | | <if test="alarm.province!=null"> |
| | | and a.province like concat('%',#{alarm.province},'%') |
| | | </if> |
| | | <if test="alarm.city!=null"> |
| | | and a.city like concat('%',#{alarm.city},'%') |
| | | </if> |
| | | <if test="alarm.level!=null"> |
| | | and a.level like concat('%',#{alarm.level},'%') |
| | | </if> |
| | | <if test="alarm.waringType!=null"> |
| | | and a.waringType like concat('%',#{alarm.waringType},'%') |
| | | </if> |
| | | <if test="alarm.beginTime!=null and alarm.beginTime!=''"> |
| | | and a.alarmTime>=#{alarm.beginTime} |
| | | </if> |
| | | <if test="alarm.endTime!=null and alarm.endTime!=''"> |
| | | and a.alarmTime<=#{alarm.endTime} |
| | | </if> |
| | | <if test="alarm.timeDesc!=null and alarm.timeDesc!=''"> |
| | | <if test="alarm.timeDesc=='30分钟以上'"> |
| | | and czTime-alarmTime>1800 |
| | | </if> |
| | | <if test="alarm.timeDesc=='10-30分钟'"> |
| | | and czTime-alarmTime>600 and czTime-alarmTime <1800 |
| | | </if> |
| | | <if test="alarm.timeDesc=='5-10分钟'"> |
| | | and czTime-alarmTime>300 and czTime-alarmTime <600 |
| | | </if> |
| | | <if test="alarm.timeDesc=='小于5分钟'"> |
| | | and czTime-alarmTime>0 and czTime-alarmTime <300 |
| | | </if> |
| | | <if test="alarm.timeDesc=='0-2'"> |
| | | and hour(alarmTime)>=0 and hour(alarmTime) <2 |
| | | </if> |
| | | <if test="alarm.timeDesc=='2-4'"> |
| | | and hour(alarmTime)>=2 and hour(alarmTime) <4 |
| | | </if> |
| | | <if test="alarm.timeDesc=='4-6'"> |
| | | and hour(alarmTime)>=4 and hour(alarmTime) <6 |
| | | </if> |
| | | <if test="alarm.timeDesc=='6-8'"> |
| | | and hour(alarmTime)>=6 and hour(alarmTime) <8 |
| | | </if> |
| | | <if test="alarm.timeDesc=='8-10'"> |
| | | and hour(alarmTime)>=8 and hour(alarmTime) <10 |
| | | </if> |
| | | <if test="alarm.timeDesc=='10-12'"> |
| | | and hour(alarmTime)>=10 and hour(alarmTime) <12 |
| | | </if> |
| | | <if test="alarm.timeDesc=='12-14'"> |
| | | and hour(alarmTime)>=12 and hour(alarmTime) <14 |
| | | </if> |
| | | <if test="alarm.timeDesc=='14-16'"> |
| | | and hour(alarmTime)>=14 and hour(alarmTime) <16 |
| | | </if> |
| | | <if test="alarm.timeDesc=='16-18'"> |
| | | and hour(alarmTime)>=16 and hour(alarmTime) <18 |
| | | </if> |
| | | <if test="alarm.timeDesc=='18-20'"> |
| | | and hour(alarmTime)>=18 and hour(alarmTime) <20 |
| | | </if> |
| | | <if test="alarm.timeDesc=='20-22'"> |
| | | and hour(alarmTime)>=20 and hour(alarmTime) <22 |
| | | </if> |
| | | <if test="alarm.timeDesc=='22-24'"> |
| | | and hour(alarmTime)>=22 and hour(alarmTime) <24 |
| | | </if> |
| | | </if> |
| | | |
| | | <include refid="alarmCondition"></include> |
| | | and a.waringType IN("紧急求救") |
| | | |
| | | ORDER BY |
| | | a.jtype ASC, |
| | | a.alarmTime DESC |
| | | </select> |
| | | |
| | | <!--获取实时警情图表统计数据--> |
| | | <select id="getAlarmPie" resultType="org.springblade.common.entity.ReportReturnData"> |
| | | select if(1=1,"紧急求救",0) type,ifnull(count(*),0) count from sys_alarm |
| | | where waringType="紧急求救" |
| | | <include refid="alarmConditionPie"></include> |
| | | </select> |
| | | |
| | | </mapper> |