| | |
| | | <result column="vaddress" property="vaddress"/> |
| | | <result column="aaddress" property="aaddress"/> |
| | | <result column="uids" property="uids"/> |
| | | <result column="securityArr" property="securityArr"/> |
| | | <result column="securityId" property="securityId"/> |
| | | <result column="baname" property="baname"/> |
| | | <result column="baid" property="baid"/> |
| | | <result column="baphone" property="baphone"/> |
| | | </resultMap> |
| | | |
| | | <sql id="alarmCondition"> |
| | | <if test="alarm.id!=null"> |
| | | and a.id = #{alarm.id} |
| | | </if> |
| | | <if test="alarm.jtype!=null"> |
| | | and a.jtype like concat('%',#{alarm.jtype},'%') |
| | | </if> |
| | |
| | | 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, |
| | | e.serialNumber,e.oneContacts,e.ThreeContacts,e.twoContacts,e.onePhone,e.twoPhone,e.ThreePhone, |
| | | e.stype, |
| | | e.oneId, |
| | |
| | | e.threeId, |
| | | e.deptId, |
| | | e.street as place, |
| | | e.channelNumber from sys_alarm a |
| | | e.channelNumber, |
| | | u.name as baname, |
| | | u.id as baid, |
| | | u.phone as baphone |
| | | from sys_alarm a |
| | | LEFT JOIN |
| | | sys_equipment e on e.deviceNumber=a.deviceNumber |
| | | LEFT JOIN jfpth.blade_user u ON u.id = a.securityId |
| | | where 1=1 |
| | | <include refid="alarmCondition"></include> |
| | | and a.waringType IN("紧急求救") |
| | |
| | | |
| | | |
| | | <update id="updateJtype"> |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz} |
| | | update sys_alarm SET jtype=#{jtype} |
| | | |
| | | <if test="bz!=null and bz!=''"> |
| | | ,bz=#{bz} |
| | | </if> |
| | | |
| | | <if test="securityArr!=null and id!=''"> |
| | | ,securityArr =#{securityArr} |
| | |
| | | AND role_id = "1370562810882502657" |
| | | </select> |
| | | |
| | | <select id="getAlarm" resultType="java.util.HashMap"> |
| | | SELECT |
| | | * |
| | | <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.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.street as place, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | WHERE |
| | | securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityArr},'%') |
| | | |
| | | <if test="alarm.securityArr!=null and alarm.securityArr!=''"> |
| | | securityId IS NULL |
| | | AND securityArr LIKE concat('%',#{alarm.securityArr},'%') |
| | | </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.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.street as place, |
| | | e.channelNumber |
| | | FROM |
| | | sys_alarm a |
| | | LEFT JOIN sys_equipment e ON e.deviceNumber = a.deviceNumber |
| | | WHERE |
| | | securityId =#{alarm.securityId} and jtype != 2 |
| | | |
| | | </select> |
| | | |
| | | <update id="setAlarm"> |
| | | update sys_alarm SET securityId=#{alarm.securityId} where id=#{alarm.id} |
| | | </update> |
| | | |
| | | <update id="updateVaddress"> |
| | | update sys_alarm SET vaddress=#{vaddress},uids=#{uids} where id=#{jid} |
| | | </update> |