临时提交

pull/1642/head
648540858 2024-07-08 17:44:35 +08:00
parent 7b7512f84d
commit 4912ce16ec
8 changed files with 317 additions and 123 deletions

View File

@ -203,101 +203,276 @@ public interface CommonGBChannelMapper {
" where id = #{gbId}")
CommonGBChannel queryById(@Param("gbId") int gbId);
@Delete("delete from wvp_device_channel where id = #{gbId} ")
@Delete(value = {"delete from wvp_device_channel where id = #{gbId} "})
void delete(int gbId);
@Update(value = {" <script>" +
"UPDATE wvp_device_channel " +
"SET update_time=#{updateTime}" +
"<if test='streamPushId != null'>, stream_push_id = #{streamPushId}" +
"<if test='streamPushId == null'>, stream_push_id = null" +
"<if test='streamProxyId != null'>, stream_proxy_id = #{streamProxyId}" +
"<if test='streamProxyId == null'>, stream_proxy_id = null" +
"<if test='subCount != null'>, sub_count = #{subCount}" +
"<if test='subCount == null'>, sub_count = null" +
"<if test='streamId != null'>, stream_id = #{streamId}" +
"<if test='streamId == null'>, stream_id = null" +
"<if test='hasAudio != null'>, has_audio = #{hasAudio}" +
"<if test='hasAudio == null'>, has_audio = null" +
"<if test='gpsTime != null'>, gps_time = #{gpsTime}" +
"<if test='gpsTime == null'>, gps_time = null" +
"<if test='streamIdentification != null'>, stream_identification = #{streamIdentification}" +
"<if test='streamIdentification == null'>, stream_identification = null" +
"<if test='gbDeviceId != null'>, gb_device_id = #{gbDeviceId}" +
"<if test='gbDeviceId == null'>, gb_device_id = null" +
"<if test='gbName != null'>, gb_name = #{gbName}" +
"<if test='gbName == null'>, gb_name = null" +
"<if test='gbManufacturer != null'>, gb_manufacturer = #{gbManufacturer}" +
"<if test='gbManufacturer == null'>, gb_manufacturer = null" +
"<if test='gbModel != null'>, gb_model = #{gbModel}" +
"<if test='gbModel == null'>, gb_model = null" +
"<if test='gbOwner != null' >, gb_owner = #{gbOwner}" +
"<if test='gbOwner == null'>, gb_owner = null" +
"<if test='gbCivilCode, != null' >, gb_civil_code = #{gbCivilCode}" +
"<if test='gbCivilCode, == null'>, gb_civil_code = null" +
"<if test='gbBlock != null' >, gb_block = #{gbBlock}" +
"<if test='gbBlock == null'>, gb_block = null" +
"<if test='gbAddress != null' >, gb_address = #{gbAddress}" +
"<if test='gbAddress == null'>, gb_address = null" +
"<if test='gbParental != null' >, gb_parental = #{gbParental}" +
"<if test='gbParental == null'>, gb_parental = null" +
"<if test='gbParentId != null' >, gb_parent_id = #{gbParentId}" +
"<if test='gbParentId == null'>, gb_parent_id = null" +
"<if test='gbSafetyWay != null' >, gb_safety_way = #{gbSafetyWay}" +
"<if test='gbSafetyWay == null'>, gb_safety_way = null" +
"<if test='gbRegisterWay != null' >, gb_register_way = #{gbRegisterWay}" +
"<if test='gbRegisterWay == null'>, gb_register_way = null" +
"<if test='gbCertNum != null' >, gb_cert_num = #{gbCertNum}" +
"<if test='gbCertNum == null'>, gb_cert_num = null" +
"<if test='gbCertifiable != null' >, gb_certifiable = #{gbCertifiable}" +
"<if test='gbCertifiable == null'>, gb_certifiable = null" +
"<if test='gbErrCode != null' >, gb_err_code = #{gbErrCode}" +
"<if test='gbErrCode == null'>, gb_err_code = null" +
"<if test='gbEndTime != null' >, gb_end_time = #{gbEndTime}" +
"<if test='gbEndTime == null'>, gb_end_time = null" +
"<if test='gbSecrecy != null' >, gb_secrecy = #{gbSecrecy}" +
"<if test='gbSecrecy == null'>, gb_secrecy = null" +
"<if test='gbIpAddress != null' >, gb_ip_address = #{gbIpAddress}" +
"<if test='gbIpAddress == null'>, gb_ip_address = null" +
"<if test='gbPort != null' >, gb_ip_address = #{gbPort}" +
"<if test='gbPort == null'>, gb_port = null" +
"<if test='gbPassword != null' >, gb_password = #{gbPassword}" +
"<if test='gbPassword == null'>, gb_password = null" +
"<if test='gbStatus != null' >, gb_status = #{gbStatus}" +
"<if test='gbStatus == null'>, gb_status = null" +
"<if test='gbLongitude != null' >, gb_longitude = #{gbLongitude}" +
"<if test='gbLongitude == null'>, gb_longitude = null" +
"<if test='gbLatitude != null' >, gb_latitude = #{gbLatitude}" +
"<if test='gbLatitude == null'>, gb_latitude = null" +
"<if test='gbPtzType != null' >, gb_ptz_type = #{gbPtzType}" +
"<if test='gbPtzType == null'>, gb_ptz_type = null" +
"<if test='gbPositionType != null' >, gb_position_type = #{gbPositionType}" +
"<if test='gbPositionType == null'>, gb_position_type = null" +
"<if test='gbRoomType != null' >, gb_room_type = #{gbRoomType}" +
"<if test='gbRoomType == null'>, gb_room_type = null" +
"<if test='gbUseType != null' >, gb_use_type = #{gbUseType}" +
"<if test='gbUseType == null'>, gb_use_type = null" +
"<if test='gbSupplyLightType != null' >, gb_supply_light_type = #{gbSupplyLightType}" +
"<if test='gbSupplyLightType == null'>, gb_supply_light_type = null" +
"<if test='gbDirectionType != null' >, gb_direction_type = #{gbDirectionType}" +
"<if test='gbDirectionType == null'>, gb_direction_type = null" +
"<if test='gbResolution != null' >, gb_resolution = #{gbResolution}" +
"<if test='gbResolution == null'>, gb_resolution = null" +
"<if test='gbBusinessGroupId != null' >, gb_business_group_id = #{gbBusinessGroupId}" +
"<if test='gbBusinessGroupId == null'>, gb_business_group_id = null" +
"<if test='gbDownloadSpeed != null' >, gb_download_speed = #{gbDownloadSpeed}" +
"<if test='gbDownloadSpeed == null'>, gb_download_speed = null" +
"<if test='gbSvcSpaceSupportMod != null' >, gb_svc_space_support_mod = #{gbSvcSpaceSupportMod}" +
"<if test='gbSvcSpaceSupportMod == null'>, gb_svc_space_support_mod = null" +
"<if test='gbSvcTimeSupportMode != null' >, gb_svc_time_support_mode = #{gbSvcTimeSupportMode}" +
"<if test='gbSvcTimeSupportMode == null'>, gb_svc_time_support_mode = null" +
"<if test='streamPushId != null'>, stream_push_id = #{streamPushId}</if>" +
"<if test='streamPushId == null'>, stream_push_id = null</if>" +
"<if test='streamProxyId != null'>, stream_proxy_id = #{streamProxyId}</if>" +
"<if test='streamProxyId == null'>, stream_proxy_id = null</if>" +
"<if test='subCount != null'>, sub_count = #{subCount}</if>" +
"<if test='subCount == null'>, sub_count = null</if>" +
"<if test='streamId != null'>, stream_id = #{streamId}</if>" +
"<if test='streamId == null'>, stream_id = null</if>" +
"<if test='hasAudio != null'>, has_audio = #{hasAudio}</if>" +
"<if test='hasAudio == null'>, has_audio = null</if>" +
"<if test='gpsTime != null'>, gps_time = #{gpsTime}</if>" +
"<if test='gpsTime == null'>, gps_time = null</if>" +
"<if test='streamIdentification != null'>, stream_identification = #{streamIdentification}</if>" +
"<if test='streamIdentification == null'>, stream_identification = null</if>" +
"<if test='gbDeviceId != null'>, gb_device_id = #{gbDeviceId}</if>" +
"<if test='gbDeviceId == null'>, gb_device_id = null</if>" +
"<if test='gbName != null'>, gb_name = #{gbName}</if>" +
"<if test='gbName == null'>, gb_name = null</if>" +
"<if test='gbManufacturer != null'>, gb_manufacturer = #{gbManufacturer}</if>" +
"<if test='gbManufacturer == null'>, gb_manufacturer = null</if>" +
"<if test='gbModel != null'>, gb_model = #{gbModel}</if>" +
"<if test='gbModel == null'>, gb_model = null</if>" +
"<if test='gbOwner != null' >, gb_owner = #{gbOwner}</if>" +
"<if test='gbOwner == null'>, gb_owner = null</if>" +
"<if test='gbCivilCode, != null' >, gb_civil_code = #{gbCivilCode}</if>" +
"<if test='gbCivilCode, == null'>, gb_civil_code = null</if>" +
"<if test='gbBlock != null' >, gb_block = #{gbBlock}</if>" +
"<if test='gbBlock == null'>, gb_block = null</if>" +
"<if test='gbAddress != null' >, gb_address = #{gbAddress}</if>" +
"<if test='gbAddress == null'>, gb_address = null</if>" +
"<if test='gbParental != null' >, gb_parental = #{gbParental}</if>" +
"<if test='gbParental == null'>, gb_parental = null</if>" +
"<if test='gbParentId != null' >, gb_parent_id = #{gbParentId}</if>" +
"<if test='gbParentId == null'>, gb_parent_id = null</if>" +
"<if test='gbSafetyWay != null' >, gb_safety_way = #{gbSafetyWay}</if>" +
"<if test='gbSafetyWay == null'>, gb_safety_way = null</if>" +
"<if test='gbRegisterWay != null' >, gb_register_way = #{gbRegisterWay}</if>" +
"<if test='gbRegisterWay == null'>, gb_register_way = null</if>" +
"<if test='gbCertNum != null' >, gb_cert_num = #{gbCertNum}</if>" +
"<if test='gbCertNum == null'>, gb_cert_num = null</if>" +
"<if test='gbCertifiable != null' >, gb_certifiable = #{gbCertifiable}</if>" +
"<if test='gbCertifiable == null'>, gb_certifiable = null</if>" +
"<if test='gbErrCode != null' >, gb_err_code = #{gbErrCode}</if>" +
"<if test='gbErrCode == null'>, gb_err_code = null</if>" +
"<if test='gbEndTime != null' >, gb_end_time = #{gbEndTime}</if>" +
"<if test='gbEndTime == null'>, gb_end_time = null</if>" +
"<if test='gbSecrecy != null' >, gb_secrecy = #{gbSecrecy}</if>" +
"<if test='gbSecrecy == null'>, gb_secrecy = null</if>" +
"<if test='gbIpAddress != null' >, gb_ip_address = #{gbIpAddress}</if>" +
"<if test='gbIpAddress == null'>, gb_ip_address = null</if>" +
"<if test='gbPort != null' >, gb_ip_address = #{gbPort}</if>" +
"<if test='gbPort == null'>, gb_port = null</if>" +
"<if test='gbPassword != null' >, gb_password = #{gbPassword}</if>" +
"<if test='gbPassword == null'>, gb_password = null</if>" +
"<if test='gbStatus != null' >, gb_status = #{gbStatus}</if>" +
"<if test='gbStatus == null'>, gb_status = null</if>" +
"<if test='gbLongitude != null' >, gb_longitude = #{gbLongitude}</if>" +
"<if test='gbLongitude == null'>, gb_longitude = null</if>" +
"<if test='gbLatitude != null' >, gb_latitude = #{gbLatitude}</if>" +
"<if test='gbLatitude == null'>, gb_latitude = null</if>" +
"<if test='gbPtzType != null' >, gb_ptz_type = #{gbPtzType}</if>" +
"<if test='gbPtzType == null'>, gb_ptz_type = null</if>" +
"<if test='gbPositionType != null' >, gb_position_type = #{gbPositionType}</if>" +
"<if test='gbPositionType == null'>, gb_position_type = null</if>" +
"<if test='gbRoomType != null' >, gb_room_type = #{gbRoomType}</if>" +
"<if test='gbRoomType == null'>, gb_room_type = null</if>" +
"<if test='gbUseType != null' >, gb_use_type = #{gbUseType}</if>" +
"<if test='gbUseType == null'>, gb_use_type = null</if>" +
"<if test='gbSupplyLightType != null' >, gb_supply_light_type = #{gbSupplyLightType}</if>" +
"<if test='gbSupplyLightType == null'>, gb_supply_light_type = null</if>" +
"<if test='gbDirectionType != null' >, gb_direction_type = #{gbDirectionType}</if>" +
"<if test='gbDirectionType == null'>, gb_direction_type = null</if>" +
"<if test='gbResolution != null' >, gb_resolution = #{gbResolution}</if>" +
"<if test='gbResolution == null'>, gb_resolution = null</if>" +
"<if test='gbBusinessGroupId != null' >, gb_business_group_id = #{gbBusinessGroupId}</if>" +
"<if test='gbBusinessGroupId == null'>, gb_business_group_id = null</if>" +
"<if test='gbDownloadSpeed != null' >, gb_download_speed = #{gbDownloadSpeed}</if>" +
"<if test='gbDownloadSpeed == null'>, gb_download_speed = null</if>" +
"<if test='gbSvcSpaceSupportMod != null' >, gb_svc_space_support_mod = #{gbSvcSpaceSupportMod}</if>" +
"<if test='gbSvcSpaceSupportMod == null'>, gb_svc_space_support_mod = null</if>" +
"<if test='gbSvcTimeSupportMode != null' >, gb_svc_time_support_mode = #{gbSvcTimeSupportMode}</if>" +
"<if test='gbSvcTimeSupportMode == null'>, gb_svc_time_support_mode = null</if>" +
"WHERE id = #{gbId}"+
" </script>"})
int update(CommonGBChannel commonGBChannel);
int updateStatus(@Param("gbId") int gbId, @Param("status") int status);
@Update(value = {" <script>" +
"UPDATE wvp_device_channel " +
"SET gb_status = #{gbStatus}" +
"WHERE id = #{gbId}"+
" </script>"})
int updateStatusById(@Param("gbId") int gbId, @Param("status") int status);
int updateStatusForList(List<CommonGBChannel> commonGBChannels, @Param("status") int status);
@Update("<script> " +
"<foreach collection='commonGBChannels' index='index' item='item' separator=';'> " +
"UPDATE wvp_device_channel SET gb_status = #{gbStatus} WHERE id = #{item.gbId}" +
"</foreach> " +
"</script>")
int updateStatusForListById(List<CommonGBChannel> commonGBChannels, @Param("status") int status);
@Select(value = {" <script>" +
" select\n" +
" id as gb_id,\n" +
" device_db_id,\n" +
" stream_push_id,\n" +
" stream_proxy_id,\n" +
" create_time,\n" +
" update_time,\n" +
" sub_count,\n" +
" stream_id,\n" +
" has_audio,\n" +
" gps_time,\n" +
" stream_identification,\n" +
" coalesce(gb_device_id, device_id) as gb_device_id,\n" +
" coalesce(gb_name, name) as gb_name,\n" +
" coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
" coalesce(gb_model, model) as gb_model,\n" +
" coalesce(gb_owner, owner) as gb_owner,\n" +
" coalesce(gb_civil_code, civil_code) as gb_civil_code,\n" +
" coalesce(gb_block, block) as gb_block,\n" +
" coalesce(gb_address, address) as gb_address,\n" +
" coalesce(gb_parental, parental) as gb_parental,\n" +
" coalesce(gb_parent_id, parent_id) as gb_parent_id,\n" +
" coalesce(gb_safety_way, safety_way) as gb_safety_way,\n" +
" coalesce(gb_register_way, register_way) as gb_register_way,\n" +
" coalesce(gb_cert_num, cert_num) as gb_cert_num,\n" +
" coalesce(gb_certifiable, certifiable) as gb_certifiable,\n" +
" coalesce(gb_err_code, err_code) as gb_err_code,\n" +
" coalesce(gb_end_time, end_time) as gb_end_time,\n" +
" coalesce(gb_secrecy, secrecy) as gb_secrecy,\n" +
" coalesce(gb_ip_address, ip_address) as gb_ip_address,\n" +
" coalesce(gb_port, port) as gb_port,\n" +
" coalesce(gb_password, password) as gb_password,\n" +
" coalesce(gb_status, status) as gb_status,\n" +
" coalesce(gb_longitude, longitude) as gb_longitude,\n" +
" coalesce(gb_latitude, latitude) as gb_latitude,\n" +
" coalesce(gb_ptz_type, ptz_type) as gb_ptz_type,\n" +
" coalesce(gb_position_type, position_type) as gb_position_type,\n" +
" coalesce(gb_room_type, room_type) as gb_room_type,\n" +
" coalesce(gb_use_type, use_type) as gb_use_type,\n" +
" coalesce(gb_supply_light_type, supply_light_type) as gb_supply_light_type,\n" +
" coalesce(gb_direction_type, direction_type) as gb_direction_type,\n" +
" coalesce(gb_resolution, resolution) as gb_resolution,\n" +
" coalesce(gb_business_group_id, business_group_id) as gb_business_group_id,\n" +
" coalesce(gb_download_speed, download_speed) as gb_download_speed,\n" +
" coalesce(gb_svc_space_support_mod, svc_space_support_mod) as gb_svc_space_support_mod,\n" +
" coalesce(gb_svc_time_support_mode svc_time_support_mode) as gb_svc_time_support_mode\n" +
" from wvp_device_channel" +
" where gb_status=#{status} and id in " +
" <foreach collection='commonGBChannelList' item='item' open='(' separator=',' close=')' > #{item.gbId}</foreach>" +
"</script>"})
List<CommonGBChannel> queryInListByStatus(List<CommonGBChannel> commonGBChannelList, @Param("status") int status);
@Insert(" <script>" +
"INSERT INTO wvp_device_channel (" +
"gb_device_id," +
"stream_proxy_id, " +
"stream_push_id," +
"create_time," +
"update_time," +
"sub_count," +
"stream_id," +
"has_audio," +
"gps_time," +
"stream_identification," +
"gb_name," +
"gb_manufacturer," +
"gb_model," +
"gb_owner," +
"gb_civil_code," +
"gb_block," +
"gb_address," +
"gb_parental," +
"gb_parent_id ," +
"gb_safety_way," +
"gb_register_way," +
"gb_cert_num," +
"gb_certifiable," +
"gb_err_code," +
"gb_end_time," +
"gb_secrecy," +
"gb_ip_address," +
"gb_port," +
"gb_password," +
"gb_status," +
"gb_longitude," +
"gb_latitude," +
"gb_ptz_type," +
"gb_position_type," +
"gb_room_type," +
"gb_use_type," +
"gb_supply_light_type," +
"gb_direction_type," +
"gb_resolution," +
"gb_business_group_id," +
"gb_download_speed," +
"gb_svc_space_support_mod," +
"gb_svc_time_support_mode ) " +
"VALUES" +
"<foreach collection='commonGBChannels' index='index' item='item' separator=','> " +
"(#{item.gbDeviceId}, #{item.streamProxyId}, #{item.streamPushId},#{item.createTime},#{item.updateTime},#{item.subCount}," +
"#{item.streamId},#{item.hasAudio},#{item.gpsTime},#{item.streamIdentification},#{item.gbName},#{item.gbManufacturer}, #{item.gbModel}," +
"#{item.gbOwner},#{item.gbCivilCode},#{item.gbBlock}, #{item.gbAddress}, #{item.gbParental}, #{item.gbParentId},#{item.gbSafetyWay}, " +
"#{item.gbRegisterWay},#{item.gbCertNum},#{item.gbCertifiable},#{item.gbErrCode},#{item.gbEndTime}, #{item.gbSecrecy},#{item.gbIpAddress}," +
"#{item.gbPort},#{item.gbPassword},#{item.gbStatus},#{item.gbLongitude}, #{item.gbLatitude},#{item.gbPtzType},#{item.gbPositionType},#{item.gbRoomType}," +
"#{item.gbUseType},#{item.gbSupplyLightType},#{item.gbDirectionType},#{item.gbResolution},#{item.gbBusinessGroupId},#{item.gbDownloadSpeed}," +
"#{item.gbSvcSpaceSupportMod},#{item.gbSvcTimeSupportMode})" +
"</foreach> " +
" </script>")
int batchAdd(List<CommonGBChannel> commonGBChannels);
@Update("<script> " +
"<foreach collection='commonGBChannels' index='index' item='item' separator=';'> " +
"UPDATE wvp_device_channel SET gb_status = #{item.gbStatus} WHERE id = #{item.gbId}" +
"</foreach> " +
"</script>")
int updateStatus(List<CommonGBChannel> commonGBChannels);
@Select(value = {"select\n" +
" wdc.id as gb_id,\n" +
" wdc.device_db_id,\n" +
" wdc.create_time,\n" +
" wdc.update_time,\n" +
" wdc.sub_count,\n" +
" wdc.stream_id,\n" +
" wdc.has_audio,\n" +
" wdc.gps_time,\n" +
" wdc.stream_identification,\n" +
" coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
" coalesce(wpgc.name, 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(wpgc.civil_code, 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(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
" coalesce(wpgc.parent_id, 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(wpgc.business_group_id, 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 left join wvp_platform_gb_channel wpgc on wdc.id = wpgc.device_channel_id\n" +
"where wpgc.platform_id = #{platformId}"})
List<CommonGBChannel> queryByPlatformId(@Param("platformId") Integer platformId);
}

