南昌市物联网技防平台-后台
tangzy
2021-04-25 a4ff2b571be305e2641c9dd67797f4102e795ebb
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
@@ -34,9 +34,14 @@
        <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"/>
    </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>
@@ -183,6 +188,7 @@
        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,
@@ -398,7 +404,11 @@
    <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}
@@ -555,15 +565,115 @@
    <select id="getAlarm" resultType="java.util.HashMap">
        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
            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" resultType="java.util.HashMap">
        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
            securityId =#{alarm.securityId}
    </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>