From ae9976bb3a59cc3d9952dda6d9388bb412baa158 Mon Sep 17 00:00:00 2001
From: xu-bin-bin <34916924+xu-bin-bin@users.noreply.github.com>
Date: 星期二, 24 十月 2023 09:28:16 +0800
Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0
---
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 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
old mode 100644
new mode 100755
index 3aeb0e0..f363f66
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
@@ -8,6 +8,7 @@
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@@ -24,7 +25,7 @@
"SELECT device_channel_id from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
"<foreach collection='channelReduces' open='(' item='item' separator=',' close=')'> #{item.id}</foreach>" +
"</script>")
- List<Integer> findChannelRelatedPlatform(String platformId, List<ChannelReduce> channelReduces);
+ List<Integer> findChannelRelatedPlatform(@Param("platformId") String platformId, @Param("channelReduces") List<ChannelReduce> channelReduces);
@Insert("<script> "+
"INSERT INTO wvp_platform_gb_channel (platform_id, device_channel_id, catalog_id) VALUES" +
@@ -32,13 +33,13 @@
" (#{platformId}, #{item.id} , #{item.catalogId} )" +
"</foreach>" +
"</script>")
- int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd);
+ int addChannels(@Param("platformId") String platformId, @Param("channelReducesToAdd") List<ChannelReduce> channelReducesToAdd);
@Delete("<script> "+
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
"<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
"</script>")
- int delChannelForGB(String platformId, List<ChannelReduce> channelReducesToDel);
+ int delChannelForGB(@Param("platformId") String platformId, @Param("channelReducesToDel") List<ChannelReduce> channelReducesToDel);
@Delete("<script> "+
"DELETE from wvp_platform_gb_channel WHERE device_channel_id in " +
@@ -55,27 +56,27 @@
int cleanChannelForGB(String platformId);
@Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
- List<DeviceChannel> queryChannelInParentPlatform(String platformId, String channelId);
+ List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId);
@Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
- List<DeviceChannel> queryAllChannelInCatalog(String platformId, String catalogId);
+ List<DeviceChannel> queryAllChannelInCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " +
" from wvp_device_channel dc left join wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id " +
" where pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
- List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
+ List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("select d.*\n" +
"from wvp_platform_gb_channel pgc\n" +
" left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
" left join wvp_device d on dc.device_id = d.device_id\n" +
"where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
- List<Device> queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
+ List<Device> queryVideoDeviceByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
@Delete("<script> "+
- "DELETE from wvp_platform_gb_channel WHERE catalog_id=#{id}" +
+ "DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{id}" +
"</script>")
- int delByCatalogId(String id);
+ int delByCatalogId(@Param("platformId") String platformId, @Param("id") String id);
@Delete("<script> "+
"DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
@@ -96,7 +97,7 @@
"AND pp.server_gb_id IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ")
- List<ParentPlatform> queryPlatFormListForGBWithGBId(String channelId, List<String> platforms);
+ List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
@Delete("<script> " +
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" +
@@ -104,16 +105,17 @@
void delByPlatformId(String serverGBId);
@Delete("<script> " +
- "DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{catalogId}" +
+ "DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} " +
+ " <if test=\"catalogId != null\" > and catalog_id=#{catalogId}</if>" +
"</script>")
- int delChannelForGBByCatalogId(String platformId, String catalogId);
+ int delChannelForGBByCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
@Select("select dc.channel_id dc.device_id,dc.name,d.manufacturer,d.model,d.firmware\n" +
"from wvp_platform_gb_channel pgc\n" +
" left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
" left join wvp_device d on dc.device_id = d.device_id\n" +
"where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
- List<Device> queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId);
+ List<Device> queryDeviceInfoByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
@Select("SELECT pgc.platform_id from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id='${channelId}'")
List<String> queryParentPlatformByChannelId(String channelId);
--
Gitblit v1.8.0