| | |
| | | <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.alarmId,a.LEVEL,a.jd,a.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, |
| | |
| | | </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="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 = 1 order by alarmTime limit 9999 |
| | | )a) |
| | | union |
| | | (select * from ( |
| | |
| | | and securityId =#{alarm.securityId} and jtype = 2 |
| | | order by alarmTime desc |
| | | </if> |
| | | <if test="alarm.status==4"> |
| | | and securityId =#{alarm.securityId} and jtype = 1 |
| | | order by alarmTime desc |
| | | </if> |
| | | </select> |
| | | |
| | | <!--获取警情数量的集合,全部,未处理,已处理的数量--> |
| | |
| | | union |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId =#{alarm.securityId} and jtype = 2) |
| | | |
| | | union |
| | | (select ifnull(count(*),0) number from sys_alarm |
| | | where securityId =#{alarm.securityId} and jtype = 1) |
| | | </select> |
| | | |
| | | <update id="setAlarm"> |