SET FOREIGN_KEY_CHECKS = 0;
use uav_dev;
CREATE TABLE `company_sort_order` (
  `company_id` int NOT NULL COMMENT '公司id',
  `company_name` varchar(254) DEFAULT NULL COMMENT '公司名称',
  `sort` int NOT NULL COMMENT '排序顺序 ,从小到大',
  PRIMARY KEY (`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='定制化公司排序顺序 ';
use uav_dev;
CREATE TABLE `uav_auth_5g` (
  `id` bigint NOT NULL COMMENT '主键id',
  `uav_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '中移凌云无人机编码',
  `gpsi` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'gpsi',
  `is_del` bit(1) DEFAULT b'0' COMMENT '是否删除',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
  `company_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '公司id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='无人机认证表';
use uav_dev;
CREATE TABLE `uav_auth_log` (
  `id` bigint NOT NULL COMMENT '主键id',
  `uav_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '认证无人id',
  `uav_id_5g` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '认证核心网无人机id',
  `auth_result` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '认证结果',
  `auth_time` datetime DEFAULT NULL COMMENT '认证时间',
  `gpsi` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'gpsi',
  `location_area_5g` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '5G的基站地址',
  `company_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '公司id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='无人机认证日志表';
use uav_industrial_portfolio;
CREATE TABLE `civil_military_alarm_his` (
  `id` bigint NOT NULL COMMENT '告警id',
  `aerocraft_type` int DEFAULT NULL COMMENT '飞行器类型，0：云平台无人机，1：基站探测到的飞行器',
  `aerocraft_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '飞行器id',
  `area_type` int DEFAULT NULL COMMENT '告警的区域类型，0：规划区域告警，1：基站探测区域告警',
  `order_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '飞行编号，仅无人机使用',
  `radar_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '基站雷达id，基站告警使用',
  `target_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '探测到的目标类型',
  `event` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '入侵事件，闯入：INTRUDE',
  `status` int DEFAULT NULL COMMENT '告警状态：0：告警中，1:告警结束',
  `company_id` bigint DEFAULT NULL COMMENT '公司id',
  `begin_time` datetime(6) DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime(6) DEFAULT NULL COMMENT '结束时间',
  `end_type` int DEFAULT NULL COMMENT '结束类型，0：自动结束，1：手动结束',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建用户id，如果是触发则为空',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新用户id',
  `is_del` bit(1) DEFAULT b'0' COMMENT '是否删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='通感告警历史记录';
use uav_industrial_portfolio;
CREATE TABLE `civil_military_statisic_bak` (
  `id` bigint NOT NULL COMMENT '主键id',
  `bts_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '基站id',
  `bts_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '基站编码',
  `dimension` int DEFAULT '0' COMMENT '维度（0:全部 1:年  2:月 3:周  4:日 ）',
  `dimension_value` int DEFAULT NULL COMMENT '年：2024，月202401，日20240101',
  `total` int DEFAULT NULL COMMENT '探测总架次',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_at` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_bts_statistic_dim` (`bts_code`,`dimension`,`dimension_value`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='基站探测统计表';
use uav_industrial_portfolio;
CREATE TABLE `police_device_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `device_id` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '设备id',
  `device_name` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '设备名称',
  `deleted` int DEFAULT NULL COMMENT '删除标记',
  `company_id` bigint DEFAULT NULL COMMENT '公司ID',
  `wgs84_lon` bigint DEFAULT NULL COMMENT 'WGS84坐标系经度',
  `wgs84_lat` bigint DEFAULT NULL COMMENT 'WGS84坐标系纬度',
  `alerter` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '告警人',
  `alerter_telephone` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '告警电话',
  `police_station` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所属派出所',
  `create_timestamp` bigint DEFAULT NULL COMMENT '创建信息时间戳',
  `update_timestamp` bigint DEFAULT NULL COMMENT '最后更新时间戳',
  `crime_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '案发地址',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1907599916368584706 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='设备信息表';
use uav_industrial_portfolio;
CREATE TABLE `violation_record` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录id',
  `label` int DEFAULT NULL COMMENT '1 发现垃圾， 2 违停占用 ，3 人员入侵',
  `address` varchar(254) DEFAULT NULL COMMENT '记录地址,用户输入',
  `dealt` int DEFAULT '0' COMMENT '是否处理 0 为处理,1 已处理,null 是没有处理',
  `image_file_id` varchar(255) DEFAULT NULL COMMENT '视频截图文件id',
  `latitude02` double DEFAULT NULL COMMENT '截图的纬度02',
  `longitude02` double DEFAULT NULL COMMENT '截图的经度02',
  `altitude` double DEFAULT NULL COMMENT '截图的海拔高度',
  `latitude84` double DEFAULT NULL COMMENT '截图的纬度84',
  `longitude84` double DEFAULT NULL COMMENT '截图的经度84',
  `company_id` int NOT NULL COMMENT '公司id',
  `deleted` int NOT NULL DEFAULT '0' COMMENT '0 未删除 1 删除',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='违规记录表';
use uav_lifecycle;
CREATE TABLE `bridge_device_mqtt_info` (
  `id` bigint NOT NULL COMMENT '序列',
  `provider_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '设备提供商id',
  `device_type` int DEFAULT NULL COMMENT '设备类型;0、5G-A基站，1、合作无人机，2、监管无人机，3、RemoteID无人机，4、雷达设备，5、频谱设备，6、光电设备，7、反制设备，8、诱骗设备，9、干扰设备，10、指挥车，11、察打一体，999、其他设备',
  `mqtt_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'MQTT账号名',
  `mqtt_password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'MQTT密码',
  `topic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'MQTT的topic;设备的topic 为：\r\n设备本身参数数据的Topic,bridge/{provider_code}/device/${device_type}/{deviceId},\r\n设备实时数据的Topic，bridge/{provider_code}/device_data/${device_type}/{deviceId}',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` bigint DEFAULT NULL COMMENT '更新人',
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='设备topic相关信息';
use uav_lifecycle;
CREATE TABLE `bridge_statistic` (
  `id` bigint NOT NULL COMMENT 'id',
  `topic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '数据的来源或去处',
  `point` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '统计指标点',
  `dimension` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '统计维度，deviceId/objectId...',
  `dimension_value` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '统计维度值：{deviceId}/{objectId}',
  `count` bigint DEFAULT NULL COMMENT '总数',
  `success_delay` bigint DEFAULT NULL COMMENT '总延迟',
  `min_delay` bigint DEFAULT NULL COMMENT '最低延迟',
  `max_delay` bigint DEFAULT NULL COMMENT '最大延迟',
  `success_count` bigint DEFAULT NULL COMMENT '成功总数，发布有成功与失败，订阅只有成功',
  `failure_count` bigint DEFAULT NULL COMMENT '失败总数',
  `time` datetime(6) DEFAULT NULL COMMENT '统计时间',
  PRIMARY KEY (`id`),
  KEY `idx_statistic_comp_id` (`topic`,`point`,`dimension`,`dimension_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='bridge统计表';
use uav_lifecycle;
CREATE TABLE `external_uav_detect_data` (
  `id` bigint NOT NULL COMMENT '自增ID',
  `type` varchar(100) NOT NULL COMMENT '数据类型：detect-轨迹；nofly-预警")',
  `param` json DEFAULT NULL COMMENT '参数体',
  `def_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  PRIMARY KEY (`id`),
  KEY `idx_external_uav_detect_data_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='无人机轨迹预测历史表';
use uav_lifecycle;
CREATE TABLE `photoelectric_alarm` (
  `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '告警ID',
  `camera_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '摄像头ID',
  `thumbnail_file_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '缩略图文件ID',
  `alarm_time` datetime DEFAULT NULL COMMENT '告警时间',
  `ai_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '目标类型：bird、drone',
  `bird` int DEFAULT NULL COMMENT '探测目标数量',
  `drone` int DEFAULT NULL COMMENT '探测目标数量',
  `file_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '文件ID',
  `deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除,0:否，1:是',
  `company_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '公司ID',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建者',
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='摄像头告警表';
use uav_lifecycle;
CREATE TABLE `regulator_defense_zone_choose` (
  `id` bigint NOT NULL COMMENT '主键',
  `defense_zone_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '防区id集合',
  `regulator_id` bigint NOT NULL COMMENT '监管员id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户防区选择映射表';
use uav_lifecycle;
CREATE TABLE `regulator_defense_zone_strategy` (
  `id` bigint NOT NULL COMMENT '主键id',
  `defense_zone_id` bigint NOT NULL COMMENT '防区id',
  `create_at` datetime(6) NOT NULL COMMENT '创建时间',
  `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '创建用户id',
  `defense_type` int DEFAULT NULL COMMENT '防区类型（0：核心区，1：处置区，2：预警区）',
  `sms_notice` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '闯入短信通知：接收人',
  `notice_time` int DEFAULT '10' COMMENT '系统提示音(1-10000)',
  `device_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '无人值守设备id集合',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='防区策略表';
use uav_lifecycle;
CREATE TABLE `regulator_detection_configure_info` (
  `id` bigint NOT NULL COMMENT '主键id',
  `ref_lat` decimal(20,7) DEFAULT NULL COMMENT '参考点02纬度',
  `ref_lng` decimal(20,7) DEFAULT NULL COMMENT '参考点02经度',
  `ref_wgs_lat` decimal(20,7) DEFAULT NULL COMMENT '参考点84纬度',
  `ref_wgs_lng` decimal(20,7) DEFAULT NULL COMMENT '参考点84经度',
  `configs` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '配置',
  `keep_duration` bigint DEFAULT NULL COMMENT '保存时间',
  `suppression_num` int DEFAULT NULL COMMENT '压制点数',
  `user_id` bigint DEFAULT NULL COMMENT '用户id',
  `user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用户名称',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `modify_time` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='参考点等信息的配置';
use uav_lifecycle;
CREATE TABLE `regulator_detection_statistic` (
  `id` bigint NOT NULL COMMENT '主键id',
  `device_comp_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备组合id',
  `provider_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '提供商编码',
  `device_type` int DEFAULT NULL COMMENT '设备类型',
  `device_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '设备id',
  `dimension` int DEFAULT NULL COMMENT '统计纬度，0：全部，1：年，2：月，3：周，4：日',
  `dimension_value` int DEFAULT NULL COMMENT '统计纬度值',
  `total` int DEFAULT NULL COMMENT '统计值',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_device_comp_id` (`device_comp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='设备探测统计表';
use uav_lifecycle;
CREATE TABLE `regulator_detection_track` (
  `id` bigint NOT NULL COMMENT '主键id',
  `device_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备id',
  `provider_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '提供商编码',
  `device_type` int DEFAULT NULL COMMENT '设备类型',
  `track_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标id',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='设备探测统计表';
use uav_lifecycle;
CREATE TABLE `regulator_radiomap` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `create_at` date DEFAULT NULL COMMENT '创建时间',
  `Longitude` double DEFAULT NULL COMMENT '经度',
  `Latitude` double DEFAULT NULL COMMENT '纬度',
  `height` double DEFAULT NULL COMMENT '高度',
  `value` double DEFAULT NULL COMMENT 'RSRP信号值',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=70197 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Radiomap数据';
use uav_lifecycle;
CREATE TABLE `regulator_warning_instance` (
  `id` bigint NOT NULL COMMENT '监管警情表',
  `regulator_defense_zone_id` bigint DEFAULT NULL COMMENT '监管防区id',
  `uav_model` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发现无人机型号',
  `uav_sn` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发现无人机SN',
  `uav_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '无人机地址',
  `identity` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '产品唯一识别码',
  `longitude` double DEFAULT NULL COMMENT '经度',
  `latitude` double DEFAULT NULL COMMENT '纬度',
  `pilot_lon` double DEFAULT NULL COMMENT '飞手经度',
  `pilot_lat` double DEFAULT NULL COMMENT '飞手纬度',
  `pilot_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '飞手地址',
  `height` double DEFAULT NULL COMMENT '高度',
  `telephone` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '通知手机号',
  `is_del` int NOT NULL DEFAULT '0' COMMENT '用户是否被删除，0：否，1：删除',
  `send_flag` int DEFAULT NULL COMMENT '是否发送成功，0失败，1:成功',
  `create_at` datetime(6) DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建用户',
  `update_at` datetime(6) DEFAULT NULL COMMENT '更新时间',
  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '更新用户',
  PRIMARY KEY (`id`),
  KEY `idx_warning_instance_createBy` (`create_by`) /*!80000 INVISIBLE */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='上报遥控器警情表';
use uav_mission;
CREATE TABLE `drone_info` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id,自增',
  `uav_name` varchar(100) NOT NULL COMMENT '无人机名称',
  `uav_code` varchar(20) NOT NULL COMMENT '无人机编号',
  `link_id` varchar(36) NOT NULL COMMENT '多机飞行任务id',
  `create_id` varchar(100) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `deleted` int(1) unsigned zerofill DEFAULT '0' COMMENT '0保留,1假删除',
  `sorted` int NOT NULL COMMENT '排序',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=589 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='多机任务-无人机信息';
use uav_mission;
CREATE TABLE `police_case_action` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键自增id',
  `uas_id` varchar(254) DEFAULT NULL COMMENT '无人机id',
  `action` varchar(32) DEFAULT NULL COMMENT '操作指令',
  `action_time` datetime DEFAULT NULL COMMENT '操作时间',
  `action_detail` varchar(254) DEFAULT NULL COMMENT '操作指令详情，补充信息',
  `police_case_code` varchar(64) DEFAULT NULL COMMENT '警情编号',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `deleted` int NOT NULL DEFAULT '0' COMMENT '是否删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_id` (`id`),
  KEY `idx_uas_id` (`uas_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='警情信息操作记录表';
use uav_mission;
CREATE TABLE `smart_link_mission` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id,自增',
  `mission_name` varchar(100) NOT NULL COMMENT '作业名称',
  `user_id` varchar(100) NOT NULL COMMENT '用户Id',
  `company_id` varchar(100) NOT NULL COMMENT '公司Id',
  `create_id` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_id` varchar(100) DEFAULT NULL COMMENT '更新人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted` int(1) unsigned zerofill DEFAULT '0' COMMENT '0保留,1假删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='智能网联作业信息关联表';
use uav_user;
CREATE TABLE `sys_zhongtai_user_mapping` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` int DEFAULT NULL COMMENT '用户id',
  `app_code` varchar(100) DEFAULT NULL COMMENT '待开通用户的能力应用编码。该编码为中台分配的应用编码',
  `open_userId_aaaS` varchar(100) DEFAULT NULL COMMENT '订单用户的中台账号Open user ID',
  `account_type_aaaS` varchar(10) DEFAULT NULL COMMENT '需要开通的账号类型',
  `open_userId_sub_account` varchar(100) DEFAULT NULL COMMENT '中台子账号Open user ID。当accountTypeAaaS=1时必填',
  `open_userId_app_account` varchar(100) DEFAULT NULL COMMENT '中台应用从账号Open user ID，当accountTypeAaaS=2时必填',
  `user_name` varchar(100) DEFAULT NULL COMMENT '帐号姓名',
  `org_code` varchar(100) DEFAULT NULL COMMENT '帐号归属的组织编码。如果是平台或平台类订购（utilityCode不为空，abilityCode为空），本编码orgCode可以为空。\r\n" +             "如果是能力订购（abilityCode不为空， utilityCode为空），本编码orgCode不可以为空。',
  `service_org_code` varchar(100) DEFAULT NULL COMMENT '帐号归属的服务机构编码',
  `mobile` varchar(100) DEFAULT NULL COMMENT '手机号',
  `accountDesc` varchar(100) DEFAULT NULL COMMENT '帐号描述',
  `sub_order_item_list` varchar(500) DEFAULT NULL COMMENT '账号的订购集合',
  `create_at` datetime DEFAULT NULL COMMENT '创建事件',
  `update_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='中台账号映射表';
SET FOREIGN_KEY_CHECKS = 1;
