From 86f87c4665e0c3c9c2723c32c0615f85ca4b0a7c Mon Sep 17 00:00:00 2001
From: ydpd <ydpd@163.com>
Date: 星期三, 02 三月 2022 00:24:14 +0800
Subject: [PATCH] 修改内存泄露

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
index c3c11a8..190a7b1 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
@@ -58,11 +58,15 @@
     DeviceChannel queryChannelInParentPlatform(String platformId, String channelId);
 
     @Select("select dc.channelId as id, dc.name as name, pgc.platformId as platformId, pgc.catalogId as parentId, 0 as childrenCount, 1 as type " +
-            "from device_channel dc left join platform_gb_channel pgc on dc.deviceId = pgc.deviceId and dc.channelId = pgc.channelId " +
+            "from device_channel dc left join platform_gb_channel pgc on dc.id = pgc.deviceChannelId" +
             "where pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}")
     List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
 
-    @Select("SELECT * FROM device WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE platformId='${platformId}' AND channelId='${channelId}')")
+    @Select("select d.*\n" +
+            "from platform_gb_channel pgc\n" +
+            "         left join device_channel dc on dc.id = pgc.deviceChannelId\n" +
+            "         left join device d on dc.deviceId = d.deviceId\n" +
+            "where dc.channelId = #{channelId} and pgc.platformId=#{platformId}")
     Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
 
     @Delete("<script> "+

--
Gitblit v1.8.0