行政区划支持异常数据补充行政区划节点以及清理异常行政区划节点使通道可被挂载

This commit is contained in:
lin
2025-03-14 14:53:47 +08:00
parent d5dc0f9afd
commit 4dce850aea
12 changed files with 200 additions and 22 deletions

View File

@@ -307,6 +307,14 @@ public interface CommonGBChannelMapper {
" </script>"})
int removeCivilCodeByChannels(List<CommonGBChannel> channelList);
@Update(value = {" <script>" +
" UPDATE wvp_device_channel " +
" SET gb_civil_code = null, civil_code = null" +
" WHERE id in "+
" <foreach collection='channelIdList' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
" </script>"})
int removeCivilCodeByChannelIds(List<Integer> channelIdList);
@SelectProvider(type = ChannelProvider.class, method = "queryByCivilCode")
List<CommonGBChannel> queryByCivilCode(@Param("civilCode") String civilCode);
@@ -548,4 +556,7 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryListByCivilCodeForUnusual")
List<CommonGBChannel> queryListByCivilCodeForUnusual(@Param("query") String query, @Param("online") Boolean online, @Param("dataType")Integer dataType);
@SelectProvider(type = ChannelProvider.class, method = "queryAllForUnusual")
List<Integer> queryAllForUnusual();
}

View File

@@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.gb28181.dao;
import com.genersoft.iot.vmp.common.CivilCodePo;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.Region;
import com.genersoft.iot.vmp.gb28181.bean.RegionTree;
@@ -179,4 +180,12 @@ public interface RegionMapper {
" </script>")
Set<Region> queryNotShareRegionForPlatformByRegionList(Set<Region> allRegion, @Param("platformId") Integer platformId);
@Select(" <script>" +
" SELECT device_id " +
" from wvp_common_region" +
" where device_id in " +
" <foreach collection='civilCodePoList' item='item' open='(' separator=',' close=')' > #{item.code}</foreach>" +
" </script>")
Set<String> queryInCivilCodePoList(List<CivilCodePo> civilCodePoList);
}

View File

@@ -431,4 +431,13 @@ public class ChannelProvider {
}
return sqlBuild.toString();
}
public String queryAllForUnusual(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append("select wdc.id from wvp_device_channel wdc ");
sqlBuild.append(" left join (select wcr.device_id from wvp_common_region wcr) temp on temp.device_id = coalesce(wdc.gb_civil_code, wdc.civil_code)" +
" where coalesce(wdc.gb_civil_code, wdc.civil_code) is not null and temp.device_id is null ");
sqlBuild.append(" AND wdc.channel_type = 0 ");
return sqlBuild.toString();
}
}