From 1bd3438d234684520c9bf92ea1a311d5535514d0 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Wed, 27 Jan 2021 14:21:26 +0800
Subject: [PATCH] 客户列表接口修改

---
 src/main/java/org/springblade/modules/alarm/mapper/AlarmMapper.xml         |   30 +++++++-------
 src/main/java/org/springblade/modules/alarm/entity/Alarm.java              |    2 
 src/main/resources/application-dev.yml                                     |   16 ++++----
 src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml |   33 +++++++++++++++-
 src/main/java/org/springblade/modules/nettyServer/ServerHandler.java       |    2 
 5 files changed, 56 insertions(+), 27 deletions(-)

diff --git a/src/main/java/org/springblade/modules/alarm/entity/Alarm.java b/src/main/java/org/springblade/modules/alarm/entity/Alarm.java
index 625edcc..497f6af 100644
--- a/src/main/java/org/springblade/modules/alarm/entity/Alarm.java
+++ b/src/main/java/org/springblade/modules/alarm/entity/Alarm.java
@@ -108,7 +108,7 @@
 	* 行政区编码
 	*/
 		@ApiModelProperty(value = "行政区编码")
-		private String addvcd;
+		private String district;
 	/**
 	* 行政区编码
 	*/
diff --git a/src/main/java/org/springblade/modules/alarm/mapper/AlarmMapper.xml b/src/main/java/org/springblade/modules/alarm/mapper/AlarmMapper.xml
index 68b593f..06b99b2 100644
--- a/src/main/java/org/springblade/modules/alarm/mapper/AlarmMapper.xml
+++ b/src/main/java/org/springblade/modules/alarm/mapper/AlarmMapper.xml
@@ -16,7 +16,7 @@
         <result column="waringType" property="waringType"/>
         <result column="deviceNumber" property="deviceNumber"/>
         <result column="region" property="region"/>
-        <result column="addvcd" property="addvcd"/>
+        <result column="district" property="district"/>
         <result column="alarmId" property="alarmId"/>
         <result column="level" property="level"/>
         <result column="coordinate" property="coordinate"/>
