/*
 Navicat Premium Data Transfer

 Source Server         : yufeng
 Source Server Type    : PostgreSQL
 Source Server Version : 160004 (160004)
 Source Host           : 223.108.157.174:61603
 Source Catalog        : dj_api
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 160004 (160004)
 File Encoding         : 65001

 Date: 07/05/2026 12:59:24
*/


-- ----------------------------
-- Table structure for bus_cache
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_cache";
CREATE TABLE "public"."bus_cache"
(
    "id"          int8                                       NOT NULL,
    "key"         varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "value"       varchar(500) COLLATE "pg_catalog"."default",
    "create_date" timestamp(6),
    "update_date" timestamp(6)
)
;
COMMENT
ON TABLE "public"."bus_cache" IS '数据缓存表';

-- ----------------------------
-- Records of bus_cache
-- ----------------------------
INSERT INTO "public"."bus_cache"
VALUES (2048584968422133762, 'dock_video_id_8UUXP1P00A107D', '8UUXP1P00A107D/165-0-7/normal-0',
        '2026-04-27 10:08:12.007', '2026-05-07 08:54:54.217');
INSERT INTO "public"."bus_cache"
VALUES (2048584969063862274, 'uav_video_id_8UUXP1P00A107D', '1581F8HGX25CC00A17YS/99-0-0/normal-0',
        '2026-04-27 10:08:12.162', '2026-05-07 08:54:54.35');
INSERT INTO "public"."bus_cache"
VALUES (2048646967784923137, 'uav_video_id_1581F8HGX25CC00A17YS', '1581F8HGX25CC00A17YS/99-0-0/normal-0',
        '2026-04-27 14:14:33.811', '2026-04-27 14:15:21.798');

-- ----------------------------
-- Table structure for bus_dock
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_dock";
CREATE TABLE "public"."bus_dock"
(
    "id"               int8                                       NOT NULL,
    "dock_name"        varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "dock_sn"          varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "dock_type"        varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "dock_model"       varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "dept_id"          int8                                       NOT NULL,
    "dock_longitude"   float8,
    "dock_latitude"    float8,
    "dock_height"      float8,
    "deputy_longitude" float8,
    "deputy_latitude"  float8,
    "deputy_height"    float8,
    "remarks"          varchar(255) COLLATE "pg_catalog"."default",
    "del_flag"         int2                                       NOT NULL DEFAULT 0,
    "creator"          int8,
    "create_date"      timestamp(6),
    "updater"          int8,
    "update_date"      timestamp(6)
)
;
COMMENT
ON COLUMN "public"."bus_dock"."id" IS '主键';
COMMENT
ON COLUMN "public"."bus_dock"."dock_name" IS '机库名称';
COMMENT
ON COLUMN "public"."bus_dock"."dock_sn" IS 'SN码';
COMMENT
ON COLUMN "public"."bus_dock"."dock_type" IS '机库类型';
COMMENT
ON COLUMN "public"."bus_dock"."dock_model" IS '机库型号';
COMMENT
ON COLUMN "public"."bus_dock"."dept_id" IS '所属部门';
COMMENT
ON COLUMN "public"."bus_dock"."dock_longitude" IS '机库经度';
COMMENT
ON COLUMN "public"."bus_dock"."dock_latitude" IS '机库纬度';
COMMENT
ON COLUMN "public"."bus_dock"."dock_height" IS '机库高度（椭球高）';
COMMENT
ON COLUMN "public"."bus_dock"."deputy_longitude" IS '备降点经度';
COMMENT
ON COLUMN "public"."bus_dock"."deputy_latitude" IS '备降点纬度';
COMMENT
ON COLUMN "public"."bus_dock"."deputy_height" IS '备降点高度';
COMMENT
ON COLUMN "public"."bus_dock"."remarks" IS '备注';
COMMENT
ON COLUMN "public"."bus_dock"."del_flag" IS '删除标志：-1：已删除  0：未删除';
COMMENT
ON TABLE "public"."bus_dock" IS '机库信息表';

-- ----------------------------
-- Records of bus_dock
-- ----------------------------
INSERT INTO "public"."bus_dock"
VALUES (2045078929596768257, '大疆机场3', '8UUXP1P00A107D', 'DJI', 'dock_3', 1067246875800000066, NULL, NULL, NULL,
        NULL, NULL, NULL, '用来测试的机场，请勿删除', 0, 1067246875800000001, '2026-04-17 17:56:27.202',
        1067246875800000001, '2026-04-17 18:00:43.103');

