From a29a0a0785f966294ba01982fba62c1ff0f23bea Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: 星期四, 22 四月 2021 17:33:07 +0800 Subject: [PATCH] 增加对设备的兼容性 --- src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java index b0428cc..c18c5c3 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java @@ -14,17 +14,18 @@ public interface ParentPlatformMapper { @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " + - " devicePort, username, password, expires, keepTimeout, transport, characterSet, PTZEnable, rtcp, " + + " devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " + " status) " + " VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " + - " '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${PTZEnable}, ${rtcp}, " + + " '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " + " ${status})") int addParentPlatform(ParentPlatform parentPlatform); @Update("UPDATE parent_platform " + "SET enable=#{enable}, " + "name=#{name}," + - "serverGBId=#{serverGBId}," + + "deviceGBId=#{deviceGBId}," + + "serverGBId=#{serverGBId}, " + "serverGBDomain=#{serverGBDomain}, " + "serverIP=#{serverIP}," + "serverPort=#{serverPort}, " + @@ -36,23 +37,33 @@ "keepTimeout=#{keepTimeout}, " + "transport=#{transport}, " + "characterSet=#{characterSet}, " + - "PTZEnable=#{PTZEnable}, " + + "ptz=#{ptz}, " + "rtcp=#{rtcp}, " + "status=#{status} " + - "WHERE deviceGBId=#{deviceGBId}") + "WHERE id=#{id}") int updateParentPlatform(ParentPlatform parentPlatform); - @Delete("DELETE FROM parent_platform WHERE deviceGBId=#{deviceGBId}") + @Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}") int delParentPlatform(ParentPlatform parentPlatform); - @Select("SELECT * FROM parent_platform") + @Select("SELECT *, ((SELECT count(0)\n" + + " FROM platform_gb_channel pc\n" + + " WHERE pc.platformId = pp.serverGBId)\n" + + " +\n" + + " (SELECT count(0)\n" + + " FROM platform_gb_stream pgs\n" + + " WHERE pgs.platformId = pp.serverGBId)) as channelCount\n" + + "FROM parent_platform pp ") List<ParentPlatform> getParentPlatformList(); @Select("SELECT * FROM parent_platform WHERE enable=#{enable}") List<ParentPlatform> getEnableParentPlatformList(boolean enable); - @Select("SELECT * FROM parent_platform WHERE deviceGBId=#{platformGbId}") - ParentPlatform getParentPlatById(String platformGbId); + @Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}") + ParentPlatform getParentPlatByServerGBId(String platformGbId); + + @Select("SELECT * FROM parent_platform WHERE id=#{id}") + ParentPlatform getParentPlatById(int id); @Update("UPDATE parent_platform SET status=false" ) void outlineForAllParentPlatform(); -- Gitblit v1.8.0