@@ -35,7 +35,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.deviceNumber,a.region,a.addvcd, a.alarmId,a.LEVEL,ST_ASTEXT (a.coordinate) AS coordinate,FORMAT(a.jd,6) as jd,FORMAT(a.wd,6) as wd,a.jtype,a.rname from sys_alarm a where 1=1
+        a.deviceNumber,a.region,a.district, a.alarmId,a.LEVEL,ST_ASTEXT (a.coordinate) AS coordinate,FORMAT(a.jd,6) as jd,FORMAT(a.wd,6) as wd,a.jtype,a.rname from sys_alarm a where 1=1
         <if test="alarm.jtype!=null">
             and a.jtype like concat(concat('%', #{alarm.jtype}), '%')
         </if>
@@ -43,7 +43,7 @@
             and a.galarmPeople like concat(concat('%', #{alarm.galarmPeople}), '%')
         </if>
         <if test="alarm.addvcd!=null">
-            and a.addvcd like concat(concat('%', #{alarm.addvcd}), '%')
+            and a.district like concat(concat('%', #{alarm.district}), '%')
         </if>
         <if test="alarm.level!=null">
             and a.level like concat(concat('%', #{alarm.level}), '%')
@@ -67,7 +67,7 @@
         a.waringType,
         a.deviceNumber,
         a.region,
-        a.addvcd,
+        a.district,
         a.alarmId,
         a.czTime,
         a.bz,
@@ -83,12 +83,12 @@
         e.stype,
         e.channelNumber
         FROM
-        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.addvcd LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber where 1=1
+        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber where 1=1
         <if test="jtype!=null and jtype!=''">
             and a.jtype=#{jtype}
         </if>
         <if test="addvcd!=null and addvcd!=''">
-            and a.addvcd=#{addvcd}
+            and a.district=#{addvcd}
         </if>
         <if test="waringType!=null and waringType!=''">
             and a.waringType=#{waringType}
@@ -118,7 +118,7 @@
         a.waringType,
         a.deviceNumber,
         a.region,
-        a.addvcd,
+        a.district,
         a.alarmId,
         a.rname,
         a.jjTime,
@@ -129,7 +129,7 @@
         a.jtype,
         d.addvnm
         FROM
-        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.addvcd where 1=1
+        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district where 1=1
         <if test="id!=null and id!=''">
             and a.id=#{id}
         </if>
@@ -150,7 +150,7 @@
         a.waringType,
         a.deviceNumber,
         a.region,
-        a.addvcd,
+        a.district,
         a.alarmId,
         a.jjTime,
         a.rname,
@@ -164,7 +164,7 @@
         e.stype,
         e.channelNumber
         FROM
-        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.addvcd LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber where 1=1
+        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber where 1=1
         <if test="id!=null and id!=''">
             and a.id &gt;#{id}
         </if>
@@ -177,8 +177,8 @@
     <!--新增-->
     <insert id="s" parameterType="org.springblade.modules.alarm.entity.Alarm">
        INSERT INTO sys_alarm (alarmType,alarmPeople,alarmTime,galarmPeople,sex,phoneNumber,place,content,waringType,deviceNumber,
-       region,addvcd,alarmId,level,rname,coordinate,jd,wd,jtype,czTime,bz,jjTime) VALUES
-        (#{alarmType},#{alarmPeople},#{alarmTime},#{galarmPeople},#{sex},#{phoneNumber},#{place},#{content},#{waringType},#{deviceNumber},#{region},#{addvcd},
+       region,district,alarmId,level,rname,coordinate,jd,wd,jtype,czTime,bz,jjTime) VALUES
+        (#{alarmType},#{alarmPeople},#{alarmTime},#{galarmPeople},#{sex},#{phoneNumber},#{place},#{content},#{waringType},#{deviceNumber},#{region},#{district},
         #{alarmId},#{level},#{rname},POINT(#{jd},#{wd}),#{jd},#{wd},#{jtype}
         ,#{czTime},#{bz},#{jjTime})
     </insert>
@@ -187,7 +187,7 @@
     update sys_alarm SET alarmType=#{alarmType},alarmPeople=#{alarmPeople},alarmTime=#{alarmTime},
     galarmPeople=#{galarmPeople},sex=#{sex},phoneNumber=#{phoneNumber},place=#{place},
     content=#{content},waringType=#{waringType},deviceNumber=#{deviceNumber},region=#{region},
-    addvcd=#{addvcd},alarmId=#{alarmId},level=#{level},rname=#{rname},jd=#{jd},
+    district=#{addvcd},alarmId=#{alarmId},level=#{level},rname=#{rname},jd=#{jd},
     wd=#{wd},coordinate=POINT(#{jd},#{wd}),jtype=#{jtype},jtype=#{jtype},czTime=#{czTime},bz=#{bz},jjTime=#{jjTime} where id=#{id}
 </update>
 
@@ -211,7 +211,7 @@
         a.waringType,
         a.deviceNumber,
         a.region,
-        a.addvcd,
+        a.district,
         a.alarmId,
         a.LEVEL,
         ST_ASTEXT (a.coordinate ) AS coordinate,
@@ -224,7 +224,7 @@
         e.stype,
         e.channelNumber
         FROM
-        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.addvcd LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber  where
+        sys_alarm a LEFT JOIN sys_district d on d.addvcds=a.district LEFT JOIN sys_equipment e on e.deviceNumber=a.deviceNumber  where
         DATE_FORMAT(alarmTime,'%Y-%m-%d') &gt;=#{beginTime} and DATE_FORMAT(alarmTime,'%Y-%m-%d') &lt;=#{endTime} ORDER BY alarmTime desc
     </select>
 
diff --git a/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml b/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
index 8d8b297..a52ce21 100644
--- a/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
+++ b/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
@@ -138,8 +138,37 @@
 
     <update id="updateClinent" parameterType="org.springblade.modules.equipment.entity.Equipment">
     update sys_equipment SET deviceName=#{deviceName},deviceNumber=#{deviceNumber},deviceType=#{deviceType},
-    ownership=#{ownership},devicestate=#{devicestate},stime=#{stime},
-    addvcd=#{addvcd},street=#{street},dtype=#{dtype},pay=#{pay},expireTime=#{expireTime},heartbeat=#{heartbeat} where id=#{id}
+    ownership=#{ownership},devicestate=#{devicestate},
+    addvcd=#{addvcd},street=#{street},dtype=#{dtype},pay=#{pay}
+
+    <choose>
+        <when test="expireTime!=null and expireTime!=''">
+            ,expireTime=#{expireTime}
+        </when>
+        <otherwise>
+            ,expireTime= null
+        </otherwise>
+    </choose>
+
+    <choose>
+        <when test="heartbeat!=null and heartbeat!=''">
+            ,heartbeat=#{heartbeat}
+        </when>
+        <otherwise>
+            ,heartbeat= null
+        </otherwise>
+    </choose>
+
+    <choose>
+        <when test="stime!=null and stime!=''">
+            ,stime=#{stime}
+        </when>
+        <otherwise>
+            ,stime= null
+        </otherwise>
+    </choose>
+
+    where id=#{id}
     </update>
 
 
diff --git a/src/main/java/org/springblade/modules/nettyServer/ServerHandler.java b/src/main/java/org/springblade/modules/nettyServer/ServerHandler.java
index d06ed1e..8713a97 100644
--- a/src/main/java/org/springblade/modules/nettyServer/ServerHandler.java
+++ b/src/main/java/org/springblade/modules/nettyServer/ServerHandler.java
@@ -144,7 +144,7 @@
 				alarm.setAlarmTime(df.format(day));
 				alarm.setPlace((String) list.get(0).get("streeName"));//事发地址
 				alarm.setDeviceNumber((String) list.get(0).get("deviceNumber"));//设备编号
-				alarm.setAddvcd((String) list.get(0).get("addvcd"));//行政区编码
+				alarm.setDistrict((String) list.get(0).get("addvcd"));//行政区编码
 				alarm.setJd((String) list.get(0).get("jd"));//经度
 				alarm.setWd((String) list.get(0).get("wd"));//纬度
 				alarm.setJtype("0");
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 126e958..93bf54e 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -17,15 +17,15 @@
       primary: master
       datasource:
         master:
-          url: jdbc:mysql://47.110.245.84:3306/springboot?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&useOldAliasMetadataBehavior=true
-          username: sa
-          password: 131556
+          url: jdbc:mysql://192.168.0.105:3306/springboot?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&useOldAliasMetadataBehavior=true
+          username: root
+          password: 123456
           driver-class-name: com.mysql.cj.jdbc.Driver
         slaves:
           driver-class-name: com.mysql.cj.jdbc.Driver
-          url: jdbc:mysql://47.110.245.84:3306/fjpt?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&useOldAliasMetadataBehavior=true
-          username: sa
-          password: 131556
+          url: jdbc:mysql://192.168.0.105:3306/jfpt?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&useOldAliasMetadataBehavior=true
+          username: root
+          password: 123456
 
 #第三方登陆
 social:
@@ -49,8 +49,8 @@
   jpa:
     show-sql: true
     hibernate:
-     naming:
-      physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
+      naming:
+        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
     properties:
       hibernate.format_sql: true
       hibernate.dialect: org.hibernate.spatial.dialect.mysql.MySQL56InnoDBSpatialDialect

--
Gitblit v1.9.3