-- ----------------------------
-- Table structure for bus_dock_device
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_dock_device";
CREATE TABLE "public"."bus_dock_device"
(
    "id"                  int8 NOT NULL,
    "sn"                  varchar(50) COLLATE "pg_catalog"."default",
    "device_model_key"    varchar(50) COLLATE "pg_catalog"."default",
    "device_binding_code" varchar(50) COLLATE "pg_catalog"."default",
    "organization_id"     varchar(50) COLLATE "pg_catalog"."default",
    "device_callsign"     varchar(50) COLLATE "pg_catalog"."default",
    "parent_sn"           varchar(50) COLLATE "pg_catalog"."default",
    "bind_date"           timestamp(6),
    "domain"              int4,
    "device_type"         int4,
    "sub_type"            int4,
    "update_date"         timestamp(6),
    "device_secret"       varchar(255) COLLATE "pg_catalog"."default",
    "nonce"               varchar(255) COLLATE "pg_catalog"."default",
    "thing_version"       varchar(255) COLLATE "pg_catalog"."default",
    "device_name"         varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT
ON COLUMN "public"."bus_dock_device"."sn" IS '设备序列号';
COMMENT
ON COLUMN "public"."bus_dock_device"."device_model_key" IS '产品型号';
COMMENT
ON COLUMN "public"."bus_dock_device"."device_binding_code" IS '设备绑定码';
COMMENT
ON COLUMN "public"."bus_dock_device"."organization_id" IS '组织 ID';
COMMENT
ON COLUMN "public"."bus_dock_device"."device_callsign" IS '设备在组织中的名称';
COMMENT
ON COLUMN "public"."bus_dock_device"."parent_sn" IS '父类（飞机的父类是机场）';
COMMENT
ON COLUMN "public"."bus_dock_device"."bind_date" IS '绑定时间';
COMMENT
ON COLUMN "public"."bus_dock_device"."domain" IS '领域';
COMMENT
ON COLUMN "public"."bus_dock_device"."device_type" IS '设备类型';
COMMENT
ON COLUMN "public"."bus_dock_device"."sub_type" IS '设备子类型';
COMMENT
ON COLUMN "public"."bus_dock_device"."update_date" IS '更新时间';
COMMENT
ON COLUMN "public"."bus_dock_device"."device_secret" IS '设备密钥';
COMMENT
ON COLUMN "public"."bus_dock_device"."nonce" IS 'nonce';
COMMENT
ON COLUMN "public"."bus_dock_device"."thing_version" IS '设备物模型版本';
COMMENT
ON COLUMN "public"."bus_dock_device"."device_name" IS '设备名称';
COMMENT
ON TABLE "public"."bus_dock_device" IS '机场设备信息';

-- ----------------------------
-- Primary Key structure for table bus_dock_device
-- ----------------------------
ALTER TABLE "public"."bus_dock_device"
    ADD CONSTRAINT "bus_dock_device_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Table structure for bus_flight_task
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_flight_task";
CREATE TABLE "public"."bus_flight_task"
(
    "task_id"                 varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "task_type"               int2,
    "dock_sn"                 varchar(50) COLLATE "pg_catalog"."default",
    "dock_name"               varchar(50) COLLATE "pg_catalog"."default",
    "dock_type"               varchar(50) COLLATE "pg_catalog"."default",
    "dock_model"              varchar(50) COLLATE "pg_catalog"."default",
    "route_id"                int8,
    "route_name"              varchar(50) COLLATE "pg_catalog"."default",
    "route_type"              varchar(50) COLLATE "pg_catalog"."default",
    "route_distance"          float8,
    "waypoint_num"            int4,
    "dept_id"                 int8,
    "task_status"             int2,
    "flight_distance"         float8,
    "flight_duration"         int8,
    "flight_duration_text"    varchar(50) COLLATE "pg_catalog"."default",
    "media_num"               int4,
    "is_breakpoint_fly"       bool,
    "breakpoint_fly_max_time" varchar(50) COLLATE "pg_catalog"."default",
    "breakpoint_fly_min_time" varchar(50) COLLATE "pg_catalog"."default",
    "outbound_date"           timestamp(6),
    "inbound_date"            timestamp(6),
    "create_date"             timestamp(6),
    "creator"                 int8,
    "create_name"             varchar(50) COLLATE "pg_catalog"."default",
    "failure_reason"          varchar(2000) COLLATE "pg_catalog"."default",
    "uav_sn"                  varchar(50) COLLATE "pg_catalog"."default"
)
;
COMMENT
ON COLUMN "public"."bus_flight_task"."task_id" IS '任务标识';
COMMENT
ON COLUMN "public"."bus_flight_task"."task_type" IS '任务类型 (1航线飞行 2手动飞行 3定时飞行)';
COMMENT
ON COLUMN "public"."bus_flight_task"."dock_sn" IS '机库SN';
COMMENT
ON COLUMN "public"."bus_flight_task"."dock_name" IS '机库名称';
COMMENT
ON COLUMN "public"."bus_flight_task"."dock_type" IS '机库类型';
COMMENT
ON COLUMN "public"."bus_flight_task"."dock_model" IS '机库型号';
COMMENT
ON COLUMN "public"."bus_flight_task"."route_id" IS '航线标识';
COMMENT
ON COLUMN "public"."bus_flight_task"."route_name" IS '航线名称';
COMMENT
ON COLUMN "public"."bus_flight_task"."route_type" IS '航线类型';
COMMENT
ON COLUMN "public"."bus_flight_task"."route_distance" IS '航线距离';
COMMENT
ON COLUMN "public"."bus_flight_task"."waypoint_num" IS '航点数量';
COMMENT
ON COLUMN "public"."bus_flight_task"."dept_id" IS '部门标识';
COMMENT
ON COLUMN "public"."bus_flight_task"."task_status" IS '任务状态（0进行中、-1失败、1完成、2阻飞）';
COMMENT
ON COLUMN "public"."bus_flight_task"."flight_distance" IS '飞行距离';
COMMENT
ON COLUMN "public"."bus_flight_task"."flight_duration" IS '飞行时长（秒）';
COMMENT
ON COLUMN "public"."bus_flight_task"."flight_duration_text" IS '飞行时长';
COMMENT
ON COLUMN "public"."bus_flight_task"."media_num" IS '媒体数量';
COMMENT
ON COLUMN "public"."bus_flight_task"."is_breakpoint_fly" IS '是否断点续飞';
COMMENT
ON COLUMN "public"."bus_flight_task"."breakpoint_fly_max_time" IS '断点续飞最大时间';
COMMENT
ON COLUMN "public"."bus_flight_task"."breakpoint_fly_min_time" IS '断点续飞最小时间';
COMMENT
ON COLUMN "public"."bus_flight_task"."outbound_date" IS '出库时间';
COMMENT
ON COLUMN "public"."bus_flight_task"."inbound_date" IS '入库时间';
COMMENT
ON COLUMN "public"."bus_flight_task"."create_date" IS '任务时间';
COMMENT
ON COLUMN "public"."bus_flight_task"."creator" IS '操作人';
COMMENT
ON COLUMN "public"."bus_flight_task"."create_name" IS '操作人名称';
COMMENT
ON COLUMN "public"."bus_flight_task"."failure_reason" IS '失败原因';
COMMENT
ON COLUMN "public"."bus_flight_task"."uav_sn" IS '飞机SN';
COMMENT
ON TABLE "public"."bus_flight_task" IS '飞行任务表';

-- ----------------------------
-- Records of bus_flight_task
-- ----------------------------
INSERT INTO "public"."bus_flight_task"
VALUES ('d832f33af1324ff3aae4e645840844db', 2, '8UUXP1P00A107D', '大疆机场3', 'DJI', 'dock_3', NULL, '一键起飞', NULL,
        NULL, NULL, NULL, 1, 72.43575327979067, 280, '4分40秒', 0, NULL, NULL, NULL, '2026-05-06 15:29:30.537',
        '2026-05-06 15:34:50.709', '2026-05-06 15:29:30.442', 1067246875800000001, '管理员', NULL,
        '1581F8HGX25CC00A17YS');
INSERT INTO "public"."bus_flight_task"
VALUES ('fc99dc1ba555460d98c0f5a4e7a3f778', 2, '8UUXP1P00A107D', '大疆机场3', 'DJI', 'dock_3', NULL, '一键起飞', NULL,
        NULL, NULL, NULL, 1, 38.044151644786616, 182, '3分2秒', 0, NULL, NULL, NULL, '2026-05-06 15:45:30.774',
        '2026-05-06 15:49:13.416', '2026-05-06 15:45:29.593', 1067246875800000001, '管理员', NULL,
        '1581F8HGX25CC00A17YS');
INSERT INTO "public"."bus_flight_task"
VALUES ('a8447450637743be93c307d1378798c5', 2, '8UUXP1P00A107D', '大疆机场3', 'DJI', 'dock_3', NULL, '一键起飞', NULL,
        NULL, NULL, NULL, 1, 0, 0, '0秒', 0, NULL, NULL, NULL, '2026-05-06 18:38:58.569', '2026-05-06 18:38:59.77',
        '2026-05-06 18:38:58.126', 1067246875800000001, '管理员', NULL, '1581F8HGX25CC00A17YS');
INSERT INTO "public"."bus_flight_task"
VALUES ('61c278d6188d4e918c140105689d3d47', 2, '8UUXP1P00A107D', '大疆机场3', 'DJI', 'dock_3', NULL, '一键起飞', NULL,
        NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-05-06 18:39:24.652', NULL,
        '2026-05-06 18:39:24.605', 1067246875800000001, '管理员', NULL, '1581F8HGX25CC00A17YS');
INSERT INTO "public"."bus_flight_task"
VALUES ('ae91b3eaa6fd43a1be40dd168c32037e', 2, '8UUXP1P00A107D', '大疆机场3', 'DJI', 'dock_3', NULL, '一键起飞', NULL,
        NULL, NULL, NULL, 1, 28.26631399943016, 919, '15分19秒', 0, NULL, NULL, NULL, '2026-05-06 18:53:41.778',
        '2026-05-06 19:09:42.477', '2026-05-06 18:53:40.621', 1067246875800000001, '管理员', NULL,
        '1581F8HGX25CC00A17YS');
INSERT INTO "public"."bus_flight_task"
VALUES ('938ca1d9c6f54dc78f6c19e80345bbe4', 2, '8UUXP1P00A107D', '大疆机场3', 'DJI', 'dock_3', NULL, '一键起飞', NULL,
        NULL, NULL, NULL, 1, 5.303456071763803, 256, '4分16秒', 0, NULL, NULL, NULL, '2026-05-07 08:50:14.861',
        '2026-05-07 08:55:12.935', '2026-05-07 08:50:13.976', 1067246875800000001, '管理员', NULL,
        '1581F8HGX25CC00A17YS');

-- ----------------------------
-- Table structure for bus_media_file
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_media_file";
CREATE TABLE "public"."bus_media_file"
(
    "id"                int8 NOT NULL,
    "task_id"           varchar(32) COLLATE "pg_catalog"."default",
    "dock_sn"           varchar(32) COLLATE "pg_catalog"."default",
    "drone_model_key"   varchar(32) COLLATE "pg_catalog"."default",
    "payload_model_key" varchar(32) COLLATE "pg_catalog"."default",
    "original"          bool,
    "name"              varchar(128) COLLATE "pg_catalog"."default",
    "object_key"        varchar(512) COLLATE "pg_catalog"."default",
    "path"              varchar(256) COLLATE "pg_catalog"."default",
    "longitude"         varchar(32) COLLATE "pg_catalog"."default",
    "latitude"          varchar(32) COLLATE "pg_catalog"."default",
    "relative_altitude" varchar(32) COLLATE "pg_catalog"."default",
    "absolute_altitude" varchar(32) COLLATE "pg_catalog"."default",
    "gimbal_yaw_degree" varchar(32) COLLATE "pg_catalog"."default",
    "sub_file_type"     varchar(64) COLLATE "pg_catalog"."default",
    "created_time"      timestamp(6),
    "create_date"       timestamp(6)
)
;
COMMENT
ON COLUMN "public"."bus_media_file"."id" IS '主键';
COMMENT
ON COLUMN "public"."bus_media_file"."task_id" IS '架次编号';
COMMENT
ON COLUMN "public"."bus_media_file"."dock_sn" IS '设备编号';
COMMENT
ON COLUMN "public"."bus_media_file"."drone_model_key" IS '飞行型号';
COMMENT
ON COLUMN "public"."bus_media_file"."payload_model_key" IS '云台型号';
COMMENT
ON COLUMN "public"."bus_media_file"."original" IS '是否原文件';
COMMENT
ON COLUMN "public"."bus_media_file"."name" IS '文件名称';
COMMENT
ON COLUMN "public"."bus_media_file"."object_key" IS '文件路径';
COMMENT
ON COLUMN "public"."bus_media_file"."path" IS '文件的业务路径';
COMMENT
ON COLUMN "public"."bus_media_file"."longitude" IS '拍摄经度';
COMMENT
ON COLUMN "public"."bus_media_file"."latitude" IS '拍摄纬度';
COMMENT
ON COLUMN "public"."bus_media_file"."relative_altitude" IS '相对高度';
COMMENT
ON COLUMN "public"."bus_media_file"."absolute_altitude" IS '海拔高度';
COMMENT
ON COLUMN "public"."bus_media_file"."gimbal_yaw_degree" IS '云台偏航角';
COMMENT
ON COLUMN "public"."bus_media_file"."sub_file_type" IS '文件类型';
COMMENT
ON COLUMN "public"."bus_media_file"."created_time" IS '拍摄时间';
COMMENT
ON COLUMN "public"."bus_media_file"."create_date" IS '事件收到时间';
COMMENT
ON TABLE "public"."bus_media_file" IS '媒体资源';

-- ----------------------------
-- Records of bus_media_file
-- ----------------------------
INSERT INTO "public"."bus_media_file"
VALUES (2051932313717157889, 'fc99dc1ba555460d98c0f5a4e7a3f778', '8UUXP1P00A107D', '0-100-1', '1-99-0', 't',
        'DJI_20260506154718_0001_T.jpeg',
        '8UUXP1P00A107D/fc99dc1ba555460d98c0f5a4e7a3f778/Remote-Control/DJI_20260506154718_0001_T.jpeg',
        'Remote-Control', '120.76659833333333', '31.029660305555556', '100.524', '131.651', '-3.2', NULL,
        '2026-05-06 15:47:18', '2026-05-06 15:49:21.306');
INSERT INTO "public"."bus_media_file"
VALUES (2051932314887368706, 'fc99dc1ba555460d98c0f5a4e7a3f778', '8UUXP1P00A107D', '0-100-1', '1-99-0', 't',
        'DJI_20260506154717_0001_V.jpeg',
        '8UUXP1P00A107D/fc99dc1ba555460d98c0f5a4e7a3f778/Remote-Control/DJI_20260506154717_0001_V.jpeg',
        'Remote-Control', '120.76659833333333', '31.029660333333332', '100.531', '131.651', '-3.2', NULL,
        '2026-05-06 15:47:17', '2026-05-06 15:49:21.585');
INSERT INTO "public"."bus_media_file"
VALUES (2051932334646734850, 'fc99dc1ba555460d98c0f5a4e7a3f778', '8UUXP1P00A107D', '0-100-1', '1-99-0', 't',
        'DJI_20260506154719_0003_T.jpeg',
        '8UUXP1P00A107D/fc99dc1ba555460d98c0f5a4e7a3f778/Remote-Control/DJI_20260506154719_0003_T.jpeg',
        'Remote-Control', '120.76659841666667', '31.029660055555553', '100.528', '131.652', '-3.1', NULL,
        '2026-05-06 15:47:19', '2026-05-06 15:49:26.299');
INSERT INTO "public"."bus_media_file"
VALUES (2051932336076992514, 'fc99dc1ba555460d98c0f5a4e7a3f778', '8UUXP1P00A107D', '0-100-1', '1-99-0', 't',
        'DJI_20260506154718_0003_V.jpeg',
        '8UUXP1P00A107D/fc99dc1ba555460d98c0f5a4e7a3f778/Remote-Control/DJI_20260506154718_0003_V.jpeg',
        'Remote-Control', '120.7665983888889', '31.029660055555553', '100.53', '131.653', '-3.2', NULL,
        '2026-05-06 15:47:18', '2026-05-06 15:49:26.638');

-- ----------------------------
-- Table structure for bus_route
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_route";
CREATE TABLE "public"."bus_route"
(
    "id"                        int8                                       NOT NULL,
    "route_name"                varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "template_type"             varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "height_model"              varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "flight_speed"              float4                                     NOT NULL,
    "flight_height"             float4                                     NOT NULL,
    "global_rth_height"         float4                                     NOT NULL,
    "finish_action"             varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "exit_on_rc_lost"           varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "execute_rc_lost_action"    varchar(50) COLLATE "pg_catalog"."default",
    "global_transitional_speed" float4                                     NOT NULL,
    "fly_to_wayline_mode"       varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "dock_sn"                   varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "dept_id"                   int8,
    "img_url"                   varchar(255) COLLATE "pg_catalog"."default",
    "kmz_url"                   varchar(255) COLLATE "pg_catalog"."default",
    "waypoint_num"              int4,
    "total_distance"            float4                                     NOT NULL,
    "expect_flight_time"        varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "is_accurate_import"        bool                                       NOT NULL,
    "del_flag"                  int2 DEFAULT 0,
    "creator"                   int8,
    "create_date"               timestamp(6),
    "updater"                   int8,
    "update_date"               timestamp(6),
    "takeoff_security_height"   float4                                     NOT NULL
)
;
COMMENT
ON COLUMN "public"."bus_route"."route_name" IS '航线名称';
COMMENT
ON COLUMN "public"."bus_route"."template_type" IS '航线类型';
COMMENT
ON COLUMN "public"."bus_route"."height_model" IS '高度模式';
COMMENT
ON COLUMN "public"."bus_route"."flight_speed" IS '飞行速度';
COMMENT
ON COLUMN "public"."bus_route"."flight_height" IS '飞行高度';
COMMENT
ON COLUMN "public"."bus_route"."global_rth_height" IS '返航高度';
COMMENT
ON COLUMN "public"."bus_route"."finish_action" IS '结束动作';
COMMENT
ON COLUMN "public"."bus_route"."exit_on_rc_lost" IS '失控操作';
COMMENT
ON COLUMN "public"."bus_route"."execute_rc_lost_action" IS '失控动作';
COMMENT
ON COLUMN "public"."bus_route"."global_transitional_speed" IS '全局航线过渡速度';
COMMENT
ON COLUMN "public"."bus_route"."fly_to_wayline_mode" IS '飞向首航点模式';
COMMENT
ON COLUMN "public"."bus_route"."dock_sn" IS '机库SN码';
COMMENT
ON COLUMN "public"."bus_route"."dept_id" IS '所属部门';
COMMENT
ON COLUMN "public"."bus_route"."img_url" IS '图片地址';
COMMENT
ON COLUMN "public"."bus_route"."kmz_url" IS 'kmz地址';
COMMENT
ON COLUMN "public"."bus_route"."waypoint_num" IS '航点个数';
COMMENT
ON COLUMN "public"."bus_route"."total_distance" IS '总距离';
COMMENT
ON COLUMN "public"."bus_route"."expect_flight_time" IS '预计飞行时长';
COMMENT
ON COLUMN "public"."bus_route"."is_accurate_import" IS '是否精准导入';
COMMENT
ON COLUMN "public"."bus_route"."del_flag" IS '删除标志';
COMMENT
ON COLUMN "public"."bus_route"."takeoff_security_height" IS '安全起飞高度';
COMMENT
ON TABLE "public"."bus_route" IS '航线信息表';

-- ----------------------------
-- Records of bus_route
-- ----------------------------
INSERT INTO "public"."bus_route"
VALUES (2046177902147403777, '测试航线', 'waypoint', 'relativeToStartPoint', 5, 100, 100, 'goHome', 'executeLostAction',
        'goBack', 15, 'safely', '4TADL2L001003D', NULL, '', '', 2, 15, '20min', 'f', 0, 1067246875800000001,
        '2026-04-20 18:43:22.678', 1067246875800000001, '2026-04-20 18:43:22.678', 100);
INSERT INTO "public"."bus_route"
VALUES (2046178604949266433, '测试航线3', 'waypoint', 'relativeToStartPoint', 5, 100, 100, 'goHome',
        'executeLostAction', 'goBack', 15, 'safely', '4TADL2L001003D', NULL, '', '', 2, 15, '20min', 'f', -1,
        1067246875800000001, '2026-04-20 18:46:10.237', 1067246875800000001, '2026-04-21 11:04:13.025', 100);
INSERT INTO "public"."bus_route"
VALUES (2046178094905032705, '测试航线2', 'waypoint', 'relativeToStartPoint', 5, 100, 100, 'goHome',
        'executeLostAction', 'goBack', 15, 'safely', '4TADL2L001003D', NULL, '', '', 2, 15, '20min', 'f', -1,
        1067246875800000001, '2026-04-20 18:44:08.634', 1067246875800000001, '2026-04-21 11:06:57.293', 100);
INSERT INTO "public"."bus_route"
VALUES (2046489367794491394, '测试航线3', 'waypoint', 'relativeToStartPoint', 5, 100, 100, 'goHome',
        'executeLostAction', 'goBack', 15, 'safely', '4TADL2L001003D', NULL, '',
        'route-kmz/4TADL2L001003D/20260421153130.kmz', 2, 15, '20min', 'f', 0, 1067246875800000001,
        '2026-04-21 15:21:01.873', 1067246875800000001, '2026-04-21 15:31:30.802', 100);

-- ----------------------------
-- Table structure for bus_route_waypoint
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_route_waypoint";
CREATE TABLE "public"."bus_route_waypoint"
(
    "id"                         int8                                       NOT NULL,
    "route_id"                   int8                                       NOT NULL,
    "longitude"                  float8                                     NOT NULL,
    "latitude"                   float8                                     NOT NULL,
    "flight_speed"               float4                                     NOT NULL,
    "flight_height"              float4                                     NOT NULL,
    "follow_route_speed"         bool                                       NOT NULL,
    "follow_route_height"        bool                                       NOT NULL,
    "waypoint_heading_mode"      varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "waypoint_heading_angle"     varchar(50) COLLATE "pg_catalog"."default",
    "waypoint_poi_point"         varchar(100) COLLATE "pg_catalog"."default",
    "waypoint_truning_mode"      varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "waypoint_turn_damping_dist" varchar(50) COLLATE "pg_catalog"."default",
    "waypoint_sort"              int4                                       NOT NULL,
    "waypoint_heading_path_mode" varchar(50) COLLATE "pg_catalog"."default" NOT NULL
)
;
COMMENT
ON COLUMN "public"."bus_route_waypoint"."route_id" IS '航线标识';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."longitude" IS '经度';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."latitude" IS '纬度';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."flight_speed" IS '飞行速度';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."flight_height" IS '飞行高度';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."follow_route_speed" IS '跟随航线速度';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."follow_route_height" IS '跟随航线高度';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."waypoint_heading_mode" IS '飞行器偏航角模式';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."waypoint_heading_angle" IS '飞行器偏航角度';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."waypoint_poi_point" IS '兴趣点';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."waypoint_truning_mode" IS '航点转弯模式';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."waypoint_turn_damping_dist" IS '航点转弯截距';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."waypoint_sort" IS '航点顺序';
COMMENT
ON COLUMN "public"."bus_route_waypoint"."waypoint_heading_path_mode" IS '飞行器偏航角转向';
COMMENT
ON TABLE "public"."bus_route_waypoint" IS '航线航点信息';

-- ----------------------------
-- Records of bus_route_waypoint
-- ----------------------------
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046177902235484161, 2046177902147403777, 120.766629244, 31.029103682, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 0, 'clockwise');
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046177902273232897, 2046177902147403777, 120.766908194, 31.028986032, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 1, 'clockwise');
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046178094946975746, 2046178094905032705, 120.766629244, 31.029103682, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 0, 'clockwise');
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046178094984724481, 2046178094905032705, 120.766908194, 31.028986032, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 1, 'clockwise');
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046178604999598081, 2046178604949266433, 120.766629244, 31.029103682, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 0, 'clockwise');
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046178605033152514, 2046178604949266433, 120.766908194, 31.028986032, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 1, 'clockwise');
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046492006275883010, 2046489367794491394, 120.766629244, 31.029103682, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 0, 'clockwise');
INSERT INTO "public"."bus_route_waypoint"
VALUES (2046492006322020353, 2046489367794491394, 120.766908194, 31.028986032, 5, 100, 't', 't', 'followWayline', '',
        '', 'toPointAndStopWithDiscontinuityCurvature', '', 1, 'clockwise');

