| | |
| | | <result column="securityId" property="securityId"/> |
| | | <result column="baname" property="baname"/> |
| | | <result column="baid" property="baid"/> |
| | | <result column="deviceName" property="deviceName"/> |
| | | <result column="baphone" property="baphone"/> |
| | | <result column="manufacturers" property="manufacturers"/> |
| | | <result column="alarmlb" property="alarmlb"/> |
| | | <result column="alarmbs" property="alarmbs"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | |
| | | <if test="alarm.id!=null"> |
| | | and a.id = #{alarm.id} |
| | | </if> |
| | | <if test="alarm.alarmbs!=null"> |
| | | and a.alarmbs = #{alarm.alarmbs} |
| | | </if> |
| | | <if test="alarm.jtype!=null"> |
| | | and a.jtype like concat('%',#{alarm.jtype},'%') |
| | | </if> |
| | |
| | | and a.galarmPeople like concat('%',#{alarm.galarmPeople},'%') |
| | | </if> |
| | | <if test="alarm.district!=null"> |
| | | and a.district like concat('%',#{alarm.district},'%') |
| | | and e.district like concat('%',#{alarm.district},'%') |
| | | </if> |
| | | <if test="alarm.province!=null"> |
| | | and a.province like concat('%',#{alarm.province},'%') |
| | | and e.province like concat('%',#{alarm.province},'%') |
| | | </if> |
| | | <if test="alarm.city!=null"> |
| | | and a.city like concat('%',#{alarm.city},'%') |
| | | and e.city like concat('%',#{alarm.city},'%') |
| | | </if> |
| | | <if test="alarm.level!=null"> |
| | | and a.level like concat('%',#{alarm.level},'%') |
| | |
| | | <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, |
| | | a.securityArr,a.securityId, |
| | | 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,a.alarmlb,a.alarmbs, |
| | | 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.manufacturers, |
| | | e.street as place, |
| | | e.channelNumber, |
| | | u.name as baname, |
| | |
| | | a.alarmTime DESC |
| | | </select> |
| | | |
| | | <select id="selectazPage" resultMap="alarmResultMap"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | <if test="alarm.district!=null"> |
| | | and district like concat('%',#{alarm.district},'%') |
| | | </if> |
| | | <if test="alarm.province!=null"> |
| | | and province like concat('%',#{alarm.province},'%') |
| | | </if> |
| | | <if test="alarm.city!=null"> |
| | | and city like concat('%',#{alarm.city},'%') |
| | | </if> |
| | | <if test="alarm.alarmPeople!=null"> |
| | | and alarmPeople like concat('%',#{alarm.alarmPeople},'%') |
| | | </if> |
| | | <if test="alarm.jtype!=null"> |
| | | and jtype = #{alarm.jtype} |
| | | </if> |
| | | AND waringType IN ( "安装任务" ) |
| | | ORDER BY |
| | | jtype ASC, |
| | | alarmTime DESC |
| | | </select> |
| | | |
| | | <select id="getChartData" resultType="java.util.Map"> |
| | | SELECT |
| | | COUNT( * ) AS value, |
| | | "未安装" as name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND jtype = 0 |
| | | AND waringType IN ( "安装任务" ) UNION ALL |
| | | SELECT |
| | | COUNT( * ) AS value, |
| | | "已安装" as name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND jtype = 2 |
| | | AND waringType IN ( "安装任务" ) |
| | | </select> |
| | | <select id="getChartDataAlarm" resultType="java.util.Map"> |
| | | SELECT |
| | | COUNT( * ) AS |
| | | value |
| | | , |
| | | "未处理" AS name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND jtype = 0 |
| | | AND waringType IN ( "紧急求救" ) UNION ALL |
| | | SELECT |
| | | COUNT( * ) AS |
| | | value |
| | | , |
| | | "处理中" AS name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND jtype = 1 |
| | | AND waringType IN ( "紧急求救" ) |
| | | UNION ALL |
| | | SELECT |
| | | COUNT( * ) AS |
| | | value |
| | | , |
| | | "已处理" AS name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND jtype = 2 |
| | | AND waringType IN ( "紧急求救" ) |
| | | </select> |
| | | <select id="getChartDataAlarmBs" resultType="java.util.Map"> |
| | | SELECT |
| | | COUNT( * ) AS |
| | | value |
| | | , |
| | | "一般警情" AS name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND alarmbs = 0 |
| | | AND waringType IN ( "紧急求救" ) UNION ALL |
| | | SELECT |
| | | COUNT( * ) AS |
| | | value |
| | | , |
| | | "误报警情" AS name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND alarmbs = 1 |
| | | AND waringType IN ( "紧急求救" ) |
| | | UNION ALL |
| | | SELECT |
| | | COUNT( * ) AS |
| | | value |
| | | , |
| | | "严重警情" AS name |
| | | FROM |
| | | sys_alarm |
| | | WHERE |
| | | 1 = 1 |
| | | |
| | | <if test="beginTime!=null and beginTime!=''"> |
| | | and alarmTime>=#{beginTime} |
| | | </if> |
| | | <if test="endTime!=null and endTime!=''"> |
| | | and alarmTime<=#{endTime} |
| | | </if> |
| | | |
| | | AND alarmbs = 2 |
| | | AND waringType IN ( "紧急求救" ) |
| | | </select> |
| | | |
| | | <select id="listAll" 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,a.vaddress |
| | | a.deviceNumber,a.region,e.district, a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,e.province,e.city,a.cid,a.vaddress |
| | | from sys_alarm a LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber |
| | | |
| | | </select> |
| | |
| | | a.deviceNumber, |
| | | a.vaddress, |
| | | a.region, |
| | | a.district, |
| | | e.district, |
| | | a.alarmId, |
| | | a.czTime, |
| | | a.bz, |
| | |
| | | a.waringType, |
| | | a.deviceNumber, |
| | | a.region, |
| | | a.district, |
| | | a.province, |
| | | a.city, |
| | | e.district, |
| | | e.province, |
| | | e.city, |
| | | a.alarmId, |
| | | a.rname, |
| | | a.LEVEL, |
| | |
| | | |
| | | <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.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, |
| | | a.id,a.alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,a.content,"一键求助" as 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, |
| | | e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone, |
| | | e.stype, |
| | | e.oneId, |
| | | e.twoId, |
| | | e.threeId, |
| | | e.deptId, |
| | | a.alarmlb, |
| | | e.manufacturers, |
| | | e.channelNumber, |
| | | jfpth.blade_region.`name` as addvnm |
| | | FROM |
| | |
| | | ,bz=#{bz} |
| | | </if> |
| | | |
| | | <if test="securityArr!=null and id!=''"> |
| | | <if test="securityArr!=null and securityArr!=''"> |
| | | ,securityArr =#{securityArr} |
| | | </if> |
| | | |
| | | <if test="bs!=null and bs!=''"> |
| | | ,alarmbs =#{bs} |
| | | </if> |
| | | |
| | | where id=#{id} |
| | |
| | | <select id="getAlarm" 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, |
| | | 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.deviceName, |
| | | e.threeId, |
| | | e.deptId, |
| | | e.street as place, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | WHERE |
| | | |
| | | <if test="alarm.securityArr!=null and alarm.securityArr!=''"> |
| | | securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityArr},'%') |
| | | </if> |
| | | <if test="alarm.securityArr!=null and alarm.securityArr!=''"> |
| | | securityId = "" or securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityArr},'%') |
| | | </if> |
| | | |
| | | <if test="alarm.id!=null and alarm.id!=''"> |
| | | a.id = #{alarm.id} |
| | | </if> |
| | | <if test="alarm.id!=null and alarm.id!=''"> |
| | | a.id = #{alarm.id} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | |
| | | <select id="getAlarming" 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, |
| | | 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.deviceName, |
| | | e.deptId, |
| | | e.street as place, |
| | | e.channelNumber |
| | |
| | | </update> |
| | | |
| | | <update id="updateVaddress"> |
| | | update sys_alarm SET vaddress=#{vaddress},uids=#{uids} where id=#{jid} |
| | | update sys_alarm SET vaddress=#{vaddress} where id=#{jid} |
| | | </update> |
| | | |
| | | <update id="updateAaddress"> |
| | |
| | | <!--查询符合条件的数据并导出--> |
| | | <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, |
| | | a.alarmId,a.LEVEL,e.jd,e.wd,a.jtype,a.rname,a.jjTime,a.province,a.city, |
| | | a.id, "一键求助" as |
| | | alarmType,a.alarmPeople,a.alarmTime,a.galarmPeople,a.sex,a.phoneNumber,a.place,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, |
| | | e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone |
| | | from sys_alarm a |
| | | LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber |
| | |
| | | |
| | | <!--获取实时警情图表统计数据--> |
| | | <select id="getAlarmPie" resultType="org.springblade.common.entity.ReportReturnData"> |
| | | select if(1=1,"紧急求救",0) type,ifnull(count(*),0) count from sys_alarm |
| | | select if(1=1,"一键求助",0) type,ifnull(count(*),0) count from sys_alarm |
| | | where waringType="紧急求救" |
| | | <include refid="alarmConditionPie"></include> |
| | | </select> |
| | | |
| | | <!--查询未处理及处理中的警情总数量--> |
| | | <select id="selectEqCount" resultType="Integer"> |
| | | SELECT ifnull(count(*),0) count FROM `sys_alarm` |
| | | where deviceNumber = #{deviceNumber} |
| | | and jtype!=2 |
| | | </select> |
| | | |
| | | </mapper> |