增加通道关联以及录制计划接口完善

This commit is contained in:
648540858
2024-11-21 23:20:56 +08:00
parent 4b694954d4
commit 1567f2e3e7
13 changed files with 899 additions and 159 deletions

View File

@@ -459,4 +459,93 @@ public interface CommonGBChannelMapper {
@SelectProvider(type = ChannelProvider.class, method = "queryList")
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online, @Param("hasRecordPlan") Boolean hasRecordPlan, @Param("channelType") Integer channelType);
@Update(value = {" <script>" +
" UPDATE wvp_device_channel " +
" SET record_plan_id = null" +
" WHERE id in "+
" <foreach collection='channelIds' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
" </script>"})
void removeRecordPlan(List<Integer> channelIds);
@Update(value = {" <script>" +
" UPDATE wvp_device_channel " +
" SET record_plan_id = #{planId}" +
" WHERE id in "+
" <foreach collection='channelIds' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
" </script>"})
void addRecordPlan(List<Integer> channelIds, @Param("planId") Integer planId);
@Update(value = {" <script>" +
" UPDATE wvp_device_channel " +
" SET record_plan_id = #{planId}" +
" </script>"})
void addRecordPlanForAll(@Param("planId") Integer planId);
@Update(value = {" <script>" +
" UPDATE wvp_device_channel " +
" SET record_plan_id = null" +
" WHERE record_plan_id = #{planId} "+
" </script>"})
void removeRecordPlanByPlanId( @Param("planId") Integer planId);
@Select("<script>" +
" select " +
" wdc.id as gb_id,\n" +
" wdc.device_db_id as gb_device_db_id,\n" +
" wdc.stream_push_id,\n" +
" wdc.stream_proxy_id,\n" +
" wdc.create_time,\n" +
" wdc.update_time,\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" +
" where wdc.channel_type = 0 " +
" <if test='query != null'> " +
" 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> " +
" <if test='online == true'> AND coalesce(wdc.gb_status, wdc.status) = 'ON'</if> " +
" <if test='online == false'> AND coalesce(wdc.gb_status, wdc.status) = 'OFF'</if> " +
" <if test='hasLink == true'> AND wdc.record_plan_id = #{planId}</if> " +
" <if test='hasLink == false'> AND wdc.record_plan_id is null</if> " +
" <if test='channelType == 0'> AND wdc.device_db_id is not null</if> " +
" <if test='channelType == 1'> AND wdc.stream_push_id is not null</if> " +
" <if test='channelType == 2'> AND wdc.stream_proxy_id is not null</if> " +
"</script>")
List<CommonGBChannel> queryForRecordPlanForWebList(@Param("planId") Integer planId, @Param("query") String query,
@Param("channelType") Integer channelType, @Param("online") Boolean online,
@Param("hasLink") Boolean hasLink);
}

View File

@@ -93,8 +93,9 @@ 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 = #{deviceDbId}")
List<Integer> queryChaneIdListByDeviceDbId(@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>")
List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbIds);
@Delete("DELETE FROM wvp_device_channel WHERE device_db_id=#{deviceId}")
int cleanChannelsByDeviceId(@Param("deviceId") int deviceId);

View File

@@ -124,5 +124,5 @@ public interface IDeviceChannelService {
List<DeviceChannel> queryChaneListByDeviceDbId(Integer deviceDbId);
List<Integer> queryChaneIdListByDeviceDbId(Integer deviceDbId);
List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbId);
}

View File

@@ -356,8 +356,8 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
}
@Override
public List<Integer> queryChaneIdListByDeviceDbId(Integer deviceDbId) {
return channelMapper.queryChaneIdListByDeviceDbId(deviceDbId);
public List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbIds) {
return channelMapper.queryChaneIdListByDeviceDbIds(deviceDbIds);
}
@Override

View File

@@ -55,6 +55,11 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
@Override
public PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer platformId, Boolean hasShare) {
PageHelper.startPage(page, count);
if (query != null) {
query = query.replaceAll("/", "//")
.replaceAll("%", "/%")
.replaceAll("_", "/_");
}
List<PlatformChannel> all = platformChannelMapper.queryForPlatformForWebList(platformId, query, channelType, online, hasShare);
return new PageInfo<>(all);
}