View File

@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
@Slf4j
@ -72,7 +71,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
log.warn("[通道离线] 未找到数据库ID更新失败 {}", commonGBChannel.getGbDeviceDbId());
return 0;
}
int result = commonGBChannelMapper.updateStatus(commonGBChannel.getGbId(), 0);
int result = commonGBChannelMapper.updateStatusById(commonGBChannel.getGbId(), 0);
if (result > 0) {
try {
// 发送通知
@ -104,10 +103,10 @@ public class GbChannelServiceImpl implements IGbChannelService {
if (i + limitCount > onlineChannelList.size()) {
toIndex = onlineChannelList.size();
}
result += commonGBChannelMapper.updateStatusForList(onlineChannelList.subList(i, toIndex), 0);
result += commonGBChannelMapper.updateStatusForListById(onlineChannelList.subList(i, toIndex), 0);
}
}else {
result += commonGBChannelMapper.updateStatusForList(onlineChannelList, 0);
result += commonGBChannelMapper.updateStatusForListById(onlineChannelList, 0);
}
if (result > 0) {
try {
@ -126,7 +125,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
log.warn("[通道上线] 未找到数据库ID更新失败 {}", commonGBChannel.getGbDeviceDbId());
return 0;
}
int result = commonGBChannelMapper.updateStatus(commonGBChannel.getGbId(), 1);
int result = commonGBChannelMapper.updateStatusById(commonGBChannel.getGbId(), 1);
if (result > 0) {
try {
// 发送通知
@ -159,10 +158,10 @@ public class GbChannelServiceImpl implements IGbChannelService {
if (i + limitCount > offlineChannelList.size()) {
toIndex = offlineChannelList.size();
}
result += commonGBChannelMapper.updateStatusForList(offlineChannelList.subList(i, toIndex), 1);
result += commonGBChannelMapper.updateStatusForListById(offlineChannelList.subList(i, toIndex), 1);
}
}else {
result += commonGBChannelMapper.updateStatusForList(offlineChannelList, 1);
result += commonGBChannelMapper.updateStatusForListById(offlineChannelList, 1);
}
if (result > 0) {
try {
@ -177,29 +176,55 @@ public class GbChannelServiceImpl implements IGbChannelService {
}
@Override
@Transactional
public void batchAdd(List<CommonGBChannel> commonGBChannels) {
if (commonGBChannels.isEmpty()) {
log.warn("[新增多个通道] 通道数量为0更新失败");
return;
}
// 批量保存
int limitCount = 1000;
int result = 0;
if (commonGBChannels.size() > limitCount) {
for (int i = 0; i < commonGBChannels.size(); i += limitCount) {
int toIndex = i + limitCount;
if (i + limitCount > commonGBChannels.size()) {
toIndex = commonGBChannels.size();
}
result += commonGBChannelMapper.batchAdd(commonGBChannels.subList(i, toIndex));
}
}else {
result += commonGBChannelMapper.batchAdd(commonGBChannels);
}
log.warn("[新增多个通道] 通道数量为{},成功保存:{}", commonGBChannels.size(), result);
}
@Override
@Transactional
public void updateStatus(List<CommonGBChannel> channelList) {
if (channelList.isEmpty()) {
public void updateStatus(List<CommonGBChannel> commonGBChannels) {
if (commonGBChannels.isEmpty()) {
log.warn("[更新多个通道状态] 通道数量为0更新失败");
return;
}
for (CommonGBChannel channel : channelList) {
if (channel.getGbStatus() == 1) {
online(channel);
}else {
offline(channel);
int limitCount = 1000;
int result = 0;
if (commonGBChannels.size() > limitCount) {
for (int i = 0; i < commonGBChannels.size(); i += limitCount) {
int toIndex = i + limitCount;
if (i + limitCount > commonGBChannels.size()) {
toIndex = commonGBChannels.size();
}
result += commonGBChannelMapper.updateStatus(commonGBChannels.subList(i, toIndex));
}
}else {
result += commonGBChannelMapper.updateStatus(commonGBChannels);
}
log.warn("[更新多个通道状态] 通道数量为{},成功保存:{}", commonGBChannels.size(), result);
}
@Override
public List<CommonGBChannel> queryByPlatformId(Integer platformId) {
return Collections.emptyList();
return commonGBChannelMapper.queryByPlatformId(platformId);
}
}

View File

@ -165,10 +165,6 @@ public class PlatformServiceImpl implements IPlatformService {
// 每次发送目录的数量默认为1
parentPlatform.setCatalogGroup(1);
}
if (parentPlatform.getAdministrativeDivision() == null) {
// 行政区划默认去编号的前6位
parentPlatform.setAdministrativeDivision(parentPlatform.getServerGBId().substring(0,6));
}
parentPlatform.setCatalogId(parentPlatform.getDeviceGBId());
int result = platformMapper.addParentPlatform(parentPlatform);
// 添加缓存
@ -221,9 +217,6 @@ public class PlatformServiceImpl implements IPlatformService {
if (parentPlatform.getCatalogGroup() == 0) {
parentPlatform.setCatalogGroup(1);
}
if (parentPlatform.getAdministrativeDivision() == null) {
parentPlatform.setAdministrativeDivision(parentPlatform.getAdministrativeDivision());
}
platformMapper.updateParentPlatform(parentPlatform);
// 更新redis

View File

@ -203,9 +203,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
if (parentPlatform.getCatalogGroup() == 0) {
parentPlatform.setCatalogGroup(1);
}
if (parentPlatform.getAdministrativeDivision() == null) {
parentPlatform.setAdministrativeDivision(parentPlatform.getAdministrativeDivision());
}
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
if (parentPlatform.getId() == null ) {
if (parentPlatform.getCatalogId() == null) {

View File

@ -317,8 +317,8 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|| streamInfo.getOriginType() == OriginType.FFMPEG_PULL.ordinal() ) {
if (streamProxyMapForDb.get(key) != null) {
redisCatchStorage.addStream(mediaServer, "pull", streamInfo.getApp(), streamInfo.getStream(), streamInfo.getMediaInfo());
if (!streamProxy.getGbStatus() && streamProxy.getGbId() > 0) {
streamProxy.setGbStatus(true);
if (streamProxy.getGbStatus() == 1 && streamProxy.getGbId() > 0) {
streamProxy.setGbStatus(1);
channelListForOnline.add(streamProxy.getCommonGBChannel());
}
streamProxyMapForDb.remove(key);
@ -333,8 +333,8 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
List<StreamProxy> streamProxiesForRemove = new ArrayList<>();
if (!streamProxyMapForDb.isEmpty()) {
for (StreamProxy streamProxy : streamProxyMapForDb.values()) {
if (streamProxy.getGbStatus() && streamProxy.getGbId() > 0) {
streamProxy.setGbStatus(false);
if (streamProxy.getGbStatus() == 0 && streamProxy.getGbId() > 0) {
streamProxy.setGbStatus(0);
channelListForOffline.add(streamProxy.getCommonGBChannel());
}
// 移除开启了无人观看自动移除的流
@ -375,13 +375,13 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
List<CommonGBChannel> channelListForOffline = new ArrayList<>();
for (StreamProxy streamProxy : streamProxies) {
if (streamProxy.getGbId() > 0 && streamProxy.getGbStatus()) {
if (streamProxy.getGbId() > 0 && streamProxy.getGbStatus() == 1) {
channelListForOffline.add(streamProxy.getCommonGBChannel());
}
if (streamProxy.getGbId() == 0 && streamProxy.isEnableRemoveNoneReader()) {
streamProxiesForRemove.add(streamProxy);
}
if (streamProxy.getGbStatus()) {
if (streamProxy.getGbStatus() == 1) {
streamProxiesForSendMessage.add(streamProxy);
}
}
@ -411,7 +411,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
if (streamProxyItem == null) {
return 0;
}
streamProxyItem.setGbStatus(status);
streamProxyItem.setGbStatus(status?1:0);
if (streamProxyItem.getGbId() > 0) {
if (status) {
gbChannelService.online(streamProxyItem.getCommonGBChannel());

View File

@ -239,7 +239,7 @@ public class StreamPushController {
if (ObjectUtils.isEmpty(stream.getApp()) && ObjectUtils.isEmpty(stream.getStream())) {
throw new ControllerException(ErrorCode.ERROR400.getCode(), "app或stream不可为空");
}
stream.setGbStatus(false);
stream.setGbStatus(0);
stream.setPushIng(false);
if (!streamPushService.add(stream)) {
throw new ControllerException(ErrorCode.ERROR100);

View File

@ -104,7 +104,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
streamPush.setApp(streamPushExcelDto.getApp());
streamPush.setStream(streamPushExcelDto.getStream());
streamPush.setGbDeviceId(streamPushExcelDto.getGbId());
streamPush.setGbStatus(streamPushExcelDto.isStatus());
streamPush.setGbStatus(streamPushExcelDto.isStatus()?1:0);
streamPush.setCreateTime(DateUtil.getNow());
streamPush.setMediaServerId(defaultMediaServerId);
streamPush.setGbName(streamPushExcelDto.getName());

View File

@ -195,7 +195,8 @@ create table wvp_device_channel (
gb_industrial_classification character varying(255),
stream_push_id integer,
stream_proxy_id integer,
constraint uk_wvp_device_channel_unique_device_channel unique (device_db_id, device_id)
constraint uk_wvp_device_channel_unique_device_channel unique (device_db_id, device_id),
constraint uk_wvp_unique_channel unique (gb_device_id)
);
create table wvp_media_server (
@ -273,7 +274,10 @@ create table wvp_platform_gb_channel (
name character varying(255),
civil_code character varying(50),
business_group_id character varying(50),
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, device_channel_id)
parental integer,
parent_id character varying(255),
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, device_channel_id),
constraint uk_platform_gb_channel_device_id unique (device_id)
);
create table wvp_stream_proxy (