-- portal.app_info definition

CREATE TABLE `app_info`
(
    `id`              bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
    `system_name`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '应用系统名称',
    `app_type`        int                                                           DEFAULT NULL COMMENT '应用类型字典表（市局系统，区县系统，派出所常用系统，办公综合系统，专项工具）',
    `system_number`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '应用系统编号',
    `short_name`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '应用简称',
    `dept_name`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '应用事权单位名称',
    `url`             varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '应用系统访问地址',
    `active_flag`     tinyint                                                       DEFAULT NULL COMMENT '系统在用标识（1在用）',
    `icon`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '图标path',
    `police_category` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '警种分类',
    `create_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
    `del_flag`        tinyint                                                       DEFAULT '0' COMMENT '删除状态 0 有效 1无效 ',
    `create_user`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
    `version`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '版本号',
    `star`            bigint                                                        DEFAULT '0' COMMENT '收藏数量',
    `hits`            bigint                                                        DEFAULT '0' COMMENT '点击量',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `system_number_unique_code` (`system_number`),
    KEY               `app_type_dict` (`app_type`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;


-- portal.external_app definition

CREATE TABLE `external_app`
(
    `id`          bigint NOT NULL AUTO_INCREMENT,
    `designation` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '链接名称',
    `url`         varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '链接',
    `create_time` datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;


-- portal.install_info definition

CREATE TABLE `install_info`
(
    `id`          bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
    `app_id`      bigint                                                       DEFAULT NULL COMMENT '应用程序ID',
    `business_id` bigint                                                       DEFAULT '0' COMMENT '业务ID',
    `user_idcard` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户身份证号码',
    `del_flag`    tinyint                                                      DEFAULT '0' COMMENT '删除状态 默认0 有效 1已卸载',
    `create_time` datetime                                                     DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '安装时间',
    `update_time` datetime                                                     DEFAULT NULL COMMENT '更新时间',
    `seq`         int                                                          DEFAULT '0' COMMENT '排序',
    PRIMARY KEY (`id`) USING BTREE,
    KEY           `install_app_id` (`app_id`) USING BTREE,
    KEY           `install_app_idcrad_fk` (`user_idcard`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;


-- portal.issue_info definition

CREATE TABLE `issue_info`
(
    `id`                 bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
    `title`              varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '标题',
    `content`            text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '内容',
    `answer`             text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '解答',
    `create_user`        varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '创建人',
    `create_user_idcard` varchar(18) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci  DEFAULT NULL COMMENT '创建身份证号码',
    `answer_user`        varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '答疑人',
    `create_time`        datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`        datetime                                                      DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `del_flag`           tinyint                                                       DEFAULT '0' COMMENT '删除',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;


-- portal.message_info definition

CREATE TABLE `message_info`
(
    `id`              bigint  NOT NULL AUTO_INCREMENT COMMENT '主键',
    `message_type`    tinyint NOT NULL COMMENT '信息类型 1 通知公告 2信息交流 3 标准规范 ',
    `message_level`   tinyint NOT NULL                                              DEFAULT '0' COMMENT '消息等级 默认0， 1紧急',
    `title`           varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '信息标题',
    `content`         text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '信息内容',
    `attachment_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '附件地址',
    `attachment_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '附近名称',
    `create_by`       varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '创建人',
    `create_user`     varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人姓名',
    `create_org_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人部门名称',
    `create_org_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人部门code',
    `update_by`       varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '修改人',
    `update_user`     varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '修改人姓名',
    `create_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `del_flag`        tinyint                                                       DEFAULT '0' COMMENT '删除状态 默认0 有效 1无效',
    `version`         int                                                           DEFAULT '1' COMMENT '版本号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='信息表';


-- portal.message_info_history definition

CREATE TABLE `message_info_history`
(
    `id`              bigint  NOT NULL AUTO_INCREMENT COMMENT '主键',
    `info_type`       tinyint NOT NULL COMMENT '信息类型 1 通知公告 2信息交流 3 标准规范 ',
    `title`           varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '信息标题',
    `content`         text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '信息内容',
    `attachment_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '附件地址',
    `create_by`       varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '创建人',
    `create_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='信息变更历史表';


-- portal.message_info_scope definition

CREATE TABLE `message_info_scope`
(
    `id`              bigint                                                       NOT NULL AUTO_INCREMENT COMMENT '主键',
    `message_info_id` bigint                                                        DEFAULT NULL COMMENT '信息id',
    `scope_type`      tinyint                                                      NOT NULL COMMENT '范围类型 1部门 2 人员',
    `read_status`     tinyint                                                       DEFAULT '0' COMMENT '阅读状态 默认0未读 1已读',
    `member_id`       varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '人员id',
    `scope_id`        varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门id ',
    `scope_name`      varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '部门名称',
    `scope_level`     int                                                           DEFAULT NULL COMMENT '范围级别',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='信息范围表';


-- portal.msg_record definition

CREATE TABLE `msg_record`
(
    `id`          bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
    `type`        tinyint                                                       DEFAULT NULL COMMENT '1 信息 2 消息通知',
    `req_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '信息内容',
    `create_by`   varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  DEFAULT NULL COMMENT '创建人',
    `create_user` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人姓名',
    `create_time` datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `del_flag`    tinyint                                                       DEFAULT '0' COMMENT '删除状态 默认0 有效 1无效',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消息信息原始记录表';


-- portal.notice_info definition

CREATE TABLE `notice_info`
(
    `id`              bigint  NOT NULL AUTO_INCREMENT COMMENT '主键',
    `message_type`    tinyint NOT NULL COMMENT '消息类型 4 任务类 5 通知类 6 超期提醒类',
    `message_level`   tinyint NOT NULL                                              DEFAULT '0' COMMENT '消息等级 默认0， 1紧急',
    `title`           varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '消息标题',
    `content`         text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '消息内容',
    `attachment_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '附件地址',
    `create_by`       varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '创建人',
    `create_user`     varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人姓名',
    `create_org_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人部门code',
    `create_org_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人部门名称',
    `scope_id`        varchar(100)                                                  DEFAULT NULL COMMENT '范围id',
    `scope_url`       varchar(100)                                                  DEFAULT NULL COMMENT '范围url',
    `scope_name`      varchar(100)                                                  DEFAULT NULL COMMENT '范围名称',
    `update_by`       varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  DEFAULT NULL COMMENT '修改人',
    `update_user`     varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '修改人姓名',
    `create_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `del_flag`        tinyint                                                       DEFAULT '0' COMMENT '删除状态 默认0 有效 1无效',
    `version`         int                                                           DEFAULT '1' COMMENT '版本号',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消息表';


-- portal.notice_info_scope definition

CREATE TABLE `notice_info_scope`
(
    `id`             bigint                                                       NOT NULL AUTO_INCREMENT COMMENT '主键',
    `notice_info_id` bigint                                                       NOT NULL COMMENT '消息id',
    `member_id`      varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '人员id',
    `read_status`    tinyint                                                       DEFAULT '0' COMMENT '阅读状态 默认0未读 1已读',
    `scope_type`     tinyint                                                      NOT NULL COMMENT '范围类型 1部门 2 人员 3 应用',
    `scope_id`       varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '范围id ',
    `scope_name`     varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '部门名称',
    `scope_level`    int                                                           DEFAULT NULL COMMENT '范围级别',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消息通知范围表';


-- portal.sys_dept definition

CREATE TABLE `sys_dept`
(
    `org_code`    varchar(12) NOT NULL,
    `up_org_code` varchar(12)  DEFAULT NULL,
    `org_kind`    varchar(2)   DEFAULT NULL,
    `full_name`   varchar(100) DEFAULT NULL,
    `short_name`  varchar(100) DEFAULT NULL,
    `area_code`   varchar(6)   DEFAULT NULL,
    `stand_code`  varchar(12)  DEFAULT NULL,
    `org_type`    varchar(2)   DEFAULT NULL,
    `org_level`   varchar(2)   DEFAULT NULL,
    `org_rank`    varchar(10)  DEFAULT NULL,
    `unit_class`  varchar(20)  DEFAULT NULL,
    `email`       varchar(30)  DEFAULT NULL,
    `link_man`    varchar(20)  DEFAULT NULL,
    `phone`       varchar(20)  DEFAULT NULL,
    `update_time` varchar(20)  DEFAULT NULL,
    `deleted`     varchar(1)   DEFAULT NULL,
    PRIMARY KEY (`org_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='部门表';


-- portal.sys_dict definition

CREATE TABLE `sys_dict`
(
    `id`          int      NOT NULL AUTO_INCREMENT COMMENT '编号',
    `type`        varchar(100)      DEFAULT NULL,
    `description` varchar(100)      DEFAULT NULL,
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `remarks`     varchar(255)      DEFAULT NULL,
    `del_flag`    char(1)           DEFAULT '0',
    `tenant_id`   int      NOT NULL DEFAULT '0' COMMENT '所属租户',
    PRIMARY KEY (`id`) USING BTREE,
    KEY           `sys_dict_del_flag` (`del_flag`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='字典表';


-- portal.sys_dict_item definition

CREATE TABLE `sys_dict_item`
(
    `id`          int      NOT NULL AUTO_INCREMENT COMMENT '编号',
    `dict_id`     int      NOT NULL,
    `value`       varchar(100)      DEFAULT NULL,
    `label`       varchar(100)      DEFAULT NULL,
    `type`        varchar(100)      DEFAULT NULL,
    `description` varchar(100)      DEFAULT NULL,
    `sort`        int      NOT NULL DEFAULT '0' COMMENT '排序（升序）',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `remarks`     varchar(4000)     DEFAULT NULL,
    `del_flag`    char(1)           DEFAULT '0',
    PRIMARY KEY (`id`) USING BTREE,
    KEY           `sys_dict_value` (`value`) USING BTREE,
    KEY           `sys_dict_label` (`label`) USING BTREE,
    KEY           `sys_dict_del_flag` (`del_flag`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='字典项';


-- portal.sys_log definition

CREATE TABLE `sys_log`
(
    `id`              bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
    `module_name`     varchar(100)                                                  DEFAULT NULL COMMENT '模块名称',
    `module_type`     varchar(100)                                                  DEFAULT NULL COMMENT '模块类型',
    `title`           varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '操作名称',
    `create_by`       varchar(30)                                                   DEFAULT NULL,
    `create_user`     varchar(255)                                                  DEFAULT NULL,
    `create_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `sys_number`      varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '操作编码',
    `create_org_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人部门名称',
    `create_org_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人部门code',
    `update_time`     datetime                                                      DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `remote_addr`     varchar(255)                                                  DEFAULT NULL,
    `user_agent`      varchar(1000)                                                 DEFAULT NULL,
    `request_uri`     varchar(255)                                                  DEFAULT NULL,
    `method`          varchar(10)                                                   DEFAULT NULL,
    `params`          text,
    `time`            mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci COMMENT '执行时间',
    `del_flag`        char(1)                                                       DEFAULT '0',
    `exception`       text COMMENT '异常信息',
    PRIMARY KEY (`id`) USING BTREE,
    KEY               `sys_log_create_by` (`create_by`) USING BTREE,
    KEY               `sys_log_request_uri` (`request_uri`) USING BTREE,
    KEY               `sys_log_create_date` (`create_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1747855 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='日志表';


-- portal.sys_menu definition

CREATE TABLE `sys_menu`
(
    `menu_code`   varchar(20) NOT NULL,
    `menu_name`   varchar(50) DEFAULT NULL,
    `parent_code` varchar(20) DEFAULT NULL,
    PRIMARY KEY (`menu_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='菜单信息表';


-- portal.sys_role definition

CREATE TABLE `sys_role`
(
    `role_code` varchar(20) NOT NULL,
    `role_name` varchar(30) NOT NULL,
    PRIMARY KEY (`role_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色信息表';


-- portal.sys_user definition

CREATE TABLE `sys_user`
(
    `idcard`          varchar(18) NOT NULL,
    `name`            varchar(30)  DEFAULT NULL,
    `police_number`   varchar(10)  DEFAULT NULL,
    `org_code`        varchar(12)  DEFAULT NULL,
    `org_name`        varchar(100) DEFAULT NULL,
    `user_type`       varchar(2)   DEFAULT NULL,
    `deleted`         char(1)      DEFAULT NULL,
    `update_time`     varchar(20)  DEFAULT NULL,
    `rank`            varchar(10)  DEFAULT NULL,
    `title`           varchar(50)  DEFAULT NULL,
    `man_type`        varchar(2)   DEFAULT NULL,
    `police_category` varchar(10)  DEFAULT NULL,
    `police_business` varchar(20)  DEFAULT NULL,
    `sex`             varchar(1)   DEFAULT NULL,
    `birth`           varchar(8)   DEFAULT NULL,
    `nation`          varchar(3)   DEFAULT NULL,
    `address`         varchar(100) DEFAULT NULL,
    `phone`           varchar(20)  DEFAULT NULL,
    `mobile_work`     varchar(20)  DEFAULT NULL,
    `mobile_private`  varchar(20)  DEFAULT NULL,
    `qq_account`      varchar(20)  DEFAULT NULL,
    `email`           varchar(30)  DEFAULT NULL,
    `wx_account`      varchar(20)  DEFAULT NULL,
    `post_type`       varchar(20)  DEFAULT NULL,
    `job_type`        varchar(20)  DEFAULT NULL,
    PRIMARY KEY (`idcard`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户信息表';


-- portal.sys_user_menu definition

CREATE TABLE `sys_user_menu`
(
    `id`        int         NOT NULL AUTO_INCREMENT,
    `menu_code` varchar(255) DEFAULT NULL,
    `idcard`    varchar(18) NOT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户信息表';


-- portal.business_info definition

CREATE TABLE `business_info`
(
    `id`              bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
    `business_name`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '业务名称',
    `business_type`   int                                                           DEFAULT NULL COMMENT '业务类型(字典表-business_type)',
    `business_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '业务代码',
    `app_id`          bigint                                                        DEFAULT NULL COMMENT '应用ID',
    `app_name`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所属应用名称',
    `url`             varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '业务访问地址',
    `active_flag`     tinyint                                                       DEFAULT '1' COMMENT '系统在用标识（1在用）',
    `create_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`     datetime                                                      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `del_flag`        tinyint                                                       DEFAULT '0' COMMENT '删除状态 0 有效 1无效',
    `create_user`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
    `star`            bigint                                                        DEFAULT '0' COMMENT '收藏数量',
    `hits`            bigint                                                        DEFAULT '0' COMMENT '点击量',
    PRIMARY KEY (`id`) USING BTREE,
    KEY               `business_type_dict` (`business_type`) USING BTREE,
    KEY               `business_appid_appinfo` (`app_id`) USING BTREE,
    CONSTRAINT `business_appid_appinfo` FOREIGN KEY (`app_id`) REFERENCES `app_info` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
    CONSTRAINT `business_info_FK` FOREIGN KEY (`business_type`) REFERENCES `sys_dict_item` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;


-- portal.file_info definition

CREATE TABLE `file_info`
(
    `id`           bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
    `file_name`    varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '文件名',
    `url`          varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '路径',
    `type`         int                                                           DEFAULT NULL COMMENT '文件类型（办公常用，系统工具......）',
    `extension`    varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '拓展名',
    `size`         bigint                                                        DEFAULT NULL COMMENT '文件大小',
    `content_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'ContentType',
    `downloads`    bigint                                                        DEFAULT '0' COMMENT '下载量',
    `create_time`  datetime                                                      DEFAULT CURRENT_TIMESTAMP COMMENT '上传时间',
    `update_time`  datetime                                                      DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `del_flag`     tinyint                                                       DEFAULT '0' COMMENT '删除',
    `create_user`  varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '上传人',
    PRIMARY KEY (`id`) USING BTREE,
    KEY            `file_type_id_fk` (`type`) USING BTREE,
    CONSTRAINT `file_info_FK` FOREIGN KEY (`type`) REFERENCES `sys_dict_item` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=120 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
