From 8fdd10d1c2723ead1d2c3b232f64f292ba3ce1cc Mon Sep 17 00:00:00 2001 From: che_shuai <che_shuai@massclouds> Date: 星期一, 24 七月 2023 14:10:46 +0800 Subject: [PATCH] 修复在国标级联选择通道时,如果添加通道到跟平台根目录(即平台本身),无法触发目录变更事件问题.详见 https://github.com/648540858/wvp-GB28181-pro/issues/958 --- src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java | 43 ++++++++++++++++++++----------------------- 1 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java index f0baf9e..3cb4776 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java @@ -1,10 +1,7 @@ package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; -import com.genersoft.iot.vmp.gb28181.bean.GbStream; import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog; -import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream; -import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import org.apache.ibatis.annotations.*; import org.springframework.stereotype.Repository; @@ -15,42 +12,42 @@ @Repository public interface PlatformCatalogMapper { - @Insert("INSERT INTO platform_catalog (id, name, platformId, parentId, civilCode, businessGroupId) VALUES" + + @Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" + "(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})") int add(PlatformCatalog platformCatalog); - @Delete("DELETE FROM platform_catalog WHERE id=#{id}") - int del(String id); + @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}") + int del(String platformId, String id); - @Delete("DELETE FROM platform_catalog WHERE platformId=#{platformId}") + @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}") int delByPlatformId(String platformId); - @Select("SELECT pc.*, count(pc2.id) as childrenCount FROM platform_catalog pc " + - "left join platform_catalog pc2 on pc.id = pc2.parentId " + - "WHERE pc.parentId=#{parentId} AND pc.platformId=#{platformId} group by pc.id") + @Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " + + "left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " + + "WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " + + "group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id") List<PlatformCatalog> selectByParentId(String platformId, String parentId); - @Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id) as childrenCount FROM platform_catalog pc WHERE pc.id=#{id}") - PlatformCatalog select(String id); - @Update(value = {" <script>" + - "UPDATE platform_catalog " + + "UPDATE wvp_platform_catalog " + "SET name=#{name}" + - "WHERE id=#{id}"+ + "WHERE id=#{id} and platform_id=#{platformId}"+ "</script>"}) int update(PlatformCatalog platformCatalog); - @Select("SELECT *, (SELECT COUNT(1) from platform_catalog where parentId = pc.id) as childrenCount FROM platform_catalog pc WHERE pc.platformId=#{platformId}") + @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}") List<PlatformCatalog> selectByPlatForm(String platformId); - @Select("SELECT pc.* FROM platform_catalog pc WHERE pc.id = (SELECT pp.catalogId from parent_platform pp WHERE pp.serverGBId=#{platformId})") + @Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})") PlatformCatalog selectDefaultByPlatFormId(String platformId); - - @Select("SELECT pc.* FROM platform_catalog pc WHERE pc.id = #{id}") - PlatformCatalog selectParentCatalog(String id); - - @Select("SELECT pc.id as channelId, pc.name, pc.civilCode, pc.businessGroupId,'1' as parental, pc.parentId " + - " FROM platform_catalog pc WHERE pc.platformId=#{platformId}") + @Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " + + " from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}") List<DeviceChannel> queryCatalogInPlatform(String platformId); + + @Select("SELECT *, " + + "(SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count " + + " from wvp_platform_catalog pc " + + " WHERE pc.id=#{id} and pc.platform_id=#{platformId}") + PlatformCatalog selectByPlatFormAndCatalogId(String platformId, String id); } -- Gitblit v1.8.0