[录制计划] 修复关联通道

This commit is contained in:
648540858
2024-11-27 17:59:54 +08:00
parent d3f53db160
commit 24c3c45565
7 changed files with 75 additions and 221 deletions

View File

@@ -20,6 +20,7 @@ public class CatalogData {
private Device device;
private String errorMsg;
private Set<String> redisKeysForChannel = new HashSet<>();
private Set<String> errorChannel = new HashSet<>();
private Set<String> redisKeysForRegion = new HashSet<>();
private Set<String> redisKeysForGroup = new HashSet<>();

View File

@@ -93,8 +93,10 @@ public interface DeviceChannelMapper {
@SelectProvider(type = DeviceChannelProvider.class, method = "queryChannelsByDeviceDbId")
List<DeviceChannel> queryChannelsByDeviceDbId(@Param("deviceDbId") int deviceDbId);
@Select("select id from wvp_device_channel where device_db_id in " +
" <foreach item='item' index='index' collection='deviceDbIds' open='(' separator=',' close=')'> #{item} </foreach> </if>")
@Select(value = {" <script> " +
"select id from wvp_device_channel where device_db_id in " +
" <foreach item='item' index='index' collection='deviceDbIds' open='(' separator=',' close=')'> #{item} </foreach>" +
" </script>"})
List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbIds);
@Delete("DELETE FROM wvp_device_channel WHERE device_db_id=#{deviceId}")

View File

@@ -283,7 +283,7 @@ public class CatalogDataManager implements CommandLineRunner {
if (catalogData == null) {
return 0;
}
return catalogData.getRedisKeysForChannel().size();
return catalogData.getRedisKeysForChannel().size() + catalogData.getErrorChannel().size();
}
public int sumNum(String deviceId, int sn) {