-- ----------------------------
-- Table structure for bus_srs_record
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_srs_record";
CREATE TABLE "public"."bus_srs_record"
(
    "id"          int8 NOT NULL,
    "app"         varchar(255) COLLATE "pg_catalog"."default",
    "stream"      varchar(255) COLLATE "pg_catalog"."default",
    "file"        varchar(255) COLLATE "pg_catalog"."default",
    "stream_url"  varchar(255) COLLATE "pg_catalog"."default",
    "record_date" timestamp(6),
    "create_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."bus_srs_record"."app" IS '应用名，表示流所属的应用';
COMMENT
ON COLUMN "public"."bus_srs_record"."stream" IS '流名称，即被录制的流的名字';
COMMENT
ON COLUMN "public"."bus_srs_record"."file" IS '文件路径，代表录制文件在服务器上的存储位置';
COMMENT
ON COLUMN "public"."bus_srs_record"."stream_url" IS '流地址';
COMMENT
ON TABLE "public"."bus_srs_record" IS '直播流记录';

-- ----------------------------
-- Records of bus_srs_record
-- ----------------------------

-- ----------------------------
-- Table structure for bus_waypoint_action
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_waypoint_action";
CREATE TABLE "public"."bus_waypoint_action"
(
    "id"           int8                                       NOT NULL,
    "route_id"     int8                                       NOT NULL,
    "waypoint_id"  int8                                       NOT NULL,
    "action_type"  varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "action_value" varchar(50) COLLATE "pg_catalog"."default",
    "action_sort"  int4                                       NOT NULL
)
;
COMMENT
ON COLUMN "public"."bus_waypoint_action"."route_id" IS '航线标识';
COMMENT
ON COLUMN "public"."bus_waypoint_action"."waypoint_id" IS '航点标识';
COMMENT
ON COLUMN "public"."bus_waypoint_action"."action_type" IS '动作类型';
COMMENT
ON COLUMN "public"."bus_waypoint_action"."action_value" IS '动作值';
COMMENT
ON COLUMN "public"."bus_waypoint_action"."action_sort" IS '动作顺序';
COMMENT
ON TABLE "public"."bus_waypoint_action" IS '航点动作信息';

-- ----------------------------
-- Records of bus_waypoint_action
-- ----------------------------

-- ----------------------------
-- Table structure for schedule_job
DROP TABLE IF EXISTS "public"."schedule_job";
CREATE TABLE "public"."schedule_job"
(
    "id"                int8 NOT NULL,
    "bean_name"         varchar(200) COLLATE "pg_catalog"."default",
    "params"            varchar(2000) COLLATE "pg_catalog"."default",
    "cron_expression"   varchar(100) COLLATE "pg_catalog"."default",
    "status"            int4,
    "remark"            varchar(255) COLLATE "pg_catalog"."default",
    "creator"           int8,
    "create_date"       timestamp(6),
    "updater"           int8,
    "update_date"       timestamp(6),
    "job_name"          varchar(50) COLLATE "pg_catalog"."default",
    "cron_type"         int4,
    "year"              int4,
    "month"             int4,
    "days"              varchar(100) COLLATE "pg_catalog"."default",
    "hour"              int4,
    "minute"            int4,
    "dept_id"           int8,
    "params_remark"     varchar(200) COLLATE "pg_catalog"."default",
    "dock_sn"           varchar(50) COLLATE "pg_catalog"."default",
    "is_breakpoint_fly" bool,
    "break_max_time"    varchar(50) COLLATE "pg_catalog"."default",
    "break_min_time"    varchar(50) COLLATE "pg_catalog"."default"
)
;
COMMENT
ON COLUMN "public"."schedule_job"."id" IS 'id';
COMMENT
ON COLUMN "public"."schedule_job"."bean_name" IS 'spring bean名称';
COMMENT
ON COLUMN "public"."schedule_job"."params" IS '参数';
COMMENT
ON COLUMN "public"."schedule_job"."cron_expression" IS 'cron表达式';
COMMENT
ON COLUMN "public"."schedule_job"."status" IS '任务状态  0：暂停  1：正常  -1：失效';
COMMENT
ON COLUMN "public"."schedule_job"."remark" IS '备注';
COMMENT
ON COLUMN "public"."schedule_job"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."schedule_job"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."schedule_job"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."schedule_job"."update_date" IS '更新时间';
COMMENT
ON COLUMN "public"."schedule_job"."job_name" IS '任务名称';
COMMENT
ON COLUMN "public"."schedule_job"."cron_type" IS '定时类型 1指定时间 2每天几点 3每周周几几点 4每月几号几点';
COMMENT
ON COLUMN "public"."schedule_job"."year" IS '年';
COMMENT
ON COLUMN "public"."schedule_job"."month" IS '月';
COMMENT
ON COLUMN "public"."schedule_job"."days" IS '日';
COMMENT
ON COLUMN "public"."schedule_job"."hour" IS '时';
COMMENT
ON COLUMN "public"."schedule_job"."minute" IS '分';
COMMENT
ON COLUMN "public"."schedule_job"."dept_id" IS '部门标识';
COMMENT
ON COLUMN "public"."schedule_job"."params_remark" IS '参数备注';
COMMENT
ON COLUMN "public"."schedule_job"."dock_sn" IS '机库sn';
COMMENT
ON COLUMN "public"."schedule_job"."is_breakpoint_fly" IS '是否断点续飞';
COMMENT
ON COLUMN "public"."schedule_job"."break_max_time" IS '断点续飞最大时间';
COMMENT
ON COLUMN "public"."schedule_job"."break_min_time" IS '断点续飞最小时间';
COMMENT
ON TABLE "public"."schedule_job" IS '定时任务';
-- ----------------------------
-- Table structure for schedule_job_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."schedule_job_log";
CREATE TABLE "public"."schedule_job_log"
(
    "id"          int8 NOT NULL,
    "job_id"      int8 NOT NULL,
    "bean_name"   varchar(200) COLLATE "pg_catalog"."default",
    "params"      varchar(2000) COLLATE "pg_catalog"."default",
    "status"      int4,
    "error"       varchar(2000) COLLATE "pg_catalog"."default",
    "times"       int4,
    "create_date" timestamp(6),
    "dept_id"     int8,
    "job_name"    varchar(50) COLLATE "pg_catalog"."default"
)
;
COMMENT
ON COLUMN "public"."schedule_job_log"."id" IS 'id';
COMMENT
ON COLUMN "public"."schedule_job_log"."bean_name" IS 'spring bean名称';
COMMENT
ON COLUMN "public"."schedule_job_log"."params" IS '参数';
COMMENT
ON COLUMN "public"."schedule_job_log"."status" IS '任务状态  0：失败    1：成功';
COMMENT
ON COLUMN "public"."schedule_job_log"."error" IS '失败信息';
COMMENT
ON COLUMN "public"."schedule_job_log"."times" IS '耗时(单位：毫秒)';
COMMENT
ON COLUMN "public"."schedule_job_log"."dept_id" IS '部门标识';
COMMENT
ON COLUMN "public"."schedule_job_log"."job_name" IS '任务名称';
COMMENT
ON TABLE "public"."schedule_job_log" IS '定时任务日志';

-- ----------------------------
-- Records of schedule_job_log
-- ----------------------------

-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_dept";
CREATE TABLE "public"."sys_dept"
(
    "id"          int8 NOT NULL,
    "pid"         int8,
    "pids"        varchar(500) COLLATE "pg_catalog"."default",
    "name"        varchar(50) COLLATE "pg_catalog"."default",
    "sort"        int4,
    "creator"     int8,
    "create_date" timestamp(6),
    "updater"     int8,
    "update_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_dept"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_dept"."pid" IS '上级ID';
COMMENT
ON COLUMN "public"."sys_dept"."pids" IS '所有上级ID，用逗号分开';
COMMENT
ON COLUMN "public"."sys_dept"."name" IS '部门名称';
COMMENT
ON COLUMN "public"."sys_dept"."sort" IS '排序';
COMMENT
ON COLUMN "public"."sys_dept"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_dept"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."sys_dept"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."sys_dept"."update_date" IS '更新时间';
COMMENT
ON TABLE "public"."sys_dept" IS '部门管理';

-- ----------------------------
-- Records of sys_dept
-- ----------------------------
INSERT INTO "public"."sys_dept"
VALUES (1067246875800000066, 0, '0', '一级部门', 0, 1067246875800000001, '2026-04-14 21:12:05.693419',
        1067246875800000001, '2026-04-14 21:12:05.693419');

-- ----------------------------
-- Table structure for sys_dict_data
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_dict_data";
CREATE TABLE "public"."sys_dict_data"
(
    "id"           int8 NOT NULL,
    "dict_type_id" int8 NOT NULL,
    "dict_label"   varchar(255) COLLATE "pg_catalog"."default",
    "dict_value"   varchar(255) COLLATE "pg_catalog"."default",
    "remark"       varchar(255) COLLATE "pg_catalog"."default",
    "sort"         int4,
    "creator"      int8,
    "create_date"  timestamp(6),
    "updater"      int8,
    "update_date"  timestamp(6),
    "image_url"    varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT
ON COLUMN "public"."sys_dict_data"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_dict_data"."dict_type_id" IS '字典类型ID';
COMMENT
ON COLUMN "public"."sys_dict_data"."dict_label" IS '字典标签';
COMMENT
ON COLUMN "public"."sys_dict_data"."dict_value" IS '字典值';
COMMENT
ON COLUMN "public"."sys_dict_data"."remark" IS '备注';
COMMENT
ON COLUMN "public"."sys_dict_data"."sort" IS '排序';
COMMENT
ON COLUMN "public"."sys_dict_data"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_dict_data"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."sys_dict_data"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."sys_dict_data"."update_date" IS '更新时间';
COMMENT
ON COLUMN "public"."sys_dict_data"."image_url" IS '图片地址';
COMMENT
ON TABLE "public"."sys_dict_data" IS '字典数据';

-- ----------------------------
-- Records of sys_dict_data
-- ----------------------------
INSERT INTO "public"."sys_dict_data"
VALUES (1160061112075464705, 1160061077912858625, '男', '0', '', 0, 1067246875800000001, '2026-04-14 21:12:05.723678',
        1067246875800000001, '2026-04-14 21:12:05.723678');
INSERT INTO "public"."sys_dict_data"
VALUES (1160061146967879681, 1160061077912858625, '女', '1', '', 1, 1067246875800000001, '2026-04-14 21:12:05.73165',
        1067246875800000001, '2026-04-14 21:12:05.73165');
INSERT INTO "public"."sys_dict_data"
VALUES (1160061190127267841, 1160061077912858625, '保密', '2', '', 2, 1067246875800000001, '2026-04-14 21:12:05.738683',
        1067246875800000001, '2026-04-14 21:12:05.738683');

-- ----------------------------
-- Table structure for sys_dict_type
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_dict_type";
CREATE TABLE "public"."sys_dict_type"
(
    "id"          int8 NOT NULL,
    "dict_type"   varchar(100) COLLATE "pg_catalog"."default",
    "dict_name"   varchar(255) COLLATE "pg_catalog"."default",
    "remark"      varchar(255) COLLATE "pg_catalog"."default",
    "sort"        int4,
    "creator"     int8,
    "create_date" timestamp(6),
    "updater"     int8,
    "update_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_dict_type"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_dict_type"."dict_type" IS '字典类型';
COMMENT
ON COLUMN "public"."sys_dict_type"."dict_name" IS '字典名称';
COMMENT
ON COLUMN "public"."sys_dict_type"."remark" IS '备注';
COMMENT
ON COLUMN "public"."sys_dict_type"."sort" IS '排序';
COMMENT
ON COLUMN "public"."sys_dict_type"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_dict_type"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."sys_dict_type"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."sys_dict_type"."update_date" IS '更新时间';
COMMENT
ON TABLE "public"."sys_dict_type" IS '字典类型';

-- ----------------------------
-- Records of sys_dict_type
-- ----------------------------
INSERT INTO "public"."sys_dict_type"
VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, '2026-04-14 21:12:05.716179',
        1067246875800000001, '2026-04-14 21:12:05.716179');

-- ----------------------------
-- Table structure for sys_log_error
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_log_error";
CREATE TABLE "public"."sys_log_error"
(
    "id"             int8 NOT NULL,
    "request_uri"    varchar(200) COLLATE "pg_catalog"."default",
    "request_method" varchar(20) COLLATE "pg_catalog"."default",
    "request_params" text COLLATE "pg_catalog"."default",
    "user_agent"     varchar(500) COLLATE "pg_catalog"."default",
    "ip"             varchar(32) COLLATE "pg_catalog"."default",
    "error_info"     text COLLATE "pg_catalog"."default",
    "creator"        int8,
    "create_date"    timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_log_error"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_log_error"."request_uri" IS '请求URI';
COMMENT
ON COLUMN "public"."sys_log_error"."request_method" IS '请求方式';
COMMENT
ON COLUMN "public"."sys_log_error"."request_params" IS '请求参数';
COMMENT
ON COLUMN "public"."sys_log_error"."user_agent" IS '用户代理';
COMMENT
ON COLUMN "public"."sys_log_error"."ip" IS '操作IP';
COMMENT
ON COLUMN "public"."sys_log_error"."error_info" IS '异常信息';
COMMENT
ON COLUMN "public"."sys_log_error"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_log_error"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."sys_log_error" IS '异常日志';

-- ----------------------------
-- Table structure for sys_log_login
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_log_login";
CREATE TABLE "public"."sys_log_login"
(
    "id"           int8 NOT NULL,
    "operation"    int4,
    "status"       int4,
    "user_agent"   varchar(500) COLLATE "pg_catalog"."default",
    "ip"           varchar(32) COLLATE "pg_catalog"."default",
    "creator_name" varchar(50) COLLATE "pg_catalog"."default",
    "creator"      int8,
    "create_date"  timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_log_login"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_log_login"."operation" IS '用户操作   0：用户登录   1：用户退出';
COMMENT
ON COLUMN "public"."sys_log_login"."status" IS '状态  0：失败    1：成功    2：账号已锁定';
COMMENT
ON COLUMN "public"."sys_log_login"."user_agent" IS '用户代理';
COMMENT
ON COLUMN "public"."sys_log_login"."ip" IS '操作IP';
COMMENT
ON COLUMN "public"."sys_log_login"."creator_name" IS '用户名';
COMMENT
ON COLUMN "public"."sys_log_login"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_log_login"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."sys_log_login" IS '登录日志';

-- ----------------------------
-- Records of sys_log_login
-- ----------------------------

-- ----------------------------
-- Table structure for sys_log_operation
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_log_operation";
CREATE TABLE "public"."sys_log_operation"
(
    "id"             int8 NOT NULL,
    "operation"      varchar(50) COLLATE "pg_catalog"."default",
    "request_uri"    varchar(200) COLLATE "pg_catalog"."default",
    "request_method" varchar(20) COLLATE "pg_catalog"."default",
    "request_params" text COLLATE "pg_catalog"."default",
    "request_time"   int4,
    "user_agent"     varchar(500) COLLATE "pg_catalog"."default",
    "ip"             varchar(32) COLLATE "pg_catalog"."default",
    "status"         int4,
    "creator_name"   varchar(50) COLLATE "pg_catalog"."default",
    "creator"        int8,
    "create_date"    timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_log_operation"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_log_operation"."operation" IS '用户操作';
COMMENT
ON COLUMN "public"."sys_log_operation"."request_uri" IS '请求URI';
COMMENT
ON COLUMN "public"."sys_log_operation"."request_method" IS '请求方式';
COMMENT
ON COLUMN "public"."sys_log_operation"."request_params" IS '请求参数';
COMMENT
ON COLUMN "public"."sys_log_operation"."request_time" IS '请求时长(毫秒)';
COMMENT
ON COLUMN "public"."sys_log_operation"."user_agent" IS '用户代理';
COMMENT
ON COLUMN "public"."sys_log_operation"."ip" IS '操作IP';
COMMENT
ON COLUMN "public"."sys_log_operation"."status" IS '状态  0：失败   1：成功';
COMMENT
ON COLUMN "public"."sys_log_operation"."creator_name" IS '用户名';
COMMENT
ON COLUMN "public"."sys_log_operation"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_log_operation"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."sys_log_operation" IS '操作日志';

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_menu";
CREATE TABLE "public"."sys_menu"
(
    "id"          int8 NOT NULL,
    "pid"         int8,
    "name"        varchar(200) COLLATE "pg_catalog"."default",
    "url"         varchar(200) COLLATE "pg_catalog"."default",
    "permissions" varchar(500) COLLATE "pg_catalog"."default",
    "menu_type"   int4,
    "icon"        varchar(50) COLLATE "pg_catalog"."default",
    "sort"        int4,
    "creator"     int8,
    "create_date" timestamp(6),
    "updater"     int8,
    "update_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_menu"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_menu"."pid" IS '上级ID，一级菜单为0';
COMMENT
ON COLUMN "public"."sys_menu"."name" IS '名称';
COMMENT
ON COLUMN "public"."sys_menu"."url" IS '菜单URL';
COMMENT
ON COLUMN "public"."sys_menu"."permissions" IS '授权(多个用逗号分隔，如：sys:user:list,sys:user:save)';
COMMENT
ON COLUMN "public"."sys_menu"."menu_type" IS '类型   0：菜单   1：按钮';
COMMENT
ON COLUMN "public"."sys_menu"."icon" IS '菜单图标';
COMMENT
ON COLUMN "public"."sys_menu"."sort" IS '排序';
COMMENT
ON COLUMN "public"."sys_menu"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_menu"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."sys_menu"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."sys_menu"."update_date" IS '更新时间';
COMMENT
ON TABLE "public"."sys_menu" IS '菜单管理';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000003, 1067246875800000055, '新增', NULL, 'sys:user:save,sys:dept:list,sys:role:list', 1, NULL, 1,
        1067246875800000001, '2026-04-14 21:12:05.280416', 1067246875800000001, '2026-04-14 21:12:05.280416');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000004, 1067246875800000055, '修改', NULL, 'sys:user:update,sys:dept:list,sys:role:list', 1, NULL,
        2, 1067246875800000001, '2026-04-14 21:12:05.288126', 1067246875800000001, '2026-04-14 21:12:05.288126');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000005, 1067246875800000055, '删除', NULL, 'sys:user:delete', 1, NULL, 3, 1067246875800000001,
        '2026-04-14 21:12:05.295657', 1067246875800000001, '2026-04-14 21:12:05.295657');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000006, 1067246875800000055, '导出', NULL, 'sys:user:export', 1, NULL, 4, 1067246875800000001,
        '2026-04-14 21:12:05.302674', 1067246875800000001, '2026-04-14 21:12:05.302674');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000007, 1067246875800000002, '角色管理', 'sys/role', NULL, 0, 'icon-team', 2, 1067246875800000001,
        '2026-04-14 21:12:05.310628', 1067246875800000001, '2026-04-14 21:12:05.310628');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000008, 1067246875800000007, '查看', NULL, 'sys:role:page,sys:role:info', 1, NULL, 0,
        1067246875800000001, '2026-04-14 21:12:05.319374', 1067246875800000001, '2026-04-14 21:12:05.319374');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000009, 1067246875800000007, '新增', NULL, 'sys:role:save,sys:menu:select,sys:dept:list', 1, NULL,
        1, 1067246875800000001, '2026-04-14 21:12:05.326615', 1067246875800000001, '2026-04-14 21:12:05.326615');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000010, 1067246875800000007, '修改', NULL, 'sys:role:update,sys:menu:select,sys:dept:list', 1,
        NULL, 2, 1067246875800000001, '2026-04-14 21:12:05.333601', 1067246875800000001, '2026-04-14 21:12:05.333601');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000011, 1067246875800000007, '删除', NULL, 'sys:role:delete', 1, NULL, 3, 1067246875800000001,
        '2026-04-14 21:12:05.342612', 1067246875800000001, '2026-04-14 21:12:05.342612');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000012, 1067246875800000002, '部门管理', 'sys/dept', NULL, 0, 'icon-apartment', 1,
        1067246875800000001, '2026-04-14 21:12:05.349646', 1067246875800000001, '2026-04-14 21:12:05.349646');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000014, 1067246875800000012, '查看', NULL, 'sys:dept:list,sys:dept:info', 1, NULL, 0,
        1067246875800000001, '2026-04-14 21:12:05.357621', 1067246875800000001, '2026-04-14 21:12:05.357621');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000015, 1067246875800000012, '新增', NULL, 'sys:dept:save', 1, NULL, 1, 1067246875800000001,
        '2026-04-14 21:12:05.365139', 1067246875800000001, '2026-04-14 21:12:05.365139');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000016, 1067246875800000012, '修改', NULL, 'sys:dept:update', 1, NULL, 2, 1067246875800000001,
        '2026-04-14 21:12:05.373446', 1067246875800000001, '2026-04-14 21:12:05.373446');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000017, 1067246875800000012, '删除', NULL, 'sys:dept:delete', 1, NULL, 3, 1067246875800000001,
        '2026-04-14 21:12:05.380647', 1067246875800000001, '2026-04-14 21:12:05.380647');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000025, 1067246875800000035, '菜单管理', 'sys/menu', NULL, 0, 'icon-unorderedlist', 0,
        1067246875800000001, '2026-04-14 21:12:05.388875', 1067246875800000001, '2026-04-14 21:12:05.388875');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000026, 1067246875800000025, '查看', NULL, 'sys:menu:list,sys:menu:info', 1, NULL, 0,
        1067246875800000001, '2026-04-14 21:12:05.396854', 1067246875800000001, '2026-04-14 21:12:05.396854');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000027, 1067246875800000025, '新增', NULL, 'sys:menu:save', 1, NULL, 1, 1067246875800000001,
        '2026-04-14 21:12:05.404892', 1067246875800000001, '2026-04-14 21:12:05.404892');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000028, 1067246875800000025, '修改', NULL, 'sys:menu:update', 1, NULL, 2, 1067246875800000001,
        '2026-04-14 21:12:05.412172', 1067246875800000001, '2026-04-14 21:12:05.412172');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000029, 1067246875800000025, '删除', NULL, 'sys:menu:delete', 1, NULL, 3, 1067246875800000001,
        '2026-04-14 21:12:05.422874', 1067246875800000001, '2026-04-14 21:12:05.422874');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000030, 1067246875800000035, '定时任务', 'job/schedule', NULL, 0, 'icon-dashboard', 3,
        1067246875800000001, '2026-04-14 21:12:05.432687', 1067246875800000001, '2026-04-14 21:12:05.432687');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000031, 1067246875800000030, '查看', NULL, 'sys:schedule:page,sys:schedule:info', 1, NULL, 0,
        1067246875800000001, '2026-04-14 21:12:05.440457', 1067246875800000001, '2026-04-14 21:12:05.440457');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000032, 1067246875800000030, '新增', NULL, 'sys:schedule:save', 1, NULL, 1, 1067246875800000001,
        '2026-04-14 21:12:05.447912', 1067246875800000001, '2026-04-14 21:12:05.447912');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000033, 1067246875800000030, '修改', NULL, 'sys:schedule:update', 1, NULL, 2, 1067246875800000001,
        '2026-04-14 21:12:05.455087', 1067246875800000001, '2026-04-14 21:12:05.455087');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000034, 1067246875800000030, '删除', NULL, 'sys:schedule:delete', 1, NULL, 3, 1067246875800000001,
        '2026-04-14 21:12:05.462176', 1067246875800000001, '2026-04-14 21:12:05.462176');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000035, 0, '系统设置', NULL, NULL, 0, 'icon-setting', 1, 1067246875800000001,
        '2026-04-14 21:12:05.469205', 1067246875800000001, '2026-04-14 21:12:05.469205');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000036, 1067246875800000030, '暂停', NULL, 'sys:schedule:pause', 1, NULL, 4, 1067246875800000001,
        '2026-04-14 21:12:05.475637', 1067246875800000001, '2026-04-14 21:12:05.475637');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000037, 1067246875800000030, '恢复', NULL, 'sys:schedule:resume', 1, NULL, 5, 1067246875800000001,
        '2026-04-14 21:12:05.482679', 1067246875800000001, '2026-04-14 21:12:05.482679');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000038, 1067246875800000030, '立即执行', NULL, 'sys:schedule:run', 1, NULL, 6, 1067246875800000001,
        '2026-04-14 21:12:05.490697', 1067246875800000001, '2026-04-14 21:12:05.490697');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000039, 1067246875800000030, '日志列表', NULL, 'sys:schedule:log', 1, NULL, 7, 1067246875800000001,
        '2026-04-14 21:12:05.498181', 1067246875800000001, '2026-04-14 21:12:05.498181');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000040, 1067246875800000035, '参数管理', 'sys/params', '', 0, 'icon-fileprotect', 1,
        1067246875800000001, '2026-04-14 21:12:05.505152', 1067246875800000001, '2026-04-14 21:12:05.505152');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000041, 1067246875800000035, '字典管理', 'sys/dict-type', NULL, 0, 'icon-golden-fill', 2,
        1067246875800000001, '2026-04-14 21:12:05.512428', 1067246875800000001, '2026-04-14 21:12:05.512428');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000042, 1067246875800000041, '查看', NULL, 'sys:dict:page,sys:dict:info', 1, NULL, 0,
        1067246875800000001, '2026-04-14 21:12:05.519687', 1067246875800000001, '2026-04-14 21:12:05.519687');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000043, 1067246875800000041, '新增', NULL, 'sys:dict:save', 1, NULL, 1, 1067246875800000001,
        '2026-04-14 21:12:05.52668', 1067246875800000001, '2026-04-14 21:12:05.52668');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000044, 1067246875800000041, '修改', NULL, 'sys:dict:update', 1, NULL, 2, 1067246875800000001,
        '2026-04-14 21:12:05.534441', 1067246875800000001, '2026-04-14 21:12:05.534441');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000045, 1067246875800000041, '删除', NULL, 'sys:dict:delete', 1, NULL, 3, 1067246875800000001,
        '2026-04-14 21:12:05.542675', 1067246875800000001, '2026-04-14 21:12:05.542675');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000046, 0, '日志管理', NULL, NULL, 0, 'icon-container', 2, 1067246875800000001,
        '2026-04-14 21:12:05.551193', 1067246875800000001, '2026-04-14 21:12:05.551193');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000047, 1067246875800000035, '文件上传', 'oss/oss', 'sys:oss:all', 0, 'icon-upload', 4,
        1067246875800000001, '2026-04-14 21:12:05.559432', 1067246875800000001, '2026-04-14 21:12:05.559432');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000048, 1067246875800000046, '登录日志', 'sys/log-login', 'sys:log:login', 0, 'icon-filedone', 0,
        1067246875800000001, '2026-04-14 21:12:05.566938', 1067246875800000001, '2026-04-14 21:12:05.566938');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000049, 1067246875800000046, '操作日志', 'sys/log-operation', 'sys:log:operation', 0,
        'icon-solution', 1, 1067246875800000001, '2026-04-14 21:12:05.574425', 1067246875800000001,
        '2026-04-14 21:12:05.574425');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000050, 1067246875800000046, '异常日志', 'sys/log-error', 'sys:log:error', 0,
        'icon-file-exception', 2, 1067246875800000001, '2026-04-14 21:12:05.58244', 1067246875800000001,
        '2026-04-14 21:12:05.58244');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000051, 1067246875800000053, 'SQL监控', '{{ApiUrl}}/druid/sql.html', NULL, 0, 'icon-database', 0,
        1067246875800000001, '2026-04-14 21:12:05.58992', 1067246875800000001, '2026-04-14 21:12:05.58992');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000053, 0, '系统监控', NULL, NULL, 0, 'icon-desktop', 3, 1067246875800000001,
        '2026-04-14 21:12:05.597203', 1067246875800000001, '2026-04-14 21:12:05.597203');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000055, 1067246875800000002, '用户管理', 'sys/user', NULL, 0, 'icon-user', 0, 1067246875800000001,
        '2026-04-14 21:12:05.604432', 1067246875800000001, '2026-04-14 21:12:05.604432');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000056, 1067246875800000055, '查看', NULL, 'sys:user:page,sys:user:info', 1, NULL, 0,
        1067246875800000001, '2026-04-14 21:12:05.611445', 1067246875800000001, '2026-04-14 21:12:05.611445');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000057, 1067246875800000040, '新增', NULL, 'sys:params:save', 1, NULL, 1, 1067246875800000001,
        '2026-04-14 21:12:05.618653', 1067246875800000001, '2026-04-14 21:12:05.618653');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000058, 1067246875800000040, '导出', NULL, 'sys:params:export', 1, NULL, 4, 1067246875800000001,
        '2026-04-14 21:12:05.627428', 1067246875800000001, '2026-04-14 21:12:05.627428');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000059, 1067246875800000040, '查看', '', 'sys:params:page,sys:params:info', 1, NULL, 0,
        1067246875800000001, '2026-04-14 21:12:05.63518', 1067246875800000001, '2026-04-14 21:12:05.63518');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000060, 1067246875800000040, '修改', NULL, 'sys:params:update', 1, NULL, 2, 1067246875800000001,
        '2026-04-14 21:12:05.64219', 1067246875800000001, '2026-04-14 21:12:05.64219');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000061, 1067246875800000040, '删除', '', 'sys:params:delete', 1, '', 3, 1067246875800000001,
        '2026-04-14 21:12:05.649438', 1067246875800000001, '2026-04-14 21:12:05.649438');
