DROP TABLE IF EXISTS `drill_annual_emergency`;
CREATE TABLE `drill_annual_emergency`
(
    `id`             varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `plan_year`      int NULL DEFAULT NULL COMMENT '计划年度',
    `plan_month`     int NULL DEFAULT NULL COMMENT '计划月份',
    `plan_name`      varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '项目内容',
    `finish_by`      varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '完成人',
    `finish_time`    datetime NULL DEFAULT NULL COMMENT '完成时间',
    `director_by`    bigint NULL DEFAULT NULL COMMENT '负责人',
    `sortd_num`      int NULL DEFAULT NULL COMMENT '排序',
    `is_del`         int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`    datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id` bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`    datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id` bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`   varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '演习预案' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_contingent
-- ----------------------------
DROP TABLE IF EXISTS `drill_contingent`;
CREATE TABLE `drill_contingent`
(
    `id`                varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `contingent_name`   varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '队伍名称',
    `contingent_status` int NULL DEFAULT NULL COMMENT '队伍状态',
    `is_del`            int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`       datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id`    bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`       datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id`    bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`      varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '应急队伍' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_organizational_structure
-- ----------------------------
DROP TABLE IF EXISTS `drill_organizational_structure`;
CREATE TABLE `drill_organizational_structure`
(
    `id`              varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `parent_id`       varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT '父级id',
    `contingent_id`   varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习队伍主键id',
    `drill_ancestors` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT '' COMMENT '祖级列表',
    `drill_post`      varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '应急岗位名称',
    `order_num`       int NULL DEFAULT 0 COMMENT '显示顺序',
    `is_del`          int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`     datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id`  bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`     datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id`  bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`    varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '应急组织架构' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_organizational_structure_personnel
-- ----------------------------
DROP TABLE IF EXISTS `drill_organizational_structure_personnel`;
CREATE TABLE `drill_organizational_structure_personnel`
(
    `id`                                varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `drill_organizational_structure_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT '应急组织架构id',
    `user_id`                           bigint NULL DEFAULT NULL COMMENT '用户id',
    `is_del`                            int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`                       datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id`                    bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`                       datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id`                    bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`                      varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '应急组织架构人员' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_person
-- ----------------------------
DROP TABLE IF EXISTS `drill_person`;
CREATE TABLE `drill_person`
(
    `id`             varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `plan_id`        varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT '演习计划id',
    `drill_person`   bigint NULL DEFAULT NULL COMMENT '演习人员',
    `remark_info`    varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `is_del`         int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`    datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id` bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`    datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id` bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`   varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '演习人员' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_pic
-- ----------------------------
DROP TABLE IF EXISTS `drill_pic`;
CREATE TABLE `drill_pic`
(
    `id`             varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `plan_id`        varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT '演习计划id',
    `pic_url`        varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习照片url',
    `remark_info`    varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `is_del`         int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`    datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id` bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`    datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id` bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`   varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '演习照片' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_plan
-- ----------------------------
DROP TABLE IF EXISTS `drill_plan`;
CREATE TABLE `drill_plan`
(
    `id`                 varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `drill_sn`           varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习计划编号',
    `drill_name`         varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习名称',
    `drill_organizer`    bigint NULL DEFAULT NULL COMMENT '演习组织人',
    `drill_department`   varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习部门',
    `drill_departments`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习部门集合',
    `drill_area`         varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习区域',
    `drill_deck`         varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习地点',
    `drill_type`         varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '演习类型',
    `accident_situation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL COMMENT '事故类型及情况',
    `drill_objective`    text CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL COMMENT '演习目的',
    `plan_start_time`    datetime NULL DEFAULT NULL COMMENT '计划开始时间',
    `plan_end_time`      datetime NULL DEFAULT NULL COMMENT '计划结束时间',
    `plan_year`          int NULL DEFAULT NULL COMMENT '演习年份',
    `plan_month`         int NULL DEFAULT NULL COMMENT '演习月份',
    `reality_start_time` datetime NULL DEFAULT NULL COMMENT '实际开始时间',
    `drill_summary`      text CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL COMMENT '演习总结',
    `drill_status`       int NULL DEFAULT NULL COMMENT '演习状态(1未完成，2已完成)',
    `process_status`     int NULL DEFAULT NULL COMMENT '审核状态(1待审核，2已审核，3已驳回)',
    `process_opinion`    varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '审核意见',
    `process_by`         bigint NULL DEFAULT NULL COMMENT '审核人',
    `is_del`             int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`        datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id`     bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`        datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id`     bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`       varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '演习计划表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_process
-- ----------------------------
DROP TABLE IF EXISTS `drill_process`;
CREATE TABLE `drill_process`
(
    `id`             varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `plan_id`        varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT '演习计划id',
    `content_info`   varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '内容',
    `confirm_status` int NULL DEFAULT NULL COMMENT '确认状态(1待确认，2已确认)',
    `confirm_by`     bigint NULL DEFAULT NULL COMMENT '确认人',
    `confirm_time`   datetime NULL DEFAULT NULL COMMENT '确认时间',
    `sortd_num`      int NULL DEFAULT NULL COMMENT '排序',
    `is_del`         int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`    datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id` bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`    datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id` bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`   varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '演习过程' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for drill_rectification_problems
-- ----------------------------
DROP TABLE IF EXISTS `drill_rectification_problems`;
CREATE TABLE `drill_rectification_problems`
(
    `id`                 varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT 'id',
    `plan_id`            varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NOT NULL COMMENT '演习计划id',
    `problems_info`      varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '问题描述',
    `rectification_info` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '整改措施',
    `person_liable`      bigint NULL DEFAULT NULL COMMENT '责任人',
    `rectification_term` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci NULL DEFAULT NULL COMMENT '整改期限',
    `rectification_by`   bigint NULL DEFAULT NULL COMMENT '整改人',
    `rectification_time` datetime NULL DEFAULT NULL COMMENT '整改时间',
    `sortd_num`          int NULL DEFAULT NULL COMMENT '排序',
    `is_del`             int                                                             NOT NULL DEFAULT 0 COMMENT '删除标识：0正常，1已删除',
    `create_date`        datetime                                                        NOT NULL COMMENT '创建时间',
    `create_user_id`     bigint                                                          NOT NULL COMMENT '创建人ID',
    `update_date`        datetime                                                        NOT NULL COMMENT '更新时间',
    `update_user_id`     bigint                                                          NOT NULL COMMENT '更新人',
    `company_code`       varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_cs_0900_ai_ci  NOT NULL COMMENT '企业编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_cs_0900_ai_ci COMMENT = '整改问题描述' ROW_FORMAT = Dynamic;