From f88c70d38ce1c9c0d04460d0c225373c84dc2eca Mon Sep 17 00:00:00 2001
From: dengming <dengming@ctfo.com>
Date: 星期四, 10 三月 2022 17:27:07 +0800
Subject: [PATCH] 删除重复字段,channelId字段查询了两次

---
 src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 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 190a7b1..f1d23f1 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
@@ -57,9 +57,9 @@
     @Select("SELECT dc.* FROM platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId WHERE dc.channelId='${channelId}' and pgc.platformId='${platformId}'")
     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.id = pgc.deviceChannelId" +
-            "where pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}")
+    @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.id = pgc.deviceChannelId " +
+            " where pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}")
     List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
 
     @Select("select d.*\n" +
@@ -75,7 +75,7 @@
     int delByCatalogId(String id);
 
     @Delete("<script> "+
-           "DELETE FROM platform_gb_channel WHERE catalogId=#{parentId} AND platformId=#{platformId} AND channelId=#{id}"  +
+           "DELETE FROM platform_gb_channel  WHERE catalogId=#{parentId} AND platformId=#{platformId} AND channelId=#{id}"  +
            "</script>")
     int delByCatalogIdAndChannelIdAndPlatformId(PlatformCatalog platformCatalog);
 

--
Gitblit v1.8.0