From a82b831b8b2b96dfa5791808f1207500e16697cf Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期三, 04 一月 2023 10:39:40 +0800 Subject: [PATCH] 优化设备状态保持,自动记录心跳间隔,三次心跳失败则设备离线,不在使用设备有效期字段作为唯一判断标准,提高容错能力和稳定性。 --- src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 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 b1210c6..8182e6d 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 @@ -24,6 +24,8 @@ "transport," + "streamMode," + "ip," + + "sdpIp," + + "localIp," + "port," + "hostAddress," + "expires," + @@ -52,11 +54,14 @@ "transport," + "streamMode," + "ip," + + "sdpIp," + + "localIp," + "port," + "hostAddress," + "expires," + "registerTime," + "keepaliveTime," + + "keepaliveIntervalTime," + "createTime," + "updateTime," + "charset," + @@ -77,11 +82,14 @@ "#{transport}," + "#{streamMode}," + "#{ip}," + + "#{sdpIp}," + + "#{localIp}," + "#{port}," + "#{hostAddress}," + "#{expires}," + "#{registerTime}," + "#{keepaliveTime}," + + "#{keepaliveIntervalTime}," + "#{createTime}," + "#{updateTime}," + "#{charset}," + @@ -105,11 +113,13 @@ "<if test=\"firmware != null\">, firmware='${firmware}'</if>" + "<if test=\"transport != null\">, transport='${transport}'</if>" + "<if test=\"ip != null\">, ip='${ip}'</if>" + + "<if test=\"localIp != null\">, localIp='${localIp}'</if>" + "<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=\"keepaliveIntervalTime != null\">, keepaliveIntervalTime='${keepaliveIntervalTime}'</if>" + "<if test=\"expires != null\">, expires=${expires}</if>" + "WHERE deviceId='${deviceId}'"+ " </script>"}) @@ -125,6 +135,8 @@ "transport," + "streamMode," + "ip," + + "sdpIp," + + "localIp," + "port," + "hostAddress," + "expires," + @@ -160,6 +172,8 @@ "transport," + "streamMode," + "ip," + + "sdpIp," + + "localIp," + "port," + "hostAddress," + "expires," + @@ -188,6 +202,8 @@ "transport," + "streamMode," + "ip," + + "sdpIp," + + "localIp," + "port," + "hostAddress," + "expires," + @@ -214,6 +230,7 @@ "<if test=\"password != null\">, password='${password}'</if>" + "<if test=\"streamMode != null\">, streamMode='${streamMode}'</if>" + "<if test=\"ip != null\">, ip='${ip}'</if>" + + "<if test=\"sdpIp != null\">, sdpIp='${sdpIp}'</if>" + "<if test=\"port != null\">, port=${port}</if>" + "<if test=\"charset != null\">, charset='${charset}'</if>" + "<if test=\"subscribeCycleForCatalog != null\">, subscribeCycleForCatalog=${subscribeCycleForCatalog}</if>" + @@ -232,6 +249,7 @@ "deviceId, " + "custom_name, " + "password, " + + "sdpIp, " + "createTime," + "updateTime," + "charset," + @@ -243,6 +261,7 @@ "#{deviceId}," + "#{name}," + "#{password}," + + "#{sdpIp}," + "#{createTime}," + "#{updateTime}," + "#{charset}," + -- Gitblit v1.8.0