From 932eff1d73f26c6620aa1f2f9853fdd248108824 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 25 Jan 2024 18:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BD=E6=A0=87=E7=BA=A7?= =?UTF-8?q?=E8=81=94=E7=82=B9=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/impl/InviteRequestProcessor.java | 1 + .../dao/CommonChannelPlatformMapper.java | 2 +- 数据库/结构优化/common.sql | 139 +++++++++--------- 数据库/结构优化/初始化-mysql.sql | 75 ++++++++++ .../结构优化/初始化-postgresql-kingbase.sql | 4 +- 5 files changed, 145 insertions(+), 76 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index b2cb27278..375daf30f 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -256,6 +256,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements } sendRtpItem.setTcpActive(gb28181Sdp.isTcpActive()); sendRtpItem.setCallId(callIdHeader.getCallId()); + sendRtpItem.setStreamId(streamInfo.getStream()); if ("Play".equalsIgnoreCase(sessionName)) { sendRtpItem.setPlayType(InviteStreamType.PLAY); }else if ("Playback".equalsIgnoreCase(sessionName)) { diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelPlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelPlatformMapper.java index 89cc5ad2e..acfe678f2 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelPlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonChannelPlatformMapper.java @@ -62,7 +62,7 @@ public interface CommonChannelPlatformMapper { " left join wvp_common_channel_platform cp " + " on cc.common_gb_id = cp.common_gb_channel_id " + " where cp.platform_id = #{platformId}" + - " and cp.common_gb_channel_id = #{channelId}" + + " and cc.common_gb_device_id = #{channelId}" + " ") CommonGbChannel queryChannelByPlatformIdAndChannelDeviceId(@Param("platformId") Integer platformId, @Param("channelId") String channelId); diff --git a/数据库/结构优化/common.sql b/数据库/结构优化/common.sql index 41afe0fbc..2ae8eddf1 100644 --- a/数据库/结构优化/common.sql +++ b/数据库/结构优化/common.sql @@ -1,84 +1,77 @@ -CREATE TABLE `wvp_common_channel` +CREATE TABLE wvp_common_channel ( - `common_gb_id` bigint unsigned NOT NULL AUTO_INCREMENT, - `common_gb_device_id` varchar(50) NOT NULL, - `common_gb_name` varchar(255) DEFAULT NULL, - `common_gb_manufacturer` varchar(255) DEFAULT NULL, - `common_gb_model` varchar(255) DEFAULT NULL, - `common_gb_owner` varchar(255) DEFAULT NULL, - `common_gb_civilCode` varchar(50) DEFAULT NULL, - `common_gb_block` varchar(255) DEFAULT NULL, - `common_gb_address` varchar(255) DEFAULT NULL, - `common_gb_parental` integer, - `common_gb_parent_id` varchar(50) DEFAULT NULL, - `common_gb_safety_way` integer, - `common_gb_register_way` integer, - `common_gb_cert_num` varchar(255) DEFAULT NULL, - `common_gb_certifiable` integer, - `common_gb_err_code` integer, - `common_gb_end_time` varchar(50) DEFAULT NULL, - `common_gb_secrecy` integer, - `common_gb_ip_address` varchar(50) DEFAULT NULL, - `common_gb_port` integer, - `common_gb_password` varchar(50) DEFAULT NULL, - `common_gb_status` bool default false, - `common_gb_longitude` double, - `common_gb_latitude` double, - `common_gb_ptz_type` integer, - `common_gb_position_type` integer, - `common_gb_room_type` integer, - `common_gb_use_type` integer, - `common_gb_supply_light_type` integer, - `common_gb_direction_type` integer, - `common_gb_resolution` varchar(255) DEFAULT NULL, - `common_gb_business_group_id` varchar(255) DEFAULT NULL, - `common_gb_download_speed` varchar(255) DEFAULT NULL, - `common_gb_svc_time_support_mode` integer, - `common_gb_svc_space_support_mode` integer, - `type` varchar(255) NOT NULL, - `update_time` varchar(50) NOT NULL, - `create_time` varchar(50) NOT NULL, - PRIMARY KEY (`common_gb_id`), - UNIQUE KEY `common_gb_device_id` (`common_gb_device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + common_gb_id serial primary key, + common_gb_device_id varchar(50) NOT NULL, + common_gb_name varchar(255) DEFAULT NULL, + common_gb_manufacturer varchar(255) DEFAULT NULL, + common_gb_model varchar(255) DEFAULT NULL, + common_gb_owner varchar(255) DEFAULT NULL, + common_gb_civilCode varchar(50) DEFAULT NULL, + common_gb_block varchar(255) DEFAULT NULL, + common_gb_address varchar(255) DEFAULT NULL, + common_gb_parental integer, + common_gb_parent_id varchar(50) DEFAULT NULL, + common_gb_safety_way integer, + common_gb_register_way integer, + common_gb_cert_num varchar(255) DEFAULT NULL, + common_gb_certifiable integer, + common_gb_err_code integer, + common_gb_end_time varchar(50) DEFAULT NULL, + common_gb_secrecy integer, + common_gb_ip_address varchar(50) DEFAULT NULL, + common_gb_port integer, + common_gb_password varchar(50) DEFAULT NULL, + common_gb_status bool default false, + common_gb_longitude double, + common_gb_latitude double, + common_gb_ptz_type integer, + common_gb_position_type integer, + common_gb_room_type integer, + common_gb_use_type integer, + common_gb_supply_light_type integer, + common_gb_direction_type integer, + common_gb_resolution varchar(255) DEFAULT NULL, + common_gb_business_group_id varchar(255) DEFAULT NULL, + common_gb_download_speed varchar(255) DEFAULT NULL, + common_gb_svc_time_support_mode integer, + common_gb_svc_space_support_mode integer, + type varchar(255) NOT NULL, + update_time varchar(50) NOT NULL, + create_time varchar(50) NOT NULL, + UNIQUE KEY common_gb_device_id (common_gb_device_id) +); -CREATE TABLE `wvp_common_group` +CREATE TABLE wvp_common_group ( - `common_group_id` bigint unsigned NOT NULL AUTO_INCREMENT, - `common_group_device_id` varchar(50) NOT NULL, - `common_group_name` varchar(255) NOT NULL, - `common_group_parent_id` varchar(50) DEFAULT NULL, - `common_group_top_id` varchar(50) DEFAULT NULL, - `common_group_create_time` varchar(50) NOT NULL, - `common_group_update_time` varchar(50) NOT NULL, - PRIMARY KEY (`common_group_id`), - UNIQUE KEY `common_group_device_id` (`common_group_device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + common_group_id serial primary key, + common_group_device_id varchar(50) NOT NULL, + common_group_name varchar(255) NOT NULL, + common_group_parent_id varchar(50) DEFAULT NULL, + common_group_top_id varchar(50) DEFAULT NULL, + common_group_create_time varchar(50) NOT NULL, + common_group_update_time varchar(50) NOT NULL, + UNIQUE KEY common_group_device_id (common_group_device_id) +); -CREATE TABLE `wvp_common_region` +CREATE TABLE wvp_common_region ( - `common_region_id` bigint unsigned NOT NULL AUTO_INCREMENT, - `common_region_device_id` varchar(50) NOT NULL, - `common_region_name` varchar(255) NOT NULL, - `common_region_parent_id` varchar(50) DEFAULT NULL, - `common_region_create_time` varchar(50) NOT NULL, - `common_region_update_time` varchar(50) NOT NULL, - PRIMARY KEY (`common_region_id`), - UNIQUE KEY `common_region_device_id` (`common_region_device_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + common_region_id serial primary key, + common_region_device_id varchar(50) NOT NULL, + common_region_name varchar(255) NOT NULL, + common_region_parent_id varchar(50) DEFAULT NULL, + common_region_create_time varchar(50) NOT NULL, + common_region_update_time varchar(50) NOT NULL, + UNIQUE KEY common_region_device_id (common_region_device_id) +); -CREATE TABLE `wvp_common_channel_platform` +CREATE TABLE wvp_common_channel_platform ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `platform_id` bigint unsigned NOT NULL, - `common_gb_channel_id` bigint unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`), - UNIQUE KEY `uk_platform_id_common_gb_channel_id` (`platform_id`,`common_gb_channel_id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_0900_ai_ci; + id serial primary key, + platform_id integer, + common_gb_channel_id integer, + UNIQUE KEY uk_platform_id_common_gb_channel_id (platform_id,common_gb_channel_id) +); drop table wvp_platform_gb_stream; diff --git a/数据库/结构优化/初始化-mysql.sql b/数据库/结构优化/初始化-mysql.sql index 30924906c..2705b970b 100644 --- a/数据库/结构优化/初始化-mysql.sql +++ b/数据库/结构优化/初始化-mysql.sql @@ -277,6 +277,81 @@ create table wvp_user_role ( ); +CREATE TABLE wvp_common_channel +( + common_gb_id serial primary key, + common_gb_device_id varchar(50) NOT NULL, + common_gb_name varchar(255) DEFAULT NULL, + common_gb_manufacturer varchar(255) DEFAULT NULL, + common_gb_model varchar(255) DEFAULT NULL, + common_gb_owner varchar(255) DEFAULT NULL, + common_gb_civilCode varchar(50) DEFAULT NULL, + common_gb_block varchar(255) DEFAULT NULL, + common_gb_address varchar(255) DEFAULT NULL, + common_gb_parental integer, + common_gb_parent_id varchar(50) DEFAULT NULL, + common_gb_safety_way integer, + common_gb_register_way integer, + common_gb_cert_num varchar(255) DEFAULT NULL, + common_gb_certifiable integer, + common_gb_err_code integer, + common_gb_end_time varchar(50) DEFAULT NULL, + common_gb_secrecy integer, + common_gb_ip_address varchar(50) DEFAULT NULL, + common_gb_port integer, + common_gb_password varchar(50) DEFAULT NULL, + common_gb_status bool default false, + common_gb_longitude double, + common_gb_latitude double, + common_gb_ptz_type integer, + common_gb_position_type integer, + common_gb_room_type integer, + common_gb_use_type integer, + common_gb_supply_light_type integer, + common_gb_direction_type integer, + common_gb_resolution varchar(255) DEFAULT NULL, + common_gb_business_group_id varchar(255) DEFAULT NULL, + common_gb_download_speed varchar(255) DEFAULT NULL, + common_gb_svc_time_support_mode integer, + common_gb_svc_space_support_mode integer, + type varchar(255) NOT NULL, + update_time varchar(50) NOT NULL, + create_time varchar(50) NOT NULL, + UNIQUE KEY common_gb_device_id (common_gb_device_id) +); + + +CREATE TABLE wvp_common_group +( + common_group_id serial primary key, + common_group_device_id varchar(50) NOT NULL, + common_group_name varchar(255) NOT NULL, + common_group_parent_id varchar(50) DEFAULT NULL, + common_group_top_id varchar(50) DEFAULT NULL, + common_group_create_time varchar(50) NOT NULL, + common_group_update_time varchar(50) NOT NULL, + UNIQUE KEY common_group_device_id (common_group_device_id) +); + +CREATE TABLE wvp_common_region +( + common_region_id serial primary key, + common_region_device_id varchar(50) NOT NULL, + common_region_name varchar(255) NOT NULL, + common_region_parent_id varchar(50) DEFAULT NULL, + common_region_create_time varchar(50) NOT NULL, + common_region_update_time varchar(50) NOT NULL, + UNIQUE KEY common_region_device_id (common_region_device_id) +); + +CREATE TABLE wvp_common_channel_platform +( + id serial primary key, + platform_id integer, + common_gb_channel_id integer, + UNIQUE KEY uk_platform_id_common_gb_channel_id (platform_id,common_gb_channel_id) +); + /*初始数据*/ INSERT INTO wvp_user VALUES (1, 'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3'); INSERT INTO wvp_user_role VALUES (1, 'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); diff --git a/数据库/结构优化/初始化-postgresql-kingbase.sql b/数据库/结构优化/初始化-postgresql-kingbase.sql index b88f0f164..830f759ff 100644 --- a/数据库/结构优化/初始化-postgresql-kingbase.sql +++ b/数据库/结构优化/初始化-postgresql-kingbase.sql @@ -337,8 +337,8 @@ CREATE TABLE wvp_common_channel_platform ( id serial primary key, platform_id integer, - common_gb_channel_id integer, - constraint uk_platform_id_common_gb_channel_id unique (platform_id,common_gb_channel_id) + common_gb_channel_id integer, + constraint uk_platform_id_common_channel_id unique (platform_id,common_gb_channel_id) );