From 63d906d388418fe7f8cf9b3952d0e8a2598f8ea9 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Fri, 23 Apr 2021 16:32:18 +0800
Subject: [PATCH] app接口

---
 blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
index df3dad8..94cf1ca 100644
--- a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/alarm/mapper/AlarmMapper.xml
@@ -33,6 +33,7 @@
         <result column="cid" property="cid"/>
         <result column="vaddress" property="vaddress"/>
         <result column="aaddress" property="aaddress"/>
+        <result column="uids" property="uids"/>
     </resultMap>
 
     <sql id="alarmCondition">
@@ -179,7 +180,7 @@
 
     <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.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,
@@ -188,6 +189,7 @@
         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
@@ -396,7 +398,13 @@
 
 
     <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">
@@ -545,8 +553,19 @@
         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">
@@ -626,7 +645,7 @@
         from sys_alarm a
         LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber
         where 1=1
-            <include refid="alarmCondition"></include>
+        <include refid="alarmCondition"></include>
         and a.waringType IN("紧急求救")
         ORDER BY
         a.jtype ASC,
@@ -636,7 +655,7 @@
     <!--获取实时警情图表统计数据-->
     <select id="getAlarmPie" resultType="org.springblade.common.entity.ReportReturnData">
         select if(1=1,"紧急求救",0) type,ifnull(count(*),0) count from sys_alarm
-            where waringType="紧急求救"
+        where waringType="紧急求救"
         <include refid="alarmConditionPie"></include>
     </select>
 

--
Gitblit v1.9.3