支持展示行政区划节点异常的通道数据

This commit is contained in:
648540858
2025-03-13 23:12:39 +08:00
parent a05c2f8640
commit cbcd99da40
7 changed files with 295 additions and 0 deletions

View File

@@ -141,6 +141,25 @@ public class CommonChannelController {
return channelService.queryListByCivilCode(page, count, query, online, channelType, civilCode);
}
@Operation(summary = "存在行政区划但无法挂载的通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页查询数量", required = true)
@Parameter(name = "query", description = "查询内容")
@Parameter(name = "online", description = "是否在线")
@Parameter(name = "channelType", description = "通道类型, 0国标设备1推流设备2拉流代理")
@Parameter(name = "civilCode", description = "行政区划")
@GetMapping("/civilCode/unusual/list")
public PageInfo<CommonGBChannel> queryListByCivilCodeForUnusual(int page, int count,
@RequestParam(required = false) String query,
@RequestParam(required = false) Boolean online,
@RequestParam(required = false) Integer channelType){
if (ObjectUtils.isEmpty(query)){
query = null;
}
return channelService.queryListByCivilCodeForUnusual(page, count, query, online, channelType);
}
@Operation(summary = "获取关联业务分组通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页查询数量", required = true)

View File

@@ -544,4 +544,8 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryByDataId")
CommonGBChannel queryByDataId(@Param("dataType") Integer dataType, @Param("dataDeviceId") Integer dataDeviceId);
@SelectProvider(type = ChannelProvider.class, method = "queryListByCivilCodeForUnusual")
List<CommonGBChannel> queryListByCivilCodeForUnusual(@Param("query") String query, @Param("online") Boolean online, @Param("dataType")Integer dataType);
}

View File

@@ -53,6 +53,50 @@ public class ChannelProvider {
" coalesce(gb_svc_time_support_mode,svc_time_support_mode) as gb_svc_time_support_mode\n" +
" from wvp_device_channel\n"
;
public final static String BASE_SQL_TABLE_NAME = "select\n" +
" wdc.id as gb_id,\n" +
" wdc.data_type,\n" +
" wdc.data_device_id,\n" +
" wdc.create_time,\n" +
" wdc.update_time,\n" +
" wdc.record_plan_id,\n" +
" coalesce(wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
" coalesce(wdc.gb_name, wdc.name) as gb_name,\n" +
" coalesce(wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
" coalesce(wdc.gb_model, wdc.model) as gb_model,\n" +
" coalesce(wdc.gb_owner, wdc.owner) as gb_owner,\n" +
" coalesce(wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
" coalesce(wdc.gb_block, wdc.block) as gb_block,\n" +
" coalesce(wdc.gb_address, wdc.address) as gb_address,\n" +
" coalesce(wdc.gb_parental, wdc.parental) as gb_parental,\n" +
" coalesce(wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
" coalesce(wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
" coalesce(wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
" coalesce(wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
" coalesce(wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
" coalesce(wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
" coalesce(wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
" coalesce(wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
" coalesce(wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
" coalesce(wdc.gb_port, wdc.port) as gb_port,\n" +
" coalesce(wdc.gb_password, wdc.password) as gb_password,\n" +
" coalesce(wdc.gb_status, wdc.status) as gb_status,\n" +
" coalesce(wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
" coalesce(wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
" coalesce(wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
" coalesce(wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
" coalesce(wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
" coalesce(wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
" coalesce(wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
" coalesce(wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
" coalesce(wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
" coalesce(wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
" coalesce(wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
" coalesce(wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
" coalesce(wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
" from wvp_device_channel wdc\n"
;
private final static String BASE_SQL_FOR_PLATFORM =
"select\n" +
@@ -364,4 +408,27 @@ public class ChannelProvider {
sqlBuild.append(" where wpgc.platform_id = #{platformId} and coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) = #{civilCode}");
return sqlBuild.toString() ;
}
public String queryListByCivilCodeForUnusual(Map<String, Object> params ){
StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(BASE_SQL_TABLE_NAME);
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 ");
if (params.get("query") != null) {
sqlBuild.append(" AND (coalesce(wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') escape '/'" +
" OR coalesce(wdc.gb_name, wdc.name) LIKE concat('%',#{query},'%') escape '/' )")
;
}
if (params.get("online") != null && (Boolean)params.get("online")) {
sqlBuild.append(" AND coalesce(wdc.gb_status, wdc.status) = 'ON'");
}
if (params.get("online") != null && !(Boolean)params.get("online")) {
sqlBuild.append(" AND coalesce(wdc.gb_status, wdc.status) = 'OFF'");
}
if (params.get("dataType") != null) {
sqlBuild.append(" AND wdc.data_type = #{dataType}");
}
return sqlBuild.toString();
}
}

View File

@@ -90,4 +90,5 @@ public interface IGbChannelService {
void queryRecordInfo(CommonGBChannel channel, String startTime, String endTime, ErrorCallback<RecordInfo> callback);
PageInfo<CommonGBChannel> queryListByCivilCodeForUnusual(int page, int count, String query, Boolean online, Integer channelType);
}

View File

@@ -750,4 +750,16 @@ public class GbChannelServiceImpl implements IGbChannelService {
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
}
}
@Override
public PageInfo<CommonGBChannel> queryListByCivilCodeForUnusual(int page, int count, String query, Boolean online, Integer channelType) {
PageHelper.startPage(page, count);
if (query != null) {
query = query.replaceAll("/", "//")
.replaceAll("%", "/%")
.replaceAll("_", "/_");
}
List<CommonGBChannel> all = commonGBChannelMapper.queryListByCivilCodeForUnusual(query, online, channelType);
return new PageInfo<>(all);
}
}