text: /*
   Navicat Premium Data Transfer
  
   Source Server         : localhost mysql5.7
   Source Server Type    : MySQL
   Source Server Version : 50734
   Source Host           : localhost:3306
   Source Schema         : blueberry
  
   Target Server Type    : MySQL
   Target Server Version : 50734
   File Encoding         : 65001
  
   Date: 22/09/2021 10:41:45
  */
  
  SET NAMES utf8mb4;
  SET FOREIGN_KEY_CHECKS = 0;
  
  -- ----------------------------
  -- Table structure for qrtz_blob_triggers
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_blob_triggers`;
  CREATE TABLE `qrtz_blob_triggers`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `BLOB_DATA` blob NULL,
    PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
    CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for qrtz_calendars
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_calendars`;
  CREATE TABLE `qrtz_calendars`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `CALENDAR` blob NOT NULL,
    PRIMARY KEY (`SCHED_NAME`, `CALENDAR_NAME`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for qrtz_cron_triggers
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_cron_triggers`;
  CREATE TABLE `qrtz_cron_triggers`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `CRON_EXPRESSION` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TIME_ZONE_ID` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
    CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Records of qrtz_cron_triggers
  -- ----------------------------
  INSERT INTO `qrtz_cron_triggers` VALUES ('clusteredScheduler', '无人观看检测', 'stream', '0 0/3 * * * ? ', 'Asia/Shanghai');
  INSERT INTO `qrtz_cron_triggers` VALUES ('clusteredScheduler', '视频质量检测任务', 'stream', '0 0/5 * * * ? ', 'Asia/Shanghai');
  INSERT INTO `qrtz_cron_triggers` VALUES ('clusteredScheduler', '设备在线状态检测', 'device', '0 0/1 * * * ? ', 'Asia/Shanghai');
  
  -- ----------------------------
  -- Table structure for qrtz_fired_triggers
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_fired_triggers`;
  CREATE TABLE `qrtz_fired_triggers`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `ENTRY_ID` varchar(95) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `FIRED_TIME` bigint(13) NOT NULL,
    `SCHED_TIME` bigint(13) NOT NULL,
    `PRIORITY` int(11) NOT NULL,
    `STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    PRIMARY KEY (`SCHED_NAME`, `ENTRY_ID`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for qrtz_job_details
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_job_details`;
  CREATE TABLE `qrtz_job_details`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `JOB_CLASS_NAME` varchar(250) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `IS_DURABLE` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `IS_UPDATE_DATA` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `JOB_DATA` blob NULL,
    PRIMARY KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Records of qrtz_job_details
  -- ----------------------------
  INSERT INTO `qrtz_job_details` VALUES ('clusteredScheduler', '无人观看检测', 'stream', '检测视频流无人观看情况，如果无人观看，关闭视频流', 'fun.bookish.blueberry.server.schedule.VideoNoReaderCheckTask', '0', '0', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787000737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F40000000000010770800000010000000007800);
  INSERT INTO `qrtz_job_details` VALUES ('clusteredScheduler', '视频质量检测任务', 'stream', '视频质量检测，将检测结果保存至数据库，并且回调通知应用平台', 'fun.bookish.blueberry.server.schedule.VideoQualityDetectTask', '0', '0', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787000737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F40000000000010770800000010000000007800);
  INSERT INTO `qrtz_job_details` VALUES ('clusteredScheduler', '设备在线状态检测', 'device', '检测设备是否在线，并且同步数据库中设备的在线状态', 'fun.bookish.blueberry.server.schedule.DeviceOnlineCheckTask', '0', '0', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787000737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F40000000000010770800000010000000007800);
  
  -- ----------------------------
  -- Table structure for qrtz_locks
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_locks`;
  CREATE TABLE `qrtz_locks`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `LOCK_NAME` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    PRIMARY KEY (`SCHED_NAME`, `LOCK_NAME`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Records of qrtz_locks
  -- ----------------------------
  INSERT INTO `qrtz_locks` VALUES ('clusteredScheduler', 'TRIGGER_ACCESS');
  
  -- ----------------------------
  -- Table structure for qrtz_paused_trigger_grps
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`;
  CREATE TABLE `qrtz_paused_trigger_grps`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    PRIMARY KEY (`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for qrtz_scheduler_state
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_scheduler_state`;
  CREATE TABLE `qrtz_scheduler_state`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `LAST_CHECKIN_TIME` bigint(13) NOT NULL,
    `CHECKIN_INTERVAL` bigint(13) NOT NULL,
    PRIMARY KEY (`SCHED_NAME`, `INSTANCE_NAME`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for qrtz_simple_triggers
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_simple_triggers`;
  CREATE TABLE `qrtz_simple_triggers`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `REPEAT_COUNT` bigint(7) NOT NULL,
    `REPEAT_INTERVAL` bigint(12) NOT NULL,
    `TIMES_TRIGGERED` bigint(10) NOT NULL,
    PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
    CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for qrtz_simprop_triggers
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_simprop_triggers`;
  CREATE TABLE `qrtz_simprop_triggers`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `STR_PROP_1` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `STR_PROP_2` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `STR_PROP_3` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `INT_PROP_1` int(11) NULL DEFAULT NULL,
    `INT_PROP_2` int(11) NULL DEFAULT NULL,
    `LONG_PROP_1` bigint(20) NULL DEFAULT NULL,
    `LONG_PROP_2` bigint(20) NULL DEFAULT NULL,
    `DEC_PROP_1` decimal(13, 4) NULL DEFAULT NULL,
    `DEC_PROP_2` decimal(13, 4) NULL DEFAULT NULL,
    `BOOL_PROP_1` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `BOOL_PROP_2` varchar(1) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
    CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for qrtz_triggers
  -- ----------------------------
  DROP TABLE IF EXISTS `qrtz_triggers`;
  CREATE TABLE `qrtz_triggers`  (
    `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `NEXT_FIRE_TIME` bigint(13) NULL DEFAULT NULL,
    `PREV_FIRE_TIME` bigint(13) NULL DEFAULT NULL,
    `PRIORITY` int(11) NULL DEFAULT NULL,
    `TRIGGER_STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `TRIGGER_TYPE` varchar(8) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `START_TIME` bigint(13) NOT NULL,
    `END_TIME` bigint(13) NULL DEFAULT NULL,
    `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
    `MISFIRE_INSTR` smallint(2) NULL DEFAULT NULL,
    `JOB_DATA` blob NULL,
    PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
    INDEX `SCHED_NAME`(`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
    CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `qrtz_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Records of qrtz_triggers
  -- ----------------------------
  INSERT INTO `qrtz_triggers` VALUES ('clusteredScheduler', '无人观看检测', 'stream', '无人观看检测', 'stream', '检测视频流无人观看情况，如果无人观看，关闭视频流', 1632278520000, 1632278340000, 5, 'PAUSED', 'CRON', 1622701755000, 0, NULL, 2, '');
  INSERT INTO `qrtz_triggers` VALUES ('clusteredScheduler', '视频质量检测任务', 'stream', '视频质量检测任务', 'stream', '视频质量检测，将检测结果保存至数据库，并且回调通知应用平台', 1632278400000, 1626082500000, 5, 'PAUSED', 'CRON', 1626082487000, 0, NULL, 2, '');
  INSERT INTO `qrtz_triggers` VALUES ('clusteredScheduler', '设备在线状态检测', 'device', '设备在线状态检测', 'device', '检测设备是否在线，并且同步数据库中设备的在线状态', 1632278460000, 1632278400000, 5, 'WAITING', 'CRON', 1623403820000, 0, NULL, 2, '');
  
  -- ----------------------------
  -- Table structure for t_channel
  -- ----------------------------
  DROP TABLE IF EXISTS `t_channel`;
  CREATE TABLE `t_channel`  (
    `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '通道id',
    `device_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备/区域/系统编码',
    `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备/区域/系统名称',
    `manufacturer` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备厂商',
    `model` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备型号',
    `owner` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备归属',
    `civil_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '行政区域',
    `block` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '警区',
    `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '安装地址',
    `parental` int(1) NOT NULL COMMENT '是否有子设备',
    `parent_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '父设备/区域/系统 ID',
    `parent_channel_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '父通道ID',
    `safety_way` int(1) NULL DEFAULT NULL COMMENT '信令安全模式',
    `register_way` int(1) NULL DEFAULT NULL COMMENT '注册方式',
    `cert_num` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '证书序列号',
    `certifiable` int(1) NULL DEFAULT NULL COMMENT '证书有效标识',
    `err_code` int(11) NULL DEFAULT NULL COMMENT '无效原因码',
    `end_time` datetime(0) NULL DEFAULT NULL COMMENT '证书终止有效期',
    `secrecy` int(1) NULL DEFAULT NULL COMMENT '保密属性',
    `ip_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备/区域/系统 IP 地址',
    `port` int(11) NULL DEFAULT NULL COMMENT '设备/区域/系统端口',
    `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备口令',
    `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备状态',
    `longitude` double NULL DEFAULT NULL COMMENT '经度',
    `latitude` double NULL DEFAULT NULL COMMENT '纬度',
    `ptz_type` int(11) NULL DEFAULT NULL COMMENT '摄像机类型扩展',
    `position_type` int(11) NULL DEFAULT NULL COMMENT '摄像机位置类型扩展',
    `room_type` int(1) NULL DEFAULT NULL COMMENT '安装位置',
    `use_type` int(1) NULL DEFAULT NULL COMMENT '摄像机用途',
    `supply_light_type` int(1) NULL DEFAULT NULL COMMENT '摄像机补光',
    `direction_type` int(1) NULL DEFAULT NULL COMMENT '摄像机监视方位',
    `resolution` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '摄像机支持的分辨率',
    `business_group_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '虚拟组织所属的业务分组 ID',
    `download_speed` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '下载倍速范围',
    `svc_space_support_mode` int(1) NULL DEFAULT NULL COMMENT '空域编码能力',
    `svc_time_support_mode` int(1) NULL DEFAULT NULL COMMENT '时域编码能力',
    `rtsp` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'rtsp取流地址',
    `created_at` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
    `updated_at` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`, `device_id`) USING BTREE,
    INDEX `idx_t_channels_name`(`name`) USING BTREE,
    INDEX `idx_t_channels_parent_id`(`parent_id`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '设备通道表' ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for t_device
  -- ----------------------------
  DROP TABLE IF EXISTS `t_device`;
  CREATE TABLE `t_device`  (
    `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备编码',
    `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备名称',
    `manufacturer` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备生产商',
    `model` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备型号',
    `firmware` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备固件版本',
    `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备类型',
    `command_transport` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'SIP命令通信协议（仅限于GB设备）',
    `remote_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备ip地址',
    `remote_port` int(11) NOT NULL DEFAULT 0 COMMENT '设备端口号',
    `online` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否在线（0：否，1：是）',
    `sip_server_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'sip服务器地址（仅限于GB设备）',
    `expires` int(11) NULL DEFAULT 3600 COMMENT '设备过期时长（单位：秒，仅限于GB设备）',
    `last_register_at` datetime(0) NULL DEFAULT NULL COMMENT '最后一次注册时间（仅限于GB设备）',
    `last_keepalive_at` datetime(0) NULL DEFAULT NULL COMMENT '最后一次心跳时间（仅限于GB设备）',
    `created_at` datetime(0) NOT NULL COMMENT '创建时间',
    `updated_at` datetime(0) NOT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `idx_t_devices_name`(`name`) USING BTREE,
    INDEX `idx_t_devices_type`(`type`) USING BTREE,
    INDEX `idx_t_devices_online`(`online`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '设备表' ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for t_video_quality_detect_arithmetic
  -- ----------------------------
  DROP TABLE IF EXISTS `t_video_quality_detect_arithmetic`;
  CREATE TABLE `t_video_quality_detect_arithmetic`  (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '编码',
    `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '名称',
    `settings` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '参数设置',
    `priority` int(11) NOT NULL COMMENT '优先级',
    `enable` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否启用（0：否，1：是）',
    `apply_all` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否应用到所有设备（0：否，1：是）',
    `created_at` datetime(0) NOT NULL COMMENT '创建时间',
    `updated_at` datetime(0) NOT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '视频质量检测算法' ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Records of t_video_quality_detect_arithmetic
  -- ----------------------------
  INSERT INTO `t_video_quality_detect_arithmetic` VALUES (12, 'NOISE', '噪声检测', '{\"threshold\":30.0}', 2, 1, 1, '2021-06-25 10:09:09', '2021-07-07 11:22:45');
  INSERT INTO `t_video_quality_detect_arithmetic` VALUES (13, 'STRIPE', '条纹检测', '{\"threshold\":0.008}', 3, 1, 1, '2021-06-25 10:09:36', '2021-06-30 17:18:43');
  INSERT INTO `t_video_quality_detect_arithmetic` VALUES (14, 'COLOR_CAST', '偏色检测', '{\"threshold\":2.0}', 4, 1, 1, '2021-06-25 10:09:49', '2021-06-30 17:18:47');
  INSERT INTO `t_video_quality_detect_arithmetic` VALUES (15, 'BRIGHTNESS', '亮度检测', '{\"threshold\":0}', 5, 1, 1, '2021-06-25 10:09:58', '2021-06-30 17:18:50');
  INSERT INTO `t_video_quality_detect_arithmetic` VALUES (16, 'SHARPNESS', '清晰度检测', '{\"threshold\":10}', 6, 1, 1, '2021-06-25 10:10:03', '2021-06-30 17:18:55');
  INSERT INTO `t_video_quality_detect_arithmetic` VALUES (17, 'ANGLE_CHANGE', '角度变化检测', '{\"threshold\":30}', 7, 1, 0, '2021-06-25 10:10:14', '2021-06-30 17:18:59');
  INSERT INTO `t_video_quality_detect_arithmetic` VALUES (18, 'COVER', '遮挡检测', '{\"threshold\":0.30}', 1, 1, 1, '2021-06-30 17:18:32', '2021-07-12 14:36:22');
  
  -- ----------------------------
  -- Table structure for t_video_quality_detect_arithmetic_apply_device
  -- ----------------------------
  DROP TABLE IF EXISTS `t_video_quality_detect_arithmetic_apply_device`;
  CREATE TABLE `t_video_quality_detect_arithmetic_apply_device`  (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `arithmetic_id` int(11) NOT NULL COMMENT '算法id',
    `device_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备id',
    `channel_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '通道id',
    `created_at` datetime(0) NOT NULL COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '视频质量检测算法应用设备表' ROW_FORMAT = Dynamic;
  
  -- ----------------------------
  -- Table structure for t_video_quality_detect_record
  -- ----------------------------
  DROP TABLE IF EXISTS `t_video_quality_detect_record`;
  CREATE TABLE `t_video_quality_detect_record`  (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `arithmetic_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '算法编码',
    `arithmetic_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '算法名称',
    `device_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '设备id',
    `channel_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '通道id',
    `image_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '图片文件地址',
    `has_error` tinyint(1) NOT NULL COMMENT '是否异常',
    `error` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '异常信息',
    `has_quality_error` tinyint(1) NULL DEFAULT NULL COMMENT '是否存在质量问题',
    `quality_error` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '质量问题信息',
    `detail` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT '质量检测详情',
    `created_at` datetime(0) NOT NULL COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `idx_t_devices_name`(`channel_id`) USING BTREE
  ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '视频质量检测记录表' ROW_FORMAT = Compact;
  
  -- ----------------------------
  -- Table structure for t_video_stream
  -- ----------------------------
  DROP TABLE IF EXISTS `t_video_stream`;
  CREATE TABLE `t_video_stream`  (
    `id` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
    `device_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '设备id',
    `channel_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '通道id',
    `type` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '类型',
    `ssrc` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT 'ssrc',
    `flv` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'flv地址',
    `stop_params` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '停止参数',
    `status` tinyint(1) NOT NULL COMMENT '连接状态（0：连接中，1：已连接）',
    `created_at` datetime(0) NOT NULL COMMENT '创建时间',
    `updated_at` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `idx_t_devices_name`(`channel_id`) USING BTREE
  ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '视频流表' ROW_FORMAT = Compact;
  
  SET FOREIGN_KEY_CHECKS = 1;
  