From c85c99497212920327ebdca7f4f8b9cf2897f9d8 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 22 Mar 2023 10:31:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E5=A4=87=E7=82=B9?= =?UTF-8?q?=E6=92=AD=E6=97=B6=E6=8C=87=E5=AE=9A=E6=B5=81=E5=AA=92=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/2.6.7-2.6.8更新.sql | 4 ++++ sql/初始化.sql | 1 + .../java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java | 4 ++++ 3 files changed, 9 insertions(+) create mode 100755 sql/2.6.7-2.6.8更新.sql diff --git a/sql/2.6.7-2.6.8更新.sql b/sql/2.6.7-2.6.8更新.sql new file mode 100755 index 00000000..208f0bfa --- /dev/null +++ b/sql/2.6.7-2.6.8更新.sql @@ -0,0 +1,4 @@ +alter table device + add mediaServerId varchar(50) default null; + + diff --git a/sql/初始化.sql b/sql/初始化.sql index a8dfaff1..7b8be660 100644 --- a/sql/初始化.sql +++ b/sql/初始化.sql @@ -32,6 +32,7 @@ CREATE TABLE `device` ( `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `streamMode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `online` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `registerTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `keepaliveTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 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 b30ca19b..fcd59b0d 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 @@ -43,6 +43,7 @@ public interface DeviceMapper { "geoCoordSys," + "treeType," + "online," + + "mediaServerId," + "(SELECT count(0) FROM device_channel WHERE deviceId=device.deviceId) as channelCount "+ " FROM device WHERE deviceId = #{deviceId}") Device getDeviceByDeviceId(String deviceId); @@ -160,6 +161,7 @@ public interface DeviceMapper { "geoCoordSys," + "treeType," + "online," + + "mediaServerId," + "(SELECT count(0) FROM device_channel WHERE deviceId=de.deviceId) as channelCount FROM device de" + " where online=${online}"+ " " @@ -271,6 +273,7 @@ public interface DeviceMapper { "geoCoordSys," + "treeType," + "online" + + "mediaServerId" + ") VALUES (" + "#{deviceId}," + "#{name}," + @@ -284,6 +287,7 @@ public interface DeviceMapper { "#{geoCoordSys}," + "#{treeType}," + "#{online}" + + "#{mediaServerId}" + ")") void addCustomDevice(Device device);