大量更新
This commit is contained in:
173
999-数据库脚本/飞行服务/2.1/cmii_fly_center.sql
Normal file
173
999-数据库脚本/飞行服务/2.1/cmii_fly_center.sql
Normal file
@@ -0,0 +1,173 @@
|
||||
CREATE DATABASE IF NOT EXISTS `cmii_fly_center` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
use `cmii_fly_center`;
|
||||
|
||||
DROP TABLE IF EXISTS command_log;
|
||||
|
||||
DROP TABLE IF EXISTS drone_info;
|
||||
|
||||
DROP TABLE IF EXISTS file_records;
|
||||
|
||||
DROP TABLE IF EXISTS gateway_bound_info;
|
||||
|
||||
DROP TABLE IF EXISTS gateway_info;
|
||||
|
||||
DROP TABLE IF EXISTS storage_files;
|
||||
|
||||
DROP TABLE IF EXISTS track_order;
|
||||
|
||||
DROP TABLE IF EXISTS wayline_info;
|
||||
|
||||
DROP TABLE IF EXISTS wayline_info_history;
|
||||
|
||||
create table command_log
|
||||
(
|
||||
id bigint auto_increment comment '主键'
|
||||
primary key,
|
||||
drone_sn varchar(150) null comment '无人机 sn',
|
||||
gateway_sn varchar(150) null comment '网关序列号',
|
||||
gateway_type varchar(150) null comment '网关类型',
|
||||
cmd_id varchar(150) null comment '指令id',
|
||||
cmd_type varchar(150) not null comment '指令类型',
|
||||
cmd_params varchar(255) null comment '指令参数',
|
||||
response_data varchar(255) null comment '指令响应数据',
|
||||
error_msg varchar(255) null comment '指令错误信息',
|
||||
status int not null comment '指令状态',
|
||||
start_time datetime default now() null comment '指令开始时间',
|
||||
end_time datetime default now() null comment '指令结束时间',
|
||||
cost_time bigint null comment '指令耗时,单位 ms',
|
||||
trace_id varchar(255) null comment '追踪id'
|
||||
)
|
||||
comment '无人机指令日志';
|
||||
|
||||
create index command_log_cmd_type_index
|
||||
on command_log (cmd_type);
|
||||
|
||||
create index command_log_drone_sn_index
|
||||
on command_log (drone_sn);
|
||||
|
||||
create table drone_info
|
||||
(
|
||||
id bigint auto_increment comment '主键'
|
||||
primary key,
|
||||
sn varchar(150) not null comment '设备 SN',
|
||||
name varchar(100) null comment '无人机名称',
|
||||
manufacturer varchar(100) not null comment '厂家',
|
||||
model varchar(100) not null comment '型号,如果有子型号,拼接保存',
|
||||
version varchar(100) null comment '固件版本',
|
||||
offline_position varchar(255) null comment '无人机下线的时候最后的点位信息,json结构数据',
|
||||
constraint drone_info_pk_2
|
||||
unique (sn)
|
||||
)
|
||||
comment '设备信息';
|
||||
|
||||
create table file_records
|
||||
(
|
||||
id bigint auto_increment comment '主键'
|
||||
primary key,
|
||||
file_id varchar(255) not null comment '文件ID',
|
||||
file_name varchar(255) null comment '文件名称',
|
||||
content_type varchar(255) null comment '文件类型',
|
||||
signature varchar(255) null comment '文件签名',
|
||||
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
file_size bigint null comment '文件大小',
|
||||
constraint uniq_file_records_file_id
|
||||
unique (file_id)
|
||||
)
|
||||
comment '文件记录';
|
||||
|
||||
create table gateway_bound_info
|
||||
(
|
||||
id bigint auto_increment comment '主键'
|
||||
primary key,
|
||||
gateway_sn varchar(150) not null comment '网关 sn',
|
||||
drone_sn varchar(150) not null comment '无人机 sn',
|
||||
constraint uniq_gateway_bound_info_pk
|
||||
unique (drone_sn, gateway_sn)
|
||||
)
|
||||
comment '无人机设备绑定关系';
|
||||
|
||||
create index gateway_bound_info_gateway_sn_index
|
||||
on gateway_bound_info (gateway_sn);
|
||||
|
||||
create table gateway_info
|
||||
(
|
||||
id bigint auto_increment comment '主键'
|
||||
primary key,
|
||||
sn varchar(150) not null comment '网关 sn',
|
||||
type varchar(30) not null comment '类型',
|
||||
form int null comment '形态',
|
||||
model varchar(50) null comment '型号',
|
||||
name varchar(100) null comment '网关名称',
|
||||
version varchar(20) null comment '版本',
|
||||
stream_url varchar(255) null comment '推流地址[list]',
|
||||
constraint gateway_info_pk_2
|
||||
unique (sn)
|
||||
)
|
||||
comment '网关设备信息';
|
||||
|
||||
create table storage_files
|
||||
(
|
||||
id bigint auto_increment comment '文件ID'
|
||||
primary key,
|
||||
file_id char(36) not null comment '文件唯一标识',
|
||||
bucket varchar(64) not null comment 'OSS存储桶',
|
||||
object_path varchar(500) not null comment 'OSS对象路径',
|
||||
drone_sn char(32) null comment '无人机序列号',
|
||||
name varchar(255) not null comment '文件名称',
|
||||
type varchar(20) null comment '文件类型',
|
||||
size bigint unsigned default '0' null comment '文件大小(字节)',
|
||||
md5 char(32) null comment 'MD5哈希值',
|
||||
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
extra text null comment '额外信息',
|
||||
constraint uk_file_id
|
||||
unique (file_id)
|
||||
)
|
||||
comment '文件存储表' collate = utf8mb4_unicode_ci;
|
||||
|
||||
create index idx_drone_sn
|
||||
on storage_files (drone_sn);
|
||||
|
||||
create index idx_object_path
|
||||
on storage_files (object_path(191));
|
||||
|
||||
create table track_order
|
||||
(
|
||||
track_id varchar(255) not null comment '轨迹id'
|
||||
primary key,
|
||||
drone_sn varchar(255) not null comment '无人机id',
|
||||
gateway_sn varchar(255) not null comment '网关序列号',
|
||||
first_track_time datetime not null comment '轨迹开始时间',
|
||||
last_track_time datetime not null comment '轨迹结束时间',
|
||||
distance bigint not null comment '轨迹距离,单位 m',
|
||||
duration bigint not null comment '轨迹中时长,单位 s',
|
||||
first_latitude double not null comment '轨迹开始纬度',
|
||||
first_longitude double not null comment '轨迹开始经度',
|
||||
last_latitude double not null comment '轨迹结束纬度',
|
||||
last_longitude double not null comment '轨迹结束经度',
|
||||
gateway_type varchar(255) null comment '网关类型'
|
||||
)
|
||||
comment '无人机轨迹记录表';
|
||||
|
||||
create table wayline_info
|
||||
(
|
||||
id bigint auto_increment comment '主键 ID'
|
||||
primary key,
|
||||
created_at datetime default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
file_name varchar(255) not null comment '航线内容文件名称',
|
||||
file_path varchar(255) not null comment '文件在 OSS 的路径',
|
||||
file_md5 varchar(64) null comment '文件md5',
|
||||
content mediumtext not null comment 'JSON 格式的航线内容',
|
||||
drone_model varchar(255) null comment '无人机型号',
|
||||
payloads varchar(255) null comment '载荷型号列表',
|
||||
deleted int default 0 not null comment '是否删除,0 为未删除,1 为已删除'
|
||||
)
|
||||
comment '航线信息';
|
||||
|
||||
alter table wayline_info
|
||||
modify content mediumtext not null comment 'JSON 格式的航线内容';
|
||||
|
||||
ALTER TABLE storage_files
|
||||
ADD COLUMN pilot_photo_fingerprint VARCHAR(255) NULL DEFAULT NULL COMMENT 'pilot2上传的照片标识';
|
||||
|
||||
ALTER TABLE `wayline_info` ADD INDEX `idx_file_path` (`file_path`);
|
||||
1886
999-数据库脚本/飞行服务/2.1/cmii_sky_converge.sql
Normal file
1886
999-数据库脚本/飞行服务/2.1/cmii_sky_converge.sql
Normal file
File diff suppressed because one or more lines are too long
24
999-数据库脚本/飞行服务/2.1/cmii_sky_integration.sql
Normal file
24
999-数据库脚本/飞行服务/2.1/cmii_sky_integration.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS `cmii_sky_integration` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
use `cmii_sky_integration`;
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
DROP TABLE IF EXISTS `cmii_sky_integration`.`comparison_patch`;
|
||||
CREATE TABLE IF NOT EXISTS `cmii_sky_integration`.`comparison_patch` (
|
||||
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '图斑记录主键ID',
|
||||
task_id VARCHAR(64) NOT NULL COMMENT '检测任务ID',
|
||||
polygon TEXT NOT NULL COMMENT '多边形WKT格式字符串,顺时针、闭环',
|
||||
polygon_hash VARCHAR(64) NOT NULL COMMENT '多边形标准化后的SHA-256 Hash值',
|
||||
envelope TEXT NOT NULL COMMENT '外接矩形WKT格式字符串,包含 minX, maxX, minY, maxY',
|
||||
patches TEXT NOT NULL COMMENT '识别模型列表,存储ComparisonTarget对象列表的JSON串',
|
||||
center VARCHAR(128) NOT NULL COMMENT '变化图斑的中心经纬度,WKT格式:POINT (经度 纬度)',
|
||||
area DOUBLE NOT NULL COMMENT '变化图斑的面积,单位:平方m',
|
||||
create_time DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '记录创建时间(UTC时区)',
|
||||
deleted TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否删除:0-未删除,1-已删除',
|
||||
-- 主键与索引
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE INDEX idx_polygon_hash (task_id, polygon_hash) COMMENT '任务内多边形Hash唯一索引(防重复)',
|
||||
INDEX idx_task_id (task_id) COMMENT '任务ID索引(按任务查询图斑)',
|
||||
INDEX idx_create_time (create_time) COMMENT '创建时间索引(按时间筛选)'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='图斑对比补丁表';
|
||||
Reference in New Issue
Block a user