INSERT INTO "public"."sys_menu"
VALUES (1156748733921165314, 1067246875800000053, '接口文档', '{{ApiUrl}}/doc.html', '', 0, 'icon-file-word', 1,
        1067246875800000001, '2026-04-14 21:12:05.656176', 1067246875800000001, '2026-04-14 21:12:05.656176');
INSERT INTO "public"."sys_menu"
VALUES (1067246875800000002, 0, '权限管理', NULL, 'bus:*', 0, 'icon-safetycertificate', 0, 1067246875800000001,
        '2026-04-14 21:12:05.272081', 1067246875800000001, '2026-04-14 21:12:05.272081');

-- ----------------------------
-- Table structure for sys_params
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_params";
CREATE TABLE "public"."sys_params"
(
    "id"          int8 NOT NULL,
    "param_code"  varchar(32) COLLATE "pg_catalog"."default",
    "param_value" varchar(2000) COLLATE "pg_catalog"."default",
    "param_type"  int4 NOT NULL DEFAULT 1,
    "remark"      varchar(200) COLLATE "pg_catalog"."default",
    "creator"     int8,
    "create_date" timestamp(6),
    "updater"     int8,
    "update_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_params"."param_code" IS '参数编码';
COMMENT
ON COLUMN "public"."sys_params"."param_value" IS '参数值';
COMMENT
ON COLUMN "public"."sys_params"."param_type" IS '类型   0：系统参数   1：非系统参数';
COMMENT
ON COLUMN "public"."sys_params"."remark" IS '备注';
COMMENT
ON COLUMN "public"."sys_params"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_params"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."sys_params"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."sys_params"."update_date" IS '更新时间';
COMMENT
ON TABLE "public"."sys_params" IS '参数管理';

-- ----------------------------
-- Records of sys_params
-- ----------------------------

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role";
CREATE TABLE "public"."sys_role"
(
    "id"          int8 NOT NULL,
    "name"        varchar(50) COLLATE "pg_catalog"."default",
    "remark"      varchar(100) COLLATE "pg_catalog"."default",
    "dept_id"     int8,
    "creator"     int8,
    "create_date" timestamp(6),
    "updater"     int8,
    "update_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_role"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_role"."name" IS '角色名称';
COMMENT
ON COLUMN "public"."sys_role"."remark" IS '备注';
COMMENT
ON COLUMN "public"."sys_role"."dept_id" IS '部门ID';
COMMENT
ON COLUMN "public"."sys_role"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_role"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."sys_role"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."sys_role"."update_date" IS '更新时间';
COMMENT
ON TABLE "public"."sys_role" IS '角色管理';

-- ----------------------------
-- Records of sys_role
-- ----------------------------

-- ----------------------------
-- Table structure for sys_role_data_scope
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role_data_scope";
CREATE TABLE "public"."sys_role_data_scope"
(
    "id"          int8 NOT NULL,
    "role_id"     int8,
    "dept_id"     int8,
    "creator"     int8,
    "create_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_role_data_scope"."role_id" IS '角色ID';
COMMENT
ON COLUMN "public"."sys_role_data_scope"."dept_id" IS '部门ID';
COMMENT
ON COLUMN "public"."sys_role_data_scope"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_role_data_scope"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."sys_role_data_scope" IS '角色数据权限';

-- ----------------------------
-- Records of sys_role_data_scope
-- ----------------------------

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role_menu";
CREATE TABLE "public"."sys_role_menu"
(
    "id"          int8 NOT NULL,
    "role_id"     int8,
    "menu_id"     int8,
    "creator"     int8,
    "create_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_role_menu"."role_id" IS '角色ID';
COMMENT
ON COLUMN "public"."sys_role_menu"."menu_id" IS '菜单ID';
COMMENT
ON COLUMN "public"."sys_role_menu"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_role_menu"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."sys_role_menu" IS '角色菜单关系';

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------

-- ----------------------------
-- Table structure for sys_role_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_role_user";
CREATE TABLE "public"."sys_role_user"
(
    "id"          int8 NOT NULL,
    "role_id"     int8,
    "user_id"     int8,
    "creator"     int8,
    "create_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_role_user"."role_id" IS '角色ID';
COMMENT
ON COLUMN "public"."sys_role_user"."user_id" IS '用户ID';
COMMENT
ON COLUMN "public"."sys_role_user"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_role_user"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."sys_role_user" IS '角色用户关系';

-- ----------------------------
-- Records of sys_role_user
-- ----------------------------

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user";
CREATE TABLE "public"."sys_user"
(
    "id"          int8                                       NOT NULL,
    "username"    varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
    "password"    varchar(100) COLLATE "pg_catalog"."default",
    "real_name"   varchar(50) COLLATE "pg_catalog"."default",
    "head_url"    varchar(200) COLLATE "pg_catalog"."default",
    "gender"      int4,
    "email"       varchar(100) COLLATE "pg_catalog"."default",
    "mobile"      varchar(100) COLLATE "pg_catalog"."default",
    "dept_id"     int8,
    "super_admin" int4,
    "status"      int4,
    "creator"     int8,
    "create_date" timestamp(6),
    "updater"     int8,
    "update_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_user"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_user"."username" IS '用户名';
COMMENT
ON COLUMN "public"."sys_user"."password" IS '密码';
COMMENT
ON COLUMN "public"."sys_user"."real_name" IS '姓名';
COMMENT
ON COLUMN "public"."sys_user"."head_url" IS '头像';
COMMENT
ON COLUMN "public"."sys_user"."gender" IS '性别   0：男   1：女    2：保密';
COMMENT
ON COLUMN "public"."sys_user"."email" IS '邮箱';
COMMENT
ON COLUMN "public"."sys_user"."mobile" IS '手机号';
COMMENT
ON COLUMN "public"."sys_user"."dept_id" IS '部门ID';
COMMENT
ON COLUMN "public"."sys_user"."super_admin" IS '超级管理员   0：否   1：是';
COMMENT
ON COLUMN "public"."sys_user"."status" IS '状态  0：停用    1：正常';
COMMENT
ON COLUMN "public"."sys_user"."creator" IS '创建者';
COMMENT
ON COLUMN "public"."sys_user"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."sys_user"."updater" IS '更新者';
COMMENT
ON COLUMN "public"."sys_user"."update_date" IS '更新时间';
COMMENT
ON TABLE "public"."sys_user" IS '用户管理';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO "public"."sys_user"
VALUES (1067246875800000001, 'admin', '$2a$10$012Kx2ba5jzqr9gLlG4MX.bnQJTD9UWqF57XDo2N3.fPtLne02u/m', '管理员', NULL, 0,
        NULL, NULL, NULL, 1, 1, 1067246875800000001, '2026-04-14 21:12:05.264391', 1067246875800000001,
        '2026-04-14 21:12:05.264391');

-- ----------------------------
-- Table structure for sys_user_token
-- ----------------------------
DROP TABLE IF EXISTS "public"."sys_user_token";
CREATE TABLE "public"."sys_user_token"
(
    "id"          int8 NOT NULL,
    "user_id"     int8,
    "token"       varchar(100) COLLATE "pg_catalog"."default",
    "expire_date" timestamp(6),
    "update_date" timestamp(6),
    "create_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."sys_user_token"."id" IS 'id';
COMMENT
ON COLUMN "public"."sys_user_token"."user_id" IS '用户id';
COMMENT
ON COLUMN "public"."sys_user_token"."token" IS '用户token';
COMMENT
ON COLUMN "public"."sys_user_token"."expire_date" IS '过期时间';
COMMENT
ON COLUMN "public"."sys_user_token"."update_date" IS '更新时间';
COMMENT
ON COLUMN "public"."sys_user_token"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."sys_user_token" IS '系统用户Token';

-- ----------------------------
-- Records of sys_user_token
-- ----------------------------
INSERT INTO "public"."sys_user_token"
VALUES (1067246875800000001, 1067246875800000001, '1067246875800000001', '2026-12-01 00:00:00', NULL, NULL);

-- ----------------------------
-- Primary Key structure for table bus_cache
-- ----------------------------
ALTER TABLE "public"."bus_cache"
    ADD CONSTRAINT "bus_cache_info_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table bus_dock
-- ----------------------------
ALTER TABLE "public"."bus_dock"
    ADD CONSTRAINT "bus_dock_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table bus_dock_device
-- ----------------------------
ALTER TABLE "public"."bus_dock_device"
    ADD CONSTRAINT "bus_dock_device_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table bus_flight_task
-- ----------------------------
ALTER TABLE "public"."bus_flight_task"
    ADD CONSTRAINT "bus_flight_task_pkey" PRIMARY KEY ("task_id");

-- ----------------------------
-- Indexes structure for table bus_media_file
-- ----------------------------
CREATE INDEX "dji_media_file_flight_id_idx" ON "public"."bus_media_file" USING btree (
    "task_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE INDEX "dji_media_file_sn_idx" ON "public"."bus_media_file" USING btree (
    "dock_sn" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table bus_media_file
-- ----------------------------
ALTER TABLE "public"."bus_media_file"
    ADD CONSTRAINT "dji_media_file_pk" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table bus_route
-- ----------------------------
ALTER TABLE "public"."bus_route"
    ADD CONSTRAINT "bus_route_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table bus_route_waypoint
-- ----------------------------
ALTER TABLE "public"."bus_route_waypoint"
    ADD CONSTRAINT "bus_route_waypoint_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table bus_srs_record
-- ----------------------------
ALTER TABLE "public"."bus_srs_record"
    ADD CONSTRAINT "live_srs_record_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table bus_waypoint_action
-- ----------------------------
ALTER TABLE "public"."bus_waypoint_action"
    ADD CONSTRAINT "bus_waypoint_action_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table schedule_job
-- ----------------------------
CREATE INDEX "idx_schedule_job_create_date" ON "public"."schedule_job" USING btree (
    "create_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table schedule_job
-- ----------------------------
ALTER TABLE "public"."schedule_job"
    ADD CONSTRAINT "schedule_job_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table schedule_job_log
-- ----------------------------
CREATE INDEX "idx_job_log_create_date" ON "public"."schedule_job_log" USING btree (
    "create_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_job_log_job_id" ON "public"."schedule_job_log" USING btree (
    "job_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table schedule_job_log
-- ----------------------------
ALTER TABLE "public"."schedule_job_log"
    ADD CONSTRAINT "schedule_job_log_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_dept
-- ----------------------------
CREATE INDEX "idx_sys_dept_idx_sort" ON "public"."sys_dept" USING btree (
    "sort" "pg_catalog"."int4_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_sys_dept_pid" ON "public"."sys_dept" USING btree (
    "pid" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_dept
-- ----------------------------
ALTER TABLE "public"."sys_dept"
    ADD CONSTRAINT "sys_dept_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_dict_data
-- ----------------------------
CREATE INDEX "idx_sys_dict_data_sort" ON "public"."sys_dict_data" USING btree (
    "sort" "pg_catalog"."int4_ops" ASC NULLS LAST
    );
CREATE UNIQUE INDEX "uk_dict_type_value" ON "public"."sys_dict_data" USING btree (
    "dict_type_id" "pg_catalog"."int8_ops" ASC NULLS LAST,
    "dict_value" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_dict_data
-- ----------------------------
ALTER TABLE "public"."sys_dict_data"
    ADD CONSTRAINT "sys_dict_data_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_dict_type
-- ----------------------------
CREATE UNIQUE INDEX "uk_sys_dict_type_dict_type" ON "public"."sys_dict_type" USING btree (
    "dict_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_dict_type
-- ----------------------------
ALTER TABLE "public"."sys_dict_type"
    ADD CONSTRAINT "sys_dict_type_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_log_error
-- ----------------------------
CREATE INDEX "idx_error_create_date" ON "public"."sys_log_error" USING btree (
    "create_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_log_error
-- ----------------------------
ALTER TABLE "public"."sys_log_error"
    ADD CONSTRAINT "sys_log_error_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_log_login
-- ----------------------------
CREATE INDEX "idx_login_create_date" ON "public"."sys_log_login" USING btree (
    "create_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_login_status" ON "public"."sys_log_login" USING btree (
    "status" "pg_catalog"."int4_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_log_login
-- ----------------------------
ALTER TABLE "public"."sys_log_login"
    ADD CONSTRAINT "sys_log_login_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_log_operation
-- ----------------------------
CREATE INDEX "idx_operation_create_date" ON "public"."sys_log_operation" USING btree (
    "create_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_log_operation
-- ----------------------------
ALTER TABLE "public"."sys_log_operation"
    ADD CONSTRAINT "sys_log_operation_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_menu
-- ----------------------------
CREATE INDEX "idx_sys_menu_pid" ON "public"."sys_menu" USING btree (
    "pid" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_sys_menu_sort" ON "public"."sys_menu" USING btree (
    "sort" "pg_catalog"."int4_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_menu
-- ----------------------------
ALTER TABLE "public"."sys_menu"
    ADD CONSTRAINT "sys_menu_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_params
-- ----------------------------
CREATE INDEX "idx_sys_params_create_date" ON "public"."sys_params" USING btree (
    "create_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
    );
CREATE UNIQUE INDEX "uk_sys_params_param_code" ON "public"."sys_params" USING btree (
    "param_code" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_params
-- ----------------------------
ALTER TABLE "public"."sys_params"
    ADD CONSTRAINT "sys_params_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_role
-- ----------------------------
CREATE INDEX "idx_sys_role_dept_id" ON "public"."sys_role" USING btree (
    "dept_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_role
-- ----------------------------
ALTER TABLE "public"."sys_role"
    ADD CONSTRAINT "sys_role_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_role_data_scope
-- ----------------------------
CREATE INDEX "idx_data_scope_role_id" ON "public"."sys_role_data_scope" USING btree (
    "role_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_role_data_scope
-- ----------------------------
ALTER TABLE "public"."sys_role_data_scope"
    ADD CONSTRAINT "sys_role_data_scope_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_role_menu
-- ----------------------------
CREATE INDEX "idx_sys_role_menu_menu_id" ON "public"."sys_role_menu" USING btree (
    "menu_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_sys_role_menu_role_id" ON "public"."sys_role_menu" USING btree (
    "role_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_role_menu
-- ----------------------------
ALTER TABLE "public"."sys_role_menu"
    ADD CONSTRAINT "sys_role_menu_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_role_user
-- ----------------------------
CREATE INDEX "idx_sys_role_user_role_id" ON "public"."sys_role_user" USING btree (
    "role_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );
CREATE INDEX "idx_sys_role_user_user_id" ON "public"."sys_role_user" USING btree (
    "user_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_role_user
-- ----------------------------
ALTER TABLE "public"."sys_role_user"
    ADD CONSTRAINT "sys_role_user_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_user
-- ----------------------------
CREATE INDEX "idx_sys_user_create_date" ON "public"."sys_user" USING btree (
    "create_date" "pg_catalog"."timestamp_ops" ASC NULLS LAST
    );
CREATE UNIQUE INDEX "uk_sys_user_username" ON "public"."sys_user" USING btree (
    "username" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_user
-- ----------------------------
ALTER TABLE "public"."sys_user"
    ADD CONSTRAINT "sys_user_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table sys_user_token
-- ----------------------------
CREATE UNIQUE INDEX "uk_sys_user_token" ON "public"."sys_user_token" USING btree (
    "token" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
    );
CREATE UNIQUE INDEX "uk_sys_user_token_user_id" ON "public"."sys_user_token" USING btree (
    "user_id" "pg_catalog"."int8_ops" ASC NULLS LAST
    );

-- ----------------------------
-- Primary Key structure for table sys_user_token
-- ----------------------------
ALTER TABLE "public"."sys_user_token"
    ADD CONSTRAINT "sys_user_token_pkey" PRIMARY KEY ("id");

--2026/5/8
DROP TABLE IF EXISTS "public"."bus_speaker";
CREATE TABLE "public"."bus_speaker"
(
    "id"           int8 NOT NULL,
    "type"         int2 NOT NULL,
    "dock_sn"      varchar(128) COLLATE "pg_catalog"."default",
    "name"         varchar(256) COLLATE "pg_catalog"."default",
    "text_content" text COLLATE "pg_catalog"."default",
    "pcm_path"     varchar(256) COLLATE "pg_catalog"."default",
    "media_path"   varchar(256) COLLATE "pg_catalog"."default",
    "md5"          varchar COLLATE "pg_catalog"."default",
    "create_date"  timestamp(6)
)
;
COMMENT
ON COLUMN "public"."bus_speaker"."id" IS '主键';
COMMENT
ON COLUMN "public"."bus_speaker"."type" IS '类型 1 文本 2 音频';
COMMENT
ON COLUMN "public"."bus_speaker"."dock_sn" IS '机场编号';
COMMENT
ON COLUMN "public"."bus_speaker"."name" IS '模版名称';
COMMENT
ON COLUMN "public"."bus_speaker"."text_content" IS '文本内容';
COMMENT
ON COLUMN "public"."bus_speaker"."pcm_path" IS 'pcm音频地址';
COMMENT
ON COLUMN "public"."bus_speaker"."media_path" IS '源音频文件地址';
COMMENT
ON COLUMN "public"."bus_speaker"."md5" IS '文件md5';
COMMENT
ON COLUMN "public"."bus_speaker"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."bus_speaker" IS '喊话器内容';

-- ----------------------------
-- Primary Key structure for table bus_speaker
-- ----------------------------
ALTER TABLE "public"."bus_speaker"
    ADD CONSTRAINT "dji_speaker_pk" PRIMARY KEY ("id");

--2026/5/10
DROP TABLE IF EXISTS "public"."bus_hms";
CREATE TABLE "public"."bus_hms"
(
    "id"          int8 NOT NULL,
    "gateway"     varchar(50) COLLATE "pg_catalog"."default",
    "dock_sn"     varchar(50) COLLATE "pg_catalog"."default",
    "device_type" varchar(50) COLLATE "pg_catalog"."default",
    "code"        varchar(50) COLLATE "pg_catalog"."default",
    "imminent"    varchar(50) COLLATE "pg_catalog"."default",
    "in_the_sky"  varchar(50) COLLATE "pg_catalog"."default",
    "level"       int2,
    "module"      varchar(50) COLLATE "pg_catalog"."default",
    "create_date" timestamp(6),
    "report_date" timestamp(6)
)
;
COMMENT
ON COLUMN "public"."bus_hms"."id" IS '主键';
COMMENT
ON COLUMN "public"."bus_hms"."gateway" IS '网关编号';
COMMENT
ON COLUMN "public"."bus_hms"."dock_sn" IS '设备编号';
COMMENT
ON COLUMN "public"."bus_hms"."device_type" IS '设备类型';
COMMENT
ON COLUMN "public"."bus_hms"."code" IS '告警码';
COMMENT
ON COLUMN "public"."bus_hms"."imminent" IS '是否为及时性的';
COMMENT
ON COLUMN "public"."bus_hms"."in_the_sky" IS '是否飞行';
COMMENT
ON COLUMN "public"."bus_hms"."level" IS '告警等级';
COMMENT
ON COLUMN "public"."bus_hms"."module" IS '事件模块';
COMMENT
ON COLUMN "public"."bus_hms"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."bus_hms"."report_date" IS '上报时间';
COMMENT
ON TABLE "public"."bus_hms" IS '健康告警';

-- ----------------------------
-- Primary Key structure for table bus_hms
-- ----------------------------
ALTER TABLE "public"."bus_hms"
    ADD CONSTRAINT "dji_hms_pk" PRIMARY KEY ("id");

--2025/5/11
-- ----------------------------
-- Table structure for bus_remote_log
-- ----------------------------
DROP TABLE IF EXISTS "public"."bus_remote_log";
CREATE TABLE "public"."bus_remote_log"
(
    "id"           int8 NOT NULL,
    "module"       char(1) COLLATE "pg_catalog"."default",
    "filename"     varchar(128) COLLATE "pg_catalog"."default",
    "status"       varchar(128) COLLATE "pg_catalog"."default",
    "current_step" int2,
    "total_step"   int2,
    "upload_rate"  int4,
    "size"         int8,
    "code"         int4,
    "path"         varchar(512) COLLATE "pg_catalog"."default",
    "times"        text COLLATE "pg_catalog"."default",
    "dock_sn"      varchar(64) COLLATE "pg_catalog"."default",
    "create_date"  timestamp(6)
)
;
COMMENT
ON COLUMN "public"."bus_remote_log"."id" IS '主键';
COMMENT
ON COLUMN "public"."bus_remote_log"."module" IS '设备类型 0飞机 3机库';
COMMENT
ON COLUMN "public"."bus_remote_log"."filename" IS '导出文件的名称';
COMMENT
ON COLUMN "public"."bus_remote_log"."status" IS '状态';
COMMENT
ON COLUMN "public"."bus_remote_log"."current_step" IS '当前步骤';
COMMENT
ON COLUMN "public"."bus_remote_log"."total_step" IS '步骤总数';
COMMENT
ON COLUMN "public"."bus_remote_log"."upload_rate" IS '上传速率';
COMMENT
ON COLUMN "public"."bus_remote_log"."size" IS '文件大小';
COMMENT
ON COLUMN "public"."bus_remote_log"."code" IS '响应码';
COMMENT
ON COLUMN "public"."bus_remote_log"."path" IS '文件路径';
COMMENT
ON COLUMN "public"."bus_remote_log"."times" IS '当前日志的时间集合，逗号隔开';
COMMENT
ON COLUMN "public"."bus_remote_log"."dock_sn" IS '机场SN';
COMMENT
ON COLUMN "public"."bus_remote_log"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."bus_remote_log" IS '远程日志';

-- ----------------------------
-- Primary Key structure for table bus_remote_log
-- ----------------------------
ALTER TABLE "public"."bus_remote_log"
    ADD CONSTRAINT "dji_remote_log_pk" PRIMARY KEY ("id");

DROP TABLE IF EXISTS "public"."bus_firmware";
CREATE TABLE "public"."bus_firmware"
(
    "id"               int8 NOT NULL,
    "device_name"      varchar(50) COLLATE "pg_catalog"."default",
    "file_name"        varchar(255) COLLATE "pg_catalog"."default",
    "firmware_version" varchar(255) COLLATE "pg_catalog"."default",
    "path"             varchar(255) COLLATE "pg_catalog"."default",
    "file_size"        int8,
    "file_md5"         varchar(255) COLLATE "pg_catalog"."default",
    "remark"           varchar(255) COLLATE "pg_catalog"."default",
    "released_date"    timestamp(6),
    "create_date"      timestamp(6)
)
;
COMMENT
ON COLUMN "public"."bus_firmware"."id" IS '主键';
COMMENT
ON COLUMN "public"."bus_firmware"."device_name" IS '设备名称';
COMMENT
ON COLUMN "public"."bus_firmware"."file_name" IS '文件名称';
COMMENT
ON COLUMN "public"."bus_firmware"."firmware_version" IS '固件版本';
COMMENT
ON COLUMN "public"."bus_firmware"."path" IS '文件路径';
COMMENT
ON COLUMN "public"."bus_firmware"."file_size" IS '文件长度';
COMMENT
ON COLUMN "public"."bus_firmware"."file_md5" IS '文件md5';
COMMENT
ON COLUMN "public"."bus_firmware"."remark" IS '备注';
COMMENT
ON COLUMN "public"."bus_firmware"."released_date" IS '发布时间';
COMMENT
ON COLUMN "public"."bus_firmware"."create_date" IS '创建时间';
COMMENT
ON TABLE "public"."bus_firmware" IS '固件表';

DROP TABLE IF EXISTS "public"."bus_device_dic";
CREATE TABLE "public"."bus_device_dic"
(
    "id"          int8 NOT NULL,
    "domain"      int2,
    "device_type" int4,
    "sub_type"    int4,
    "device_name" varchar(64) COLLATE "pg_catalog"."default",
    "device_desc" varchar(256) COLLATE "pg_catalog"."default"
)
;
COMMENT
ON COLUMN "public"."bus_device_dic"."id" IS '编号';
COMMENT
ON COLUMN "public"."bus_device_dic"."domain" IS '0: drone; 1: payload; 2: remote control; 3: dock';
COMMENT
ON TABLE "public"."bus_device_dic" IS '设备字典';

-- ----------------------------
-- Records of bus_device_dic
-- ----------------------------
INSERT INTO "public"."bus_device_dic"
VALUES (1, 0, 60, 0, 'Matrice 300 RTK', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (2, 0, 67, 0, 'Matrice 30', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (3, 0, 67, 1, 'Matrice 30T', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (4, 1, 20, 0, 'Z30', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (5, 1, 26, 0, 'XT2', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (6, 1, 39, 0, 'FPV', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (7, 1, 41, 0, 'XTS', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (8, 1, 42, 0, 'H20', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (9, 1, 43, 0, 'H20T', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (10, 1, 50, 65535, 'P1', 'include 24 and 35 and 50mm');
INSERT INTO "public"."bus_device_dic"
VALUES (11, 1, 52, 0, 'M30 Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (12, 1, 53, 0, 'M30T Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (13, 1, 61, 0, 'H20N', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (14, 1, 165, 0, 'DJI Dock Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (15, 1, 90742, 0, 'L1', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (16, 2, 56, 0, 'DJI Smart Controller', 'Remote control for M300');
INSERT INTO "public"."bus_device_dic"
VALUES (17, 2, 119, 0, 'DJI RC Plus', 'Remote control for M30');
INSERT INTO "public"."bus_device_dic"
VALUES (18, 3, 1, 0, 'DJI Dock', '');
INSERT INTO "public"."bus_device_dic"
VALUES (19, 0, 77, 0, 'Mavic 3E', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (20, 0, 77, 1, 'Mavic 3T', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (21, 1, 66, 0, 'Mavic 3E Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (22, 1, 67, 0, 'Mavic 3T Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (23, 2, 144, 0, 'DJI RC Pro', 'Remote control for Mavic 3E/T and Mavic 3M');
INSERT INTO "public"."bus_device_dic"
VALUES (24, 0, 77, 2, 'Mavic 3M', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (25, 1, 68, 0, 'Mavic 3M Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (26, 0, 89, 0, 'Matrice 350 RTK', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (27, 3, 2, 0, 'DJI Dock2', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (28, 0, 91, 0, 'M3D', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (29, 0, 91, 1, 'M3TD', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (30, 1, 80, 0, 'M3D Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (31, 1, 81, 0, 'M3TD Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (38, 0, 100, 0, 'M4D', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (39, 0, 100, 1, 'M4TD', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (40, 1, 98, 0, 'M4D Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (41, 1, 99, 0, 'M4TD Camera', NULL);
INSERT INTO "public"."bus_device_dic"
VALUES (42, 3, 3, 0, 'Dock3', NULL);

--2026/5/25
DROP TABLE IF EXISTS "public"."bus_geo_mark";
CREATE TABLE "public"."bus_geo_mark"
(
    "id"          int8                                        NOT NULL,
    "dock_sn"     varchar(64) COLLATE "pg_catalog"."default"  NOT NULL,
    "mark_type"   varchar(64) COLLATE "pg_catalog"."default"  NOT NULL,
    "mark_name"   varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
    "description" varchar(256) COLLATE "pg_catalog"."default",
    "color"       varchar(64) COLLATE "pg_catalog"."default",
    "font_size"   varchar(16) COLLATE "pg_catalog"."default",
    "icon_style"  varchar(64) COLLATE "pg_catalog"."default",
    "icon_url"    varchar(256) COLLATE "pg_catalog"."default",
    "point_set"   text COLLATE "pg_catalog"."default",
    "create_date" timestamp(6),
    "creator"     varchar(64) COLLATE "pg_catalog"."default"
)
;
COMMENT
ON COLUMN "public"."bus_geo_mark"."id" IS '主键';
COMMENT
ON COLUMN "public"."bus_geo_mark"."dock_sn" IS '设备编号 ALL为全部';
COMMENT
ON COLUMN "public"."bus_geo_mark"."mark_type" IS '类型 / point 点 / line 线 / polygon 面 / circle 圆';
COMMENT
ON COLUMN "public"."bus_geo_mark"."mark_name" IS '标注名称';
COMMENT
ON COLUMN "public"."bus_geo_mark"."description" IS '简介描述';
COMMENT
ON COLUMN "public"."bus_geo_mark"."color" IS '颜色';
COMMENT
ON COLUMN "public"."bus_geo_mark"."font_size" IS '字体大小';
COMMENT
ON COLUMN "public"."bus_geo_mark"."icon_style" IS '图标样式';
COMMENT
ON COLUMN "public"."bus_geo_mark"."icon_url" IS '图标url地址';
COMMENT
ON COLUMN "public"."bus_geo_mark"."point_set" IS '点位信息集合，json格式';
COMMENT
ON COLUMN "public"."bus_geo_mark"."create_date" IS '创建时间';
COMMENT
ON COLUMN "public"."bus_geo_mark"."creator" IS '创建人';
COMMENT
ON TABLE "public"."bus_geo_mark" IS '地图标注';

-- 20260526 航线表新增飞机类型和航线id字段
ALTER TABLE public.bus_route
    ADD COLUMN q20_route_id varchar(50);
COMMENT
ON COLUMN "public"."bus_route"."q20_route_id" IS 'q20航线id';

--20260529
INSERT INTO "public"."sys_dict_type" ("id", "dict_type", "dict_name", "remark", "sort", "creator", "create_date",
                                      "updater", "update_date")
VALUES (2060252437705494529, 'dockType', '机库类型', '', 1, 1067246875800000001, '2026-05-29 14:50:33.446',
        1067246875800000001, '2026-05-29 14:50:33.446');
INSERT INTO "public"."sys_dict_type" ("id", "dict_type", "dict_name", "remark", "sort", "creator", "create_date",
                                      "updater", "update_date")
VALUES (2060253239434121218, 'AROS', '阿罗斯机库', '', 2, 1067246875800000001, '2026-05-29 14:53:44.593',
        1067246875800000001, '2026-05-29 14:53:44.593');
--20260601
INSERT INTO "public"."sys_dict_data" ("id", "dict_type_id", "dict_label", "dict_value", "remark", "sort", "creator",
                                      "create_date", "updater", "update_date", "image_url")
VALUES (2060252576792809474, 2060252437705494529, '大疆机场', 'DJI', '', 1, 1067246875800000001,
        '2026-05-29 14:51:06.607', 1067246875800000001, '2026-05-29 14:51:06.607', NULL);
INSERT INTO "public"."sys_dict_data" ("id", "dict_type_id", "dict_label", "dict_value", "remark", "sort", "creator",
                                      "create_date", "updater", "update_date", "image_url")
VALUES (2060252722469376002, 2060252437705494529, '阿罗斯', 'AROS', '', 0, 1067246875800000001,
        '2026-05-29 14:51:41.339', 1067246875800000001, '2026-05-29 14:51:41.339', 'source-material/Aros.png');
INSERT INTO "public"."sys_dict_data" ("id", "dict_type_id", "dict_label", "dict_value", "remark", "sort", "creator",
                                      "create_date", "updater", "update_date", "image_url")
VALUES (2060253516358848514, 2060253239434121218, 'Ars550', 'Ars550', '', 0, 1067246875800000001,
        '2026-05-29 14:54:50.617', 1067246875800000001, '2026-05-29 14:54:50.617', 'source-material/Ars550.png');



-- 20260605 aros 蛙跳 by zhangchuang
ALTER TABLE public.bus_dock
    ADD scenario varchar(128) NULL;
COMMENT
ON COLUMN public.bus_dock.scenario IS '使用场景';


CREATE TABLE public.bus_multi_group
(
    id    int8         NOT NULL,
    group_name  varchar(128) NOT NULL,
    group_mark  varchar(256) NULL,
    dept_id     int8 NULL,
    creator     int8 NULL,
    create_date timestamp NULL,
    updater     int8 NULL,
    update_date timestamp NULL
);
COMMENT
ON TABLE public.bus_multi_group IS '跳飞设备组信息';

-- Column comments

COMMENT
ON COLUMN public.bus_multi_group.id IS '组id';
COMMENT
ON COLUMN public.bus_multi_group.group_name IS '组名称';
COMMENT
ON COLUMN public.bus_multi_group.group_mark IS '组描述';
COMMENT
ON COLUMN public.bus_multi_group.dept_id IS '所属组织';
COMMENT
ON COLUMN public.bus_multi_group.creator IS '创建人';
COMMENT
ON COLUMN public.bus_multi_group.create_date IS '创建时间';
COMMENT
ON COLUMN public.bus_multi_group.updater IS '更新人';
COMMENT
ON COLUMN public.bus_multi_group.update_date IS '更新时间';



CREATE TABLE public.bus_multi_group_device
(
    id          int8        NOT NULL,
    groud_id    int8        NOT NULL,
    gateway_sn  varchar(64) NOT NULL,
    creator     int8 NULL,
    create_date timestamp NULL,
    updater     int8 NULL,
    update_date timestamp NULL
);
COMMENT
ON TABLE public.bus_multi_group_device IS '蛙跳任务组绑定的设备编号';

-- Column comments

COMMENT
ON COLUMN public.bus_multi_group_device.id IS '编号';
COMMENT
ON COLUMN public.bus_multi_group_device.groud_id IS '蛙跳组';
COMMENT
ON COLUMN public.bus_multi_group_device.gateway_sn IS '设备编号sn';
COMMENT
ON COLUMN public.bus_multi_group_device.creator IS '创建人';
COMMENT
ON COLUMN public.bus_multi_group_device.create_date IS '创建时间';
COMMENT
ON COLUMN public.bus_multi_group_device.updater IS '更新人';
COMMENT
ON COLUMN public.bus_multi_group_device.update_date IS '更新时间';