Ver Fonte

国标级联通道共享支持自定义通道编号和名称

648540858 há 1 ano atrás
pai
commit
8dc27d1353

+ 199 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformChannel.java

@@ -1,10 +1,208 @@
 package com.genersoft.iot.vmp.gb28181.bean;
 
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 @EqualsAndHashCode(callSuper = true)
 @Data
-public class PlatformChannel extends CommonGBChannel{
+public class PlatformChannel extends CommonGBChannel {
+
+    @Schema(description = "Id")
+    private int id;
+
+    @Schema(description = "平台ID")
     private int platformId;
+
+    @Schema(description = "国标-编码")
+    private String customDeviceId;
+
+    @Schema(description = "国标-名称")
+    private String customName;
+
+    @Schema(description = "国标-设备厂商")
+    private String customManufacturer;
+
+    @Schema(description = "国标-设备型号")
+    private String customModel;
+
+    // 2016
+    @Schema(description = "国标-设备归属")
+    private String customOwner;
+
+    @Schema(description = "国标-行政区域")
+    private String customCivilCode;
+
+    @Schema(description = "国标-警区")
+    private String customBlock;
+
+    @Schema(description = "国标-安装地址")
+    private String customAddress;
+
+    @Schema(description = "国标-是否有子设备")
+    private Integer customParental;
+
+    @Schema(description = "国标-父节点ID")
+    private String customParentId;
+
+    // 2016
+    @Schema(description = "国标-信令安全模式")
+    private Integer customSafetyWay;
+
+    @Schema(description = "国标-注册方式")
+    private Integer customRegisterWay;
+
+    // 2016
+    @Schema(description = "国标-证书序列号")
+    private Integer customCertNum;
+
+    // 2016
+    @Schema(description = "国标-证书有效标识")
+    private Integer customCertifiable;
+
+    // 2016
+    @Schema(description = "国标-无效原因码(有证书且证书无效的设备必选)")
+    private Integer customErrCode;
+
+    // 2016
+    @Schema(description = "国标-证书终止有效期(有证书且证书无效的设备必选)")
+    private Integer customEndTime;
+
+    // 2022
+    @Schema(description = "国标-摄像机安全能力等级代码")
+    private String customSecurityLevelCode;
+
+    @Schema(description = "国标-保密属性(必选)缺省为0;0-不涉密,1-涉密")
+    private Integer customSecrecy;
+
+    @Schema(description = "国标-设备/系统IPv4/IPv6地址")
+    private String customIpAddress;
+
+    @Schema(description = "国标-设备/系统端口")
+    private Integer customPort;
+
+    @Schema(description = "国标-设备口令")
+    private String customPassword;
+
+    @Schema(description = "国标-设备状态")
+    private String customStatus;
+
+    @Schema(description = "国标-经度 WGS-84坐标系")
+    private Double customLongitude;
+
+    @Schema(description = "国标-纬度 WGS-84坐标系")
+    private Double customLatitude;
+
+    @Schema(description = "国标-虚拟组织所属的业务分组ID")
+    private String customBusinessGroupId;
+
+    @Schema(description = "国标-摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道")
+    private Integer customPtzType;
+
+    // 2016
+    @Schema(description = "-摄像机位置类型扩展。1-省际检查站、2-党政机关、3-车站码头、4-中心广场、5-体育场馆、6-商业中心、7-宗教场所、" +
+            "8-校园周边、9-治安复杂区域、10-交通干线。当目录项为摄像机时可选。")
+    private Integer customPositionType;
+
+    @Schema(description = "国标-摄像机光电成像类型。1-可见光成像;2-热成像;3-雷达成像;4-X光成像;5-深度光场成像;9-其他。可多值,")
+    private String customPhotoelectricImagingTyp;
+
+    @Schema(description = "国标-摄像机采集部位类型")
+    private String customCapturePositionType;
+
+    @Schema(description = "国标-摄像机安装位置室外、室内属性。1-室外、2-室内。")
+    private Integer customRoomType;
+
+    // 2016
+    @Schema(description = "国标-用途属性")
+    private Integer customUseType;
+
+    @Schema(description = "国标-摄像机补光属性。1-无补光;2-红外补光;3-白光补光;4-激光补光;9-其他")
+    private Integer customSupplyLightType;
+
+    @Schema(description = "国标-摄像机监视方位(光轴方向)属性。1-东(西向东)、2-西(东向西)、3-南(北向南)、4-北(南向北)、" +
+            "5-东南(西北到东南)、6-东北(西南到东北)、7-西南(东北到西南)、8-西北(东南到西北)")
+    private Integer customDirectionType;
+
+    @Schema(description = "国标-摄像机支持的分辨率,可多值")
+    private String customResolution;
+
+    // 2022
+    @Schema(description = "国标-摄像机支持的码流编号列表,用于实时点播时指定码流编号(可选)")
+    private String customStreamNumberList;
+
+    @Schema(description = "国标-下载倍速(可选),可多值")
+    private String customDownloadSpeed;
+
+    @Schema(description = "国标-空域编码能力,取值0-不支持;1-1级增强(1个增强层);2-2级增强(2个增强层);3-3级增强(3个增强层)")
+    private Integer customSvcSpaceSupportMod;
+
+    @Schema(description = "国标-时域编码能力,取值0-不支持;1-1级增强;2-2级增强;3-3级增强(可选)")
+    private Integer customSvcTimeSupportMode;
+
+    // 2022
+    @Schema(description = "国标- SSVC增强层与基本层比例能力 ")
+    private String customSsvcRatioSupportList;
+
+    // 2022
+    @Schema(description = "国标-移动采集设备类型(仅移动采集设备适用,必选);1-移动机器人载摄像机;2-执法记录仪;3-移动单兵设备;" +
+            "4-车载视频记录设备;5-无人机载摄像机;9-其他")
+    private Integer customMobileDeviceType;
+
+    // 2022
+    @Schema(description = "国标-摄像机水平视场角(可选),取值范围大于0度小于等于360度")
+    private Double customHorizontalFieldAngle;
+
+    // 2022
+    @Schema(description = "国标-摄像机竖直视场角(可选),取值范围大于0度小于等于360度 ")
+    private Double customVerticalFieldAngle;
+
+    // 2022
+    @Schema(description = "国标-摄像机可视距离(可选),单位:米")
+    private Double customMaxViewDistance;
+
+    // 2022
+    @Schema(description = "国标-基层组织编码(必选,非基层建设时为“000000”)")
+    private String customGrassrootsCode;
+
+    // 2022
+    @Schema(description = "国标-监控点位类型(当为摄像机时必选),1-一类视频监控点;2-二类视频监控点;3-三类视频监控点;9-其他点位。")
+    private Integer customPoType;
+
+    // 2022
+    @Schema(description = "国标-点位俗称")
+    private String customPoCommonName;
+
+    // 2022
+    @Schema(description = "国标-设备MAC地址(可选),用“XX-XX-XX-XX-XX-XX”格式表达")
+    private String customMac;
+
+    // 2022
+    @Schema(description = "国标-摄像机卡口功能类型,01-人脸卡口;02-人员卡口;03-机动车卡口;04-非机动车卡口;05-物品卡口;99-其他")
+    private String customFunctionType;
+
+    // 2022
+    @Schema(description = "国标-摄像机视频编码格式")
+    private String customEncodeType;
+
+    // 2022
+    @Schema(description = "国标-摄像机安装使用时间")
+    private String customInstallTime;
+
+    // 2022
+    @Schema(description = "国标-摄像机所属管理单位名称")
+    private String customManagementUnit;
+
+    // 2022
+    @Schema(description = "国标-摄像机所属管理单位联系人的联系方式(电话号码,可多值,用英文半角“/”分割)")
+    private String customContactInfo;
+
+    // 2022
+    @Schema(description = "国标-录像保存天数(可选)")
+    private Integer customRecordSaveDays;
+
+    // 2022
+    @Schema(description = "国标-国民经济行业分类代码(可选)")
+    private String customIndustrialClassification;
+    
 }

+ 8 - 0
src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlatformController.java

@@ -279,4 +279,12 @@ public class PlatformController {
         Assert.notEmpty(param.getDeviceIds(), "设备ID不可为空");
         platformChannelService.removeChannelByDevice(param.getPlatformId(), param.getDeviceIds());
     }
+
+    @Operation(summary = "自定义共享通道信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
+    @PostMapping("/channel/custom/update")
+    @ResponseBody
+    public void updateCustomChannel(@RequestBody PlatformChannel channel) {
+        Assert.isTrue(channel.getId() > 0, "共享通道ID必须存在");
+        platformChannelService.updateCustomChannel(channel);
+    }
 }

+ 104 - 104
src/main/java/com/genersoft/iot/vmp/gb28181/dao/CommonGBChannelMapper.java

@@ -423,40 +423,40 @@ public interface CommonGBChannelMapper {
             "    wdc.stream_proxy_id,\n" +
             "    wdc.create_time,\n" +
             "    wdc.update_time,\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(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
-            "    coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
-            "    coalesce(wpgc.owner, 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(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
-            "    coalesce(wpgc.address, 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(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
-            "    coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
-            "    coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
-            "    coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
-            "    coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
-            "    coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
-            "    coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
-            "    coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
-            "    coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
-            "    coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
-            "    coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
-            "    coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
-            "    coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
-            "    coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
-            "    coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
-            "    coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
-            "    coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
-            "    coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
-            "    coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
-            "    coalesce(wpgc.resolution, 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(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
-            "    coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
-            "    coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
+            "    coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
+            "    coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" +
+            "    coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
+            "    coalesce(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,\n" +
+            "    coalesce(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
+            "    coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
+            "    coalesce(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,\n" +
+            "    coalesce(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,\n" +
+            "    coalesce(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
+            "    coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
+            "    coalesce(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
+            "    coalesce(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
+            "    coalesce(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
+            "    coalesce(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
+            "    coalesce(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
+            "    coalesce(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
+            "    coalesce(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
+            "    coalesce(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
+            "    coalesce(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,\n" +
+            "    coalesce(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,\n" +
+            "    coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,\n" +
+            "    coalesce(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
+            "    coalesce(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
+            "    coalesce(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
+            "    coalesce(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
+            "    coalesce(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
+            "    coalesce(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
+            "    coalesce(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
+            "    coalesce(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
+            "    coalesce(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
+            "    coalesce(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
+            "    coalesce(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
+            "    coalesce(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
+            "    coalesce(wpgc.custom_svc_time_support_mode, 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_channel wpgc on wdc.id = wpgc.device_channel_id" +
             " where wpgc.platform_id = #{platformId} "
@@ -472,43 +472,43 @@ public interface CommonGBChannelMapper {
             "    wdc.stream_proxy_id,\n" +
             "    wdc.create_time,\n" +
             "    wdc.update_time,\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(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
-            "    coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
-            "    coalesce(wpgc.owner, 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(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
-            "    coalesce(wpgc.address, 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(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
-            "    coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
-            "    coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
-            "    coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
-            "    coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
-            "    coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
-            "    coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
-            "    coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
-            "    coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
-            "    coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
-            "    coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
-            "    coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
-            "    coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
-            "    coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
-            "    coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
-            "    coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
-            "    coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
-            "    coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
-            "    coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
-            "    coalesce(wpgc.resolution, 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(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
-            "    coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
-            "    coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
+            "    coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
+            "    coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" +
+            "    coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
+            "    coalesce(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,\n" +
+            "    coalesce(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
+            "    coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
+            "    coalesce(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,\n" +
+            "    coalesce(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,\n" +
+            "    coalesce(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
+            "    coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
+            "    coalesce(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
+            "    coalesce(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
+            "    coalesce(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
+            "    coalesce(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
+            "    coalesce(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
+            "    coalesce(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
+            "    coalesce(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
+            "    coalesce(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
+            "    coalesce(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,\n" +
+            "    coalesce(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,\n" +
+            "    coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,\n" +
+            "    coalesce(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
+            "    coalesce(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
+            "    coalesce(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
+            "    coalesce(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
+            "    coalesce(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
+            "    coalesce(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
+            "    coalesce(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
+            "    coalesce(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
+            "    coalesce(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
+            "    coalesce(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
+            "    coalesce(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
+            "    coalesce(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
+            "    coalesce(wpgc.custom_svc_time_support_mode, 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_channel wpgc on wdc.id = wpgc.device_channel_id " +
-            " where wpgc.platform_id = #{platformId} and coalesce(wpgc.parent_id, wdc.gb_parent_id, wdc.parent_id) = #{parentId}"
+            " where wpgc.platform_id = #{platformId} and coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) = #{parentId}"
 
     )
     List<CommonGBChannel> queryShareChannelByParentId(@Param("parentId") String parentId, @Param("platformId") Integer platformId);
@@ -521,43 +521,43 @@ public interface CommonGBChannelMapper {
             "    wdc.stream_proxy_id,\n" +
             "    wdc.create_time,\n" +
             "    wdc.update_time,\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(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
-            "    coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
-            "    coalesce(wpgc.owner, 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(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
-            "    coalesce(wpgc.address, 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(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
-            "    coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
-            "    coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
-            "    coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
-            "    coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
-            "    coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
-            "    coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
-            "    coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
-            "    coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
-            "    coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
-            "    coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
-            "    coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
-            "    coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
-            "    coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
-            "    coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
-            "    coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
-            "    coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
-            "    coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
-            "    coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
-            "    coalesce(wpgc.resolution, 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(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
-            "    coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
-            "    coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
+            "    coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
+            "    coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" +
+            "    coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
+            "    coalesce(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,\n" +
+            "    coalesce(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
+            "    coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
+            "    coalesce(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,\n" +
+            "    coalesce(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,\n" +
+            "    coalesce(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
+            "    coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
+            "    coalesce(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
+            "    coalesce(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
+            "    coalesce(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
+            "    coalesce(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
+            "    coalesce(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
+            "    coalesce(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
+            "    coalesce(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
+            "    coalesce(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
+            "    coalesce(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,\n" +
+            "    coalesce(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,\n" +
+            "    coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,\n" +
+            "    coalesce(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
+            "    coalesce(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
+            "    coalesce(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
+            "    coalesce(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
+            "    coalesce(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
+            "    coalesce(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
+            "    coalesce(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
+            "    coalesce(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
+            "    coalesce(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
+            "    coalesce(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
+            "    coalesce(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
+            "    coalesce(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
+            "    coalesce(wpgc.custom_svc_time_support_mode, 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_channel wpgc on wdc.id = wpgc.device_channel_id " +
-            " where wpgc.platform_id = #{platformId} and coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code) = #{civilCode}"
+            " where wpgc.platform_id = #{platformId} and coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) = #{civilCode}"
 
     )
     List<CommonGBChannel> queryShareChannelByCivilCode(@Param("civilCode") String civilCode, @Param("platformId") Integer platformId);

+ 267 - 165
src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformChannelMapper.java

@@ -1,7 +1,6 @@
 package com.genersoft.iot.vmp.gb28181.dao;
 
 import com.genersoft.iot.vmp.gb28181.bean.*;
-import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce;
 import org.apache.ibatis.annotations.*;
 import org.springframework.stereotype.Repository;
 
@@ -13,14 +12,6 @@ import java.util.Set;
 @Repository
 public interface PlatformChannelMapper {
 
-    /**
-     * 查询列表里已经关联的
-     */
-    @Select("<script> "+
-            "SELECT device_channel_id from wvp_platform_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
-            "<foreach collection='channelReduces' open='(' item='item' separator=',' close=')'> #{item.id}</foreach>" +
-            "</script>")
-    List<Integer> findChannelRelatedPlatform(@Param("platformId") String platformId, @Param("channelReduces") List<ChannelReduce> channelReduces);
 
     @Insert("<script> "+
             "INSERT INTO wvp_platform_channel (platform_id, device_channel_id) VALUES" +
@@ -30,12 +21,6 @@ public interface PlatformChannelMapper {
             "</script>")
     int addChannels(@Param("platformId") Integer platformId, @Param("channelList") List<CommonGBChannel> channelList);
 
-    @Delete("<script> "+
-            "DELETE from wvp_platform_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
-            "<foreach collection='channelReducesToDel'  item='item'  open='(' separator=',' close=')' > #{item.id}</foreach>" +
-            "</script>")
-    int delChannelForGB(@Param("platformId") String platformId, @Param("channelReducesToDel") List<ChannelReduce> channelReducesToDel);
-
     @Delete("<script> "+
             "DELETE from wvp_platform_channel WHERE device_channel_id in " +
             "( select  temp.device_channel_id from " +
@@ -45,20 +30,12 @@ public interface PlatformChannelMapper {
             "</script>")
     int delChannelForDeviceId(String deviceId);
 
-    @Delete("<script> "+
-            "DELETE from wvp_platform_channel WHERE platform_id=#{platformId}"  +
-            "</script>")
-    int cleanChannelForGB(String platformId);
-
-    @Select("SELECT dc.* from wvp_platform_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_type = 0 and dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
-    List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId);
-
     @Select("select d.*\n" +
             "from wvp_platform_channel pgc\n" +
             "         left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
             "         left join wvp_device d on dc.device_id = d.device_id\n" +
             "where  dc.channel_type = 0 and dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
-    List<Device> queryVideoDeviceByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
+    List<Device> queryDeviceByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
 
     @Select("<script> " +
             " SELECT " +
@@ -76,7 +53,7 @@ public interface PlatformChannelMapper {
             "</script> ")
     List<Platform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
 
-    @Select("select dc.channel_id dc.device_id,dc.name,d.manufacturer,d.model,d.firmware\n" +
+    @Select("select dc.channel_id, dc.device_id,dc.name,d.manufacturer,d.model,d.firmware\n" +
             "from wvp_platform_channel pgc\n" +
             "         left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
             "         left join wvp_device d on dc.device_id = d.device_id\n" +
@@ -88,59 +65,95 @@ public interface PlatformChannelMapper {
 
     @Select("<script>" +
             " select " +
+            "    wpgc.id ,\n" +
             "    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(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(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
-            "    coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
-            "    coalesce(wpgc.owner, 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(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
-            "    coalesce(wpgc.address, 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(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
-            "    coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
-            "    coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
-            "    coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
-            "    coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
-            "    coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
-            "    coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
-            "    coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
-            "    coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
-            "    coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
-            "    coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
-            "    coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
-            "    coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
-            "    coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
-            "    coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
-            "    coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
-            "    coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
-            "    coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
-            "    coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
-            "    coalesce(wpgc.resolution, 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(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
-            "    coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
-            "    coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode, \n" +
+            "    wpgc.custom_device_id, \n" +
+            "    wpgc.custom_name, \n" +
+            "    wpgc.custom_manufacturer, \n" +
+            "    wpgc.custom_model, \n" +
+            "    wpgc.custom_owner, \n" +
+            "    wpgc.custom_civil_code,\n" +
+            "    wpgc.custom_block, \n" +
+            "    wpgc.custom_address,\n" +
+            "    wpgc.custom_parental, \n" +
+            "    wpgc.custom_parent_id, \n" +
+            "    wpgc.custom_safety_way, \n" +
+            "    wpgc.custom_register_way, \n" +
+            "    wpgc.custom_cert_num, \n" +
+            "    wpgc.custom_certifiable, \n" +
+            "    wpgc.custom_err_code, \n" +
+            "    wpgc.custom_end_time, \n" +
+            "    wpgc.custom_secrecy, \n" +
+            "    wpgc.custom_ip_address, \n" +
+            "    wpgc.custom_port, \n" +
+            "    wpgc.custom_password, \n" +
+            "    wpgc.custom_status, \n" +
+            "    wpgc.custom_longitude, \n" +
+            "    wpgc.custom_latitude, \n" +
+            "    wpgc.custom_ptz_type, \n" +
+            "    wpgc.custom_position_type, \n" +
+            "    wpgc.custom_room_type, \n" +
+            "    wpgc.custom_use_type, \n" +
+            "    wpgc.custom_supply_light_type, \n" +
+            "    wpgc.custom_direction_type, \n" +
+            "    wpgc.custom_resolution, \n" +
+            "    wpgc.custom_business_group_id, \n" +
+            "    wpgc.custom_download_speed, \n" +
+            "    wpgc.custom_svc_space_support_mod,\n" +
+            "    wpgc.custom_svc_time_support_mode," +
+            "    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" +
             "    wpgc.platform_id " +
             " from wvp_device_channel wdc" +
             " left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id and wpgc.platform_id = #{platformId}" +
             " where wdc.channel_type = 0 " +
-            " <if test='query != null'> AND (coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') " +
-            " OR coalesce(wpgc.name, wdc.gb_name, wdc.name)  LIKE concat('%',#{query},'%'))</if> " +
+            " <if test='query != null'> " +
+            " AND (coalesce(wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') OR wpgc.custom_device_id LIKE concat('%',#{query},'%') " +
+            "      OR coalesce(wdc.gb_name, wdc.name)  LIKE concat('%',#{query},'%') OR wpgc.custom_name LIKE concat('%',#{query},'%'))</if> " +
             " <if test='online == true'> AND coalesce(wpgc.status, wdc.gb_status, wdc.status) = 'ON'</if> " +
             " <if test='online == false'> AND coalesce(wpgc.status, wdc.gb_status, wdc.status) = 'OFF'</if> " +
             " <if test='hasShare == true'> AND wpgc.platform_id = #{platformId}</if> " +
             " <if test='hasShare == false'> AND wpgc.platform_id is null</if> " +
 
             "</script>")
-    List<PlatformChannel> queryForPlatformSearch(@Param("platformId") Integer platformId, @Param("query") String query,
+    List<PlatformChannel> queryForPlatformForWebList(@Param("platformId") Integer platformId, @Param("query") String query,
                                                  @Param("online") Boolean online, @Param("hasShare") Boolean hasShare);
 
     @Select("select\n" +
@@ -150,43 +163,43 @@ public interface PlatformChannelMapper {
             "    wdc.stream_proxy_id,\n" +
             "    wdc.create_time,\n" +
             "    wdc.update_time,\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(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
-            "    coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
-            "    coalesce(wpgc.owner, 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(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
-            "    coalesce(wpgc.address, 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(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
-            "    coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
-            "    coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
-            "    coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
-            "    coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
-            "    coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
-            "    coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
-            "    coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
-            "    coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
-            "    coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
-            "    coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
-            "    coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
-            "    coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
-            "    coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
-            "    coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
-            "    coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
-            "    coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
-            "    coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
-            "    coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
-            "    coalesce(wpgc.resolution, 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(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
-            "    coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
-            "    coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
+            "    coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
+            "    coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" +
+            "    coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
+            "    coalesce(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,\n" +
+            "    coalesce(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
+            "    coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
+            "    coalesce(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,\n" +
+            "    coalesce(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,\n" +
+            "    coalesce(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
+            "    coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
+            "    coalesce(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
+            "    coalesce(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
+            "    coalesce(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
+            "    coalesce(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
+            "    coalesce(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
+            "    coalesce(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
+            "    coalesce(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
+            "    coalesce(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
+            "    coalesce(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,\n" +
+            "    coalesce(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,\n" +
+            "    coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,\n" +
+            "    coalesce(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
+            "    coalesce(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
+            "    coalesce(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
+            "    coalesce(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
+            "    coalesce(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
+            "    coalesce(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
+            "    coalesce(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
+            "    coalesce(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
+            "    coalesce(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
+            "    coalesce(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
+            "    coalesce(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
+            "    coalesce(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
+            "    coalesce(wpgc.custom_svc_time_support_mode, 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_channel wpgc on wdc.id = wpgc.device_channel_id" +
-            " where wdc.channel_type = 0 and wpgc.platform_id = #{platformId} and coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) = #{channelDeviceId}"
+            " where wdc.channel_type = 0 and wpgc.platform_id = #{platformId} and coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) = #{channelDeviceId}"
 
     )
     CommonGBChannel queryOneWithPlatform(@Param("platformId") Integer platformId, @Param("channelDeviceId") String channelDeviceId);
@@ -200,40 +213,40 @@ public interface PlatformChannelMapper {
             "    wdc.stream_proxy_id,\n" +
             "    wdc.create_time,\n" +
             "    wdc.update_time,\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(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
-            "    coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
-            "    coalesce(wpgc.owner, 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(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
-            "    coalesce(wpgc.address, 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(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
-            "    coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
-            "    coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
-            "    coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
-            "    coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
-            "    coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
-            "    coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
-            "    coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
-            "    coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
-            "    coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
-            "    coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
-            "    coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
-            "    coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
-            "    coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
-            "    coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
-            "    coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
-            "    coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
-            "    coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
-            "    coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
-            "    coalesce(wpgc.resolution, 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(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
-            "    coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
-            "    coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
+            "    coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
+            "    coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" +
+            "    coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
+            "    coalesce(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,\n" +
+            "    coalesce(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
+            "    coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
+            "    coalesce(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,\n" +
+            "    coalesce(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,\n" +
+            "    coalesce(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
+            "    coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
+            "    coalesce(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
+            "    coalesce(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
+            "    coalesce(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
+            "    coalesce(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
+            "    coalesce(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
+            "    coalesce(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
+            "    coalesce(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
+            "    coalesce(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
+            "    coalesce(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,\n" +
+            "    coalesce(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,\n" +
+            "    coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,\n" +
+            "    coalesce(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
+            "    coalesce(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
+            "    coalesce(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
+            "    coalesce(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
+            "    coalesce(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
+            "    coalesce(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
+            "    coalesce(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
+            "    coalesce(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
+            "    coalesce(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
+            "    coalesce(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
+            "    coalesce(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
+            "    coalesce(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
+            "    coalesce(wpgc.custom_svc_time_support_mode, 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_channel wpgc on wdc.id = wpgc.device_channel_id and wpgc.platform_id = #{platformId}" +
             " where wdc.channel_type = 0 and wpgc.platform_id is null" +
@@ -251,40 +264,40 @@ public interface PlatformChannelMapper {
             "    wdc.stream_proxy_id,\n" +
             "    wdc.create_time,\n" +
             "    wdc.update_time,\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(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
-            "    coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
-            "    coalesce(wpgc.owner, 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(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
-            "    coalesce(wpgc.address, 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(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
-            "    coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
-            "    coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
-            "    coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
-            "    coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
-            "    coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
-            "    coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
-            "    coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
-            "    coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
-            "    coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
-            "    coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
-            "    coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
-            "    coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
-            "    coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
-            "    coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
-            "    coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
-            "    coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
-            "    coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
-            "    coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
-            "    coalesce(wpgc.resolution, 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(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
-            "    coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
-            "    coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
+            "    coalesce(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
+            "    coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" +
+            "    coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
+            "    coalesce(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,\n" +
+            "    coalesce(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
+            "    coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
+            "    coalesce(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,\n" +
+            "    coalesce(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,\n" +
+            "    coalesce(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
+            "    coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
+            "    coalesce(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
+            "    coalesce(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
+            "    coalesce(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
+            "    coalesce(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
+            "    coalesce(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
+            "    coalesce(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
+            "    coalesce(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
+            "    coalesce(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
+            "    coalesce(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,\n" +
+            "    coalesce(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,\n" +
+            "    coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,\n" +
+            "    coalesce(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
+            "    coalesce(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
+            "    coalesce(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
+            "    coalesce(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
+            "    coalesce(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
+            "    coalesce(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
+            "    coalesce(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
+            "    coalesce(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
+            "    coalesce(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
+            "    coalesce(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
+            "    coalesce(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
+            "    coalesce(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
+            "    coalesce(wpgc.custom_svc_time_support_mode, 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_channel wpgc on wdc.id = wpgc.device_channel_id" +
             " where wdc.channel_type = 0 and wpgc.platform_id = #{platformId}" +
@@ -425,4 +438,93 @@ public interface PlatformChannelMapper {
             "DELETE from wvp_platform_region WHERE platform_id=#{platformId}" +
             "</script>")
     void removePlatformRegionByPlatformId(@Param("platformId") Integer platformId);
+
+    @Update(value = {" <script>" +
+            " UPDATE wvp_platform_channel " +
+            " SET custom_device_id =#{customDeviceId}" +
+            " ,custom_name =#{customName}" +
+            " ,custom_manufacturer =#{customManufacturer}" +
+            " ,custom_model =#{customModel}" +
+            " ,custom_owner =#{customOwner}" +
+            " ,custom_civil_code =#{customCivilCode}" +
+            " ,custom_block =#{customBlock}" +
+            " ,custom_address =#{customAddress}" +
+            " ,custom_parental =#{customParental}" +
+            " ,custom_parent_id =#{customParentId}" +
+            " ,custom_safety_way =#{customSafetyWay}" +
+            " ,custom_register_way =#{customRegisterWay}" +
+            " ,custom_cert_num =#{customCertNum}" +
+            " ,custom_certifiable =#{customCertifiable}" +
+            " ,custom_err_code =#{customErrCode}" +
+            " ,custom_end_time =#{customEndTime}" +
+            " ,custom_secrecy =#{customSecrecy}" +
+            " ,custom_ip_address =#{customIpAddress}" +
+            " ,custom_port =#{customPort}" +
+            " ,custom_password =#{customPassword}" +
+            " ,custom_status =#{customStatus}" +
+            " ,custom_longitude =#{customLongitude}" +
+            " ,custom_latitude =#{customLatitude}" +
+            " ,custom_ptz_type =#{customPtzType}" +
+            " ,custom_position_type =#{customPositionType}" +
+            " ,custom_room_type =#{customRoomType}" +
+            " ,custom_use_type =#{customUseType}" +
+            " ,custom_supply_light_type =#{customSupplyLightType}" +
+            " ,custom_direction_type =#{customDirectionType}" +
+            " ,custom_resolution =#{customResolution}" +
+            " ,custom_business_group_id =#{customBusinessGroupId}" +
+            " ,custom_download_speed =#{customDownloadSpeed}" +
+            " ,custom_svc_space_support_mod =#{customSvcSpaceSupportMod}" +
+            " ,custom_svc_time_support_mode = #{customSvcTimeSupportMode}" +
+            " WHERE id = #{id}"+
+            " </script>"})
+    void updateCustomChannel(PlatformChannel channel);
+
+
+    @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(wpgc.custom_device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
+            "    coalesce(wpgc.custom_name, wdc.gb_name, wdc.name) as gb_name,\n" +
+            "    coalesce(wpgc.custom_manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
+            "    coalesce(wpgc.custom_model, wdc.gb_model, wdc.model) as gb_model,\n" +
+            "    coalesce(wpgc.custom_owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
+            "    coalesce(wpgc.custom_civil_code, wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
+            "    coalesce(wpgc.custom_block, wdc.gb_block, wdc.block) as gb_block,\n" +
+            "    coalesce(wpgc.custom_address, wdc.gb_address, wdc.address) as gb_address,\n" +
+            "    coalesce(wpgc.custom_parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
+            "    coalesce(wpgc.custom_parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
+            "    coalesce(wpgc.custom_safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
+            "    coalesce(wpgc.custom_register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
+            "    coalesce(wpgc.custom_cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
+            "    coalesce(wpgc.custom_certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
+            "    coalesce(wpgc.custom_err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
+            "    coalesce(wpgc.custom_end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
+            "    coalesce(wpgc.custom_secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
+            "    coalesce(wpgc.custom_ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
+            "    coalesce(wpgc.custom_port, wdc.gb_port, wdc.port) as gb_port,\n" +
+            "    coalesce(wpgc.custom_password, wdc.gb_password, wdc.password) as gb_password,\n" +
+            "    coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) as gb_status,\n" +
+            "    coalesce(wpgc.custom_longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
+            "    coalesce(wpgc.custom_latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
+            "    coalesce(wpgc.custom_ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
+            "    coalesce(wpgc.custom_position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
+            "    coalesce(wpgc.custom_room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
+            "    coalesce(wpgc.custom_use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
+            "    coalesce(wpgc.custom_supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
+            "    coalesce(wpgc.custom_direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
+            "    coalesce(wpgc.custom_resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
+            "    coalesce(wpgc.custom_business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
+            "    coalesce(wpgc.custom_download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
+            "    coalesce(wpgc.custom_svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
+            "    coalesce(wpgc.custom_svc_time_support_mode, 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_channel wpgc on wdc.id = wpgc.device_channel_id" +
+            " where wdc.channel_type = 0 and wpgc.platform_id = #{platformId} and wdc.id = #{gbId}" +
+            "</script>")
+    CommonGBChannel queryShareChannel(@Param("platformId") int platformId, @Param("gbId") int gbId);
 }

+ 2 - 0
src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformChannelService.java

@@ -34,4 +34,6 @@ public interface IPlatformChannelService {
     void addChannelByDevice(Integer platformId, List<Integer> deviceIds);
 
     void removeChannelByDevice(Integer platformId, List<Integer> deviceIds);
+
+    void updateCustomChannel(PlatformChannel channel);
 }

+ 15 - 1
src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformChannelServiceImpl.java

@@ -56,7 +56,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
     @Override
     public PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Boolean online, Integer platformId, Boolean hasShare) {
         PageHelper.startPage(page, count);
-        List<PlatformChannel> all = platformChannelMapper.queryForPlatformSearch(platformId, query, online, hasShare);
+        List<PlatformChannel> all = platformChannelMapper.queryForPlatformForWebList(platformId, query, online, hasShare);
         return new PageInfo<>(all);
     }
 
@@ -413,4 +413,18 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
             log.error("[命令发送失败] 国标级联 Catalog通知: {}", e.getMessage());
         }
     }
+
+    @Override
+    public void updateCustomChannel(PlatformChannel channel) {
+        platformChannelMapper.updateCustomChannel(channel);
+        CommonGBChannel commonGBChannel = platformChannelMapper.queryShareChannel(channel.getPlatformId(), channel.getGbId());
+        // 发送消息
+        try {
+            // 发送catalog
+            eventPublisher.catalogEventPublish(channel.getPlatformId(), commonGBChannel, CatalogEvent.UPDATE);
+        } catch (Exception e) {
+            log.warn("[自定义通道信息] 发送失败, 平台ID: {}, 通道: {}({})", channel.getPlatformId(),
+                    channel.getGbName(), channel.getGbDeviceDbId(), e);
+        }
+    }
 }

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java

@@ -63,7 +63,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
 
 	@Override
 	public Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId) {
-		List<Device> devices = platformChannelMapper.queryVideoDeviceByPlatformIdAndChannelId(platformId, channelId);
+		List<Device> devices = platformChannelMapper.queryDeviceByPlatformIdAndChannelId(platformId, channelId);
 		if (devices.size() > 1) {
 			// 出现长度大于0的时候肯定是国标通道的ID重复了
 			log.warn("国标ID存在重复:{}", channelId);

+ 45 - 0
web_src/src/components/dialog/shareChannelAdd.vue

@@ -51,6 +51,26 @@
       </el-table-column>
       <el-table-column prop="gbDeviceId" label="编号" min-width="180">
       </el-table-column>
+      <el-table-column v-if="hasShare ==='true'" label="自定义名称" min-width="180">
+        <template slot-scope="scope">
+          <div slot="—" class="name-wrapper">
+            <el-input size="mini" placeholder="不填按原名称" v-model:value="scope.row.customName"></el-input>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column v-if="hasShare ==='true'" label="自定义编号" min-width="180">
+        <template slot-scope="scope">
+          <div slot="—" class="name-wrapper">
+            <el-input size="mini" placeholder="不填按原编号" v-model:value="scope.row.customDeviceId"></el-input>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column v-if="hasShare ==='true'"  label="" min-width="80">
+        <template slot-scope="scope">
+          <el-button size="mini" type="primary" @click="saveCustom(scope.row)">保存
+          </el-button>
+        </template>
+      </el-table-column>
       <el-table-column prop="gbManufacturer" label="厂家" min-width="100">
       </el-table-column>
       <el-table-column label="类型" min-width="100">
@@ -415,6 +435,31 @@ export default {
       });
 
     },
+    saveCustom: function (row) {
+      this.$axios({
+        method: 'post',
+        url: `/api/platform/channel/custom/update`,
+        data: row
+      }).then((res)=> {
+        if (res.data.code === 0) {
+          this.$message.success({
+            showClose: true,
+            message: "保存成功"
+          })
+          this.initData()
+        }else {
+          this.$message.error({
+            showClose: true,
+            message: res.data.msg
+          })
+        }
+      }).catch((error)=> {
+        this.$message.error({
+          showClose: true,
+          message: error
+        })
+      });
+    },
     search: function () {
       this.currentPage = 1;
       this.total = 0;

+ 39 - 39
数据库/2.7.2-重构/初始化-mysql-2.7.2.sql

@@ -285,45 +285,45 @@ create table wvp_platform
 
 create table wvp_platform_channel
 (
-    id                    serial primary key,
-    platform_id           integer,
-    device_channel_id     integer,
-    device_id             character varying(50),
-    name                  character varying(255),
-    manufacturer          character varying(50),
-    model                 character varying(50),
-    owner                 character varying(50),
-    civil_code            character varying(50),
-    block                 character varying(50),
-    address               character varying(50),
-    parental              integer,
-    parent_id             character varying(50),
-    safety_way            integer,
-    register_way          integer,
-    cert_num              character varying(50),
-    certifiable           integer,
-    err_code              integer,
-    end_time              character varying(50),
-    secrecy               integer,
-    ip_address            character varying(50),
-    port                  integer,
-    password              character varying(255),
-    status                character varying(50),
-    longitude             double precision,
-    latitude              double precision,
-    ptz_type              integer,
-    position_type         integer,
-    room_type             integer,
-    use_type              integer,
-    supply_light_type     integer,
-    direction_type        integer,
-    resolution            character varying(255),
-    business_group_id     character varying(255),
-    download_speed        character varying(255),
-    svc_space_support_mod integer,
-    svc_time_support_mode integer,
+    id                           serial primary key,
+    platform_id                  integer,
+    device_channel_id            integer,
+    custom_device_id             character varying(50),
+    custom_name                  character varying(255),
+    custom_manufacturer          character varying(50),
+    custom_model                 character varying(50),
+    custom_owner                 character varying(50),
+    custom_civil_code            character varying(50),
+    custom_block                 character varying(50),
+    custom_address               character varying(50),
+    custom_parental              integer,
+    custom_parent_id             character varying(50),
+    custom_safety_way            integer,
+    custom_register_way          integer,
+    custom_cert_num              character varying(50),
+    custom_certifiable           integer,
+    custom_err_code              integer,
+    custom_end_time              character varying(50),
+    custom_secrecy               integer,
+    custom_ip_address            character varying(50),
+    custom_port                  integer,
+    custom_password              character varying(255),
+    custom_status                character varying(50),
+    custom_longitude             double precision,
+    custom_latitude              double precision,
+    custom_ptz_type              integer,
+    custom_position_type         integer,
+    custom_room_type             integer,
+    custom_use_type              integer,
+    custom_supply_light_type     integer,
+    custom_direction_type        integer,
+    custom_resolution            character varying(255),
+    custom_business_group_id     character varying(255),
+    custom_download_speed        character varying(255),
+    custom_svc_space_support_mod integer,
+    custom_svc_time_support_mode integer,
     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)
+    constraint uk_platform_gb_channel_device_id unique (custom_device_id)
 );
 
 create table wvp_platform_group
@@ -462,7 +462,7 @@ CREATE TABLE wvp_common_group
     business_group   varchar(50)  NOT NULL,
     create_time      varchar(50)  NOT NULL,
     update_time      varchar(50)  NOT NULL,
-    civil_code       varchar(50)  default null,
+    civil_code       varchar(50) default null,
     UNIQUE KEY common_group_device_platform (device_id)
 );