From 22efd0f56c20e1aedb18fa7b9bcdc48007fcc954 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 20 十二月 2021 09:51:51 +0800
Subject: [PATCH] 添加心跳到期时验证zlm是否真的离线。

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
index ce3d658..ed2d8c8 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
@@ -1,7 +1,6 @@
 package com.genersoft.iot.vmp.storager.dao;
 
 import com.genersoft.iot.vmp.gb28181.bean.Device;
-import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
 import org.apache.ibatis.annotations.*;
 import org.springframework.stereotype.Repository;
 
@@ -28,6 +27,13 @@
                 "ip," +
                 "port," +
                 "hostAddress," +
+                "expires," +
+                "registerTime," +
+                "keepaliveTime," +
+                "createTime," +
+                "updateTime," +
+                "charset," +
+                "subscribeCycleForCatalog," +
                 "online" +
             ") VALUES (" +
                 "#{deviceId}," +
@@ -40,13 +46,20 @@
                 "#{ip}," +
                 "#{port}," +
                 "#{hostAddress}," +
+                "#{expires}," +
+                "#{registerTime}," +
+                "#{keepaliveTime}," +
+                "#{createTime}," +
+                "#{updateTime}," +
+                "#{charset}," +
+                "#{subscribeCycleForCatalog}," +
                 "#{online}" +
             ")")
     int add(Device device);
 
     @Update(value = {" <script>" +
                 "UPDATE device " +
-                "SET deviceId='${deviceId}'" +
+                "SET updateTime='${updateTime}'" +
                 "<if test=\"name != null\">, name='${name}'</if>" +
                 "<if test=\"manufacturer != null\">, manufacturer='${manufacturer}'</if>" +
                 "<if test=\"model != null\">, model='${model}'</if>" +
@@ -57,6 +70,11 @@
                 "<if test=\"port != null\">, port=${port}</if>" +
                 "<if test=\"hostAddress != null\">, hostAddress='${hostAddress}'</if>" +
                 "<if test=\"online != null\">, online=${online}</if>" +
+                "<if test=\"registerTime != null\">, registerTime='${registerTime}'</if>" +
+                "<if test=\"keepaliveTime != null\">, keepaliveTime='${keepaliveTime}'</if>" +
+                "<if test=\"expires != null\">, expires=${expires}</if>" +
+                "<if test=\"charset != null\">, charset='${charset}'</if>" +
+                "<if test=\"subscribeCycleForCatalog != null\">, subscribeCycleForCatalog=#{subscribeCycleForCatalog}</if>" +
                 "WHERE deviceId='${deviceId}'"+
             " </script>"})
     int update(Device device);
@@ -67,4 +85,6 @@
     @Delete("DELETE FROM device WHERE deviceId=#{deviceId}")
     int del(String deviceId);
 
+    @Update("UPDATE device SET online=0")
+    int outlineForAll();
 }

--
Gitblit v1.8.0