From 71b6b716361c52af290493d365a328fc1a3467e2 Mon Sep 17 00:00:00 2001
From: nnnjjj123 <494715143@qq.com>
Date: Thu, 28 Jan 2021 11:15:06 +0800
Subject: [PATCH] 1.统计接口 2.健康码

---
 src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

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>
 
 

--
Gitblit v1.9.3