/*
 Navicat Premium Data Transfer

 Source Server         : 测试
 Source Server Type    : MariaDB
 Source Server Version : 100318
 Source Host           : test.tall.wiki:3306
 Source Schema         : tall

 Target Server Type    : MariaDB
 Target Server Version : 100318
 File Encoding         : 65001

 Date: 13/05/2021 15:12:45
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_constant
-- ----------------------------
DROP TABLE IF EXISTS `t_constant`;
CREATE TABLE `t_constant`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0,
  `business_id` bigint(20) NULL DEFAULT 0 COMMENT '业务id',
  `business_type` tinyint(2) NOT NULL DEFAULT 0 COMMENT '业务id的类型 0任务 1插件 2其他',
  `t_key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '',
  `t_value` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '描述',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '常量表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_file
-- ----------------------------
DROP TABLE IF EXISTS `t_file`;
CREATE TABLE `t_file`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '上传用户ID',
  `file_name` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文件名',
  `location` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '存储位置',
  `visit_location` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '访问位置',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_pro_deliver_history_record
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_deliver_history_record`;
CREATE TABLE `t_pro_deliver_history_record`  (
  `id` bigint(20) NOT NULL COMMENT '交付物历史记录表id',
  `deliver_id` bigint(20) NULL DEFAULT 0 COMMENT '交付物id(输入文档或输出文档)',
  `deliver_type` tinyint(1) NULL DEFAULT 0 COMMENT '交付物类型(0-输入文档,1-输出文档)',
  `deliver_record_id` bigint(20) NULL DEFAULT 0 COMMENT '交付物记录id',
  `do_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '操作类型(0-上传,1-修改,2-删除,3-通过,4-驳回,5-添加[添加备注],6-删除输入文档下所有文件)',
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `content` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '操作内容',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '0-正常,1-禁用,2-删除',
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `history_remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `deliver_id`(`deliver_id`) USING BTREE,
  INDEX `deliver_record_id`(`deliver_record_id`) USING BTREE,
  INDEX `role_id`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '交付物历史记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_log
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_log`;
CREATE TABLE `t_pro_log`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0,
  `time` bigint(20) NULL DEFAULT 0,
  `type` tinyint(1) NULL DEFAULT NULL,
  `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `user_id` bigint(20) NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_index`(`task_detail_id`) USING BTREE,
  INDEX `t_pro_log_ibfk_2`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务操作日志' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_member
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_member`;
CREATE TABLE `t_pro_member`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '昵称',
  `avatar_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像',
  `no` int(11) NULL DEFAULT 0 COMMENT '编号',
  `phone` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号',
  `description` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '详情',
  `join_time` bigint(20) NULL DEFAULT 0,
  `stakeholder_id` bigint(20) NULL DEFAULT 0 COMMENT '用户的奖惩干系人id 对应成员id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `member_project_index`(`project_id`) USING BTREE,
  INDEX `member_user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成员表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_member_role
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_member_role`;
CREATE TABLE `t_pro_member_role`  (
  `id` bigint(20) NOT NULL,
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `member_index`(`member_id`) USING BTREE,
  INDEX `role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成员角色表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_member_role_show
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_member_role_show`;
CREATE TABLE `t_pro_member_role_show`  (
  `id` bigint(20) NOT NULL,
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `sequence` int(11) NULL DEFAULT 0 COMMENT '序号',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `role_type` tinyint(1) NULL DEFAULT 0 COMMENT '0-正常角色,1-项目为角色 ',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `member_index`(`member_id`) USING BTREE,
  INDEX `role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成员角色展示表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_notes
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_notes`;
CREATE TABLE `t_pro_notes`  (
  `id` bigint(20) NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '笔记内容',
  `task_id` bigint(20) NULL DEFAULT 0 COMMENT '任务日期id（subTime）',
  `plugin_id` bigint(20) NULL DEFAULT 0 COMMENT '插件id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `time` bigint(20) NULL DEFAULT 0 COMMENT '记笔记的时间',
  `publicity` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否公开展示给他人',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_index`(`task_id`) USING BTREE,
  INDEX `plugin_index`(`plugin_id`) USING BTREE,
  INDEX `role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '笔记表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_plugin_config
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin_config`;
CREATE TABLE `t_pro_plugin_config`  (
  `id` bigint(20) NOT NULL,
  `task_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id',
  `web_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '页面接口路径',
  `plugin_id` bigint(20) NULL DEFAULT 0 COMMENT '插件id',
  `place_location` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '放置位置 默认0 ，0任务名 1详情页 2任务下',
  `routine_location` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '程序位置 0:tall内部，1外部',
  `import_param` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '入参',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_index`(`task_id`) USING BTREE,
  INDEX `plugin_index`(`plugin_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件配置表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_plugin_parameter
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin_parameter`;
CREATE TABLE `t_pro_plugin_parameter`  (
  `id` bigint(20) NOT NULL,
  `sub_task_id` bigint(20) NULL DEFAULT 0 COMMENT '分解后的任务id',
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '关联的项目id',
  `plugin_id` bigint(20) NULL DEFAULT 0 COMMENT '插件id',
  `parameter` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '参数',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `parameter_sub_task_index`(`sub_task_id`) USING BTREE,
  INDEX `parameter_member_index`(`member_id`) USING BTREE,
  INDEX `parameter_project_index`(`project_id`) USING BTREE,
  INDEX `parameter_plugin_index`(`plugin_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件参数表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_plugin_preview_file
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin_preview_file`;
CREATE TABLE `t_pro_plugin_preview_file`  (
  `id` bigint(20) NOT NULL,
  `plugin_id` bigint(20) NULL DEFAULT 0 COMMENT '插件id',
  `file_id` bigint(20) NULL DEFAULT 0 COMMENT '文件id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0 COMMENT '0-删除,1-禁用,3-删除',
  `preview_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '预览图描述',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `plugin_index`(`plugin_id`) USING BTREE,
  INDEX `file_index`(`file_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件预览文件表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_plugin_signin
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin_signin`;
CREATE TABLE `t_pro_plugin_signin`  (
  `id` bigint(20) NOT NULL,
  `task_plugin_id` bigint(20) NULL DEFAULT 0 COMMENT '任务插件表id',
  `signin_field_id` bigint(20) NULL DEFAULT 0 COMMENT '配置表id',
  `is_fuzzy` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否需要模糊查询 0否 1是',
  `is_required` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否是必填项 0否 1是',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_plugin_index`(`task_plugin_id`) USING BTREE,
  INDEX `signin_field_index`(`signin_field_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '签到字段和插件关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_plugin_signin_fuzzy
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_plugin_signin_fuzzy`;
CREATE TABLE `t_pro_plugin_signin_fuzzy`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `signin_field_id` bigint(20) NULL DEFAULT 0 COMMENT '配置表id',
  `description` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '内容',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `signin_field_index`(`signin_field_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '模糊查询的信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_project_file
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_project_file`;
CREATE TABLE `t_pro_project_file`  (
  `id` bigint(32) NOT NULL,
  `business_id` bigint(32) NULL DEFAULT 0 COMMENT '业务ID',
  `wps_file_id` bigint(32) UNSIGNED NULL DEFAULT 0 COMMENT '文件id',
  `business_type` tinyint(3) UNSIGNED NULL DEFAULT 0 COMMENT '业务类型 0: 项目ID 1:交付物ID 2会议记录 3产品依据表,4产品收入表,5成本表,6损益表,7现金流表,8数钱游戏配置,9赛跑游戏配置,10拔河游戏配置,11跳绳项目',
  `privilege` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '权限：0：只读 1：可编辑 2：根据link查询',
  `privilege_query_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '查询权限路径',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_file_id`(`wps_file_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件和项目关联' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_remind
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_remind`;
CREATE TABLE `t_pro_remind`  (
  `id` bigint(20) NOT NULL,
  `sub_task_id` bigint(20) NULL DEFAULT 0 COMMENT '任务日期id（subTime）',
  `remind_timing` tinyint(2) NULL DEFAULT 0 COMMENT '提醒的时机 0不提醒 1开始前，2开始时，3开始后，4结束前，5结束时，6结束后，7自定义时间',
  `remind_absolute_time` bigint(20) NULL DEFAULT 0 COMMENT '提醒的绝对时间',
  `finish_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '提醒状态 0新建 1已设置推送 2进行中 3推送失败 4已结束',
  `remind_times` int(11) NULL DEFAULT 0 COMMENT '提醒次数',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `duration` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '设定的时长',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `sub_task_index`(`sub_task_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务提醒信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_role
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role`;
CREATE TABLE `t_pro_role`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '一级角色id（一级角色为null）',
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '名称',
  `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '详情',
  `sequence` int(11) NULL DEFAULT 0 COMMENT '序号',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `relevance_project_id` bigint(20) NULL DEFAULT 0 COMMENT '虚拟项目角色时关联的项目id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `role_project_index`(`project_id`, `parent_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_role_execlude
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role_execlude`;
CREATE TABLE `t_pro_role_execlude`  (
  `id` bigint(20) NOT NULL,
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `other_role_id` bigint(20) NULL DEFAULT 0 COMMENT '不让哪些角色看',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `exclude_other_role_index`(`other_role_id`) USING BTREE,
  INDEX `exclude_role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '对谁不可见' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_role_power
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role_power`;
CREATE TABLE `t_pro_role_power`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '名称',
  `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '详情',
  `power` tinyint(1) NULL DEFAULT 0 COMMENT '权限等级 0 只能查看自己能看的 1 能查看项目，可以上传交付物 2 操作权限 3 操作权限和管理权限4 最高权限',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '一级角色权限表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_show
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_show`;
CREATE TABLE `t_pro_show`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `slide` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '上下滑动类型 0:上下滑动  1：只支持向下滑 2：只支持上滑 4：上下都不滑动',
  `filter` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '过滤器显示 0：都显示  1：都不显示  2.只展示时间轴/清单',
  `is_show_mvp` tinyint(2) NULL DEFAULT 1 COMMENT '是否展示mvp 0不展示 1展示',
  `style` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '0 胶囊 1列表',
  `create_task` tinyint(2) UNSIGNED NULL DEFAULT 1 COMMENT '是否展示添加任务按钮 0不展示 1展示',
  `time_show` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'MM-dd HH:mm' COMMENT '开始时间显示样式（默认 MM-dd HH:mm) 为空时不展示时间',
  `duration` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '时长展示单位 0：根据时长转换成对应分钟或小时  1：不展示  2：转化成分钟  3：转化成小时',
  `show_shortcuts` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否展示快捷方式（交付物硬件按钮）0不展示 1展示',
  `select_task_type` tinyint(2) UNSIGNED NULL DEFAULT 2 COMMENT '查询任务类型 0日程，1天，2周，3月，4分页查找',
  `detail_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '/project' COMMENT '第三栏展示详情页的路径，默认project，null不展示',
  `pims_nav_type` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '项目关联导航类型 0无关联 1例会系统 2财务系统 3课程',
  `share_change` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '是否支持被分享者加入任何角色 0游客 1关注者 2项目成员 3项目经理及以上 4不开启',
  `share_change_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'ccsens' COMMENT '变身时的秘钥',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  `role_belong` tinyint(2) UNSIGNED NULL DEFAULT 1 COMMENT '是否查看不属于自己的角色 0不查看 1查看',
  `milestone_subtask` tinyint(1) NULL DEFAULT 0 COMMENT '里程碑或子任务(0-里程碑,1-查全部)',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目展示的配置表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_sub_time_member
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_sub_time_member`;
CREATE TABLE `t_pro_sub_time_member`  (
  `id` bigint(20) NOT NULL,
  `task_sub_time_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id',
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `complated_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '完成状态 0未完成 1进行中 2已完成 ',
  `real_finish_time` bigint(20) NULL DEFAULT 0 COMMENT '实际完成的时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_sub_time_index`(`task_sub_time_id`) USING BTREE,
  INDEX `member_index`(`member_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成员任务完成表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_comment
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_comment`;
CREATE TABLE `t_pro_task_comment`  (
  `id` bigint(32) NOT NULL,
  `user_id` bigint(32) NULL DEFAULT 0 COMMENT '评论者的userId',
  `task_sub_time_id` bigint(32) NULL DEFAULT 0 COMMENT '拆分后的任务id',
  `time` bigint(32) NULL DEFAULT 0 COMMENT '评论的时间',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '评论的详情',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `projectId` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE,
  INDEX `task_sub_time_index`(`task_sub_time_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '评论表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_pro_task_deliver
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_deliver`;
CREATE TABLE `t_pro_task_deliver`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id',
  `is_final` int(11) NULL DEFAULT 0 COMMENT '是否完成',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `description` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `sequence` int(11) NULL DEFAULT 0,
  `check_status` int(11) NULL DEFAULT 0 COMMENT '检查状态',
  `is_upload` int(11) NULL DEFAULT 0 COMMENT '是否上传',
  `is_input` int(11) NULL DEFAULT 0 COMMENT '是否是输入文档 1是 0不是',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `deliver_task_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '交付物表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_deliver_post_log
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_deliver_post_log`;
CREATE TABLE `t_pro_task_deliver_post_log`  (
  `id` bigint(20) NOT NULL,
  `deliver_id` bigint(20) NULL DEFAULT 0 COMMENT '关联的交付物id',
  `task_sub_time_id` bigint(20) NULL DEFAULT 0 COMMENT '关联任务的绝对时间Id',
  `file_id` bigint(20) NULL DEFAULT 0 COMMENT '文件id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '上传者的userid',
  `version` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '版本',
  `description` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '上传时的备注',
  `time` bigint(20) NULL DEFAULT 0 COMMENT '上传的时间',
  `is_history` int(11) NULL DEFAULT 0 COMMENT '是否是历史信息 0不是 1是',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `files_id` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '多个文件id的集合',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `log_deliver_index`(`deliver_id`) USING BTREE,
  INDEX `deliver_log_user_index`(`user_id`) USING BTREE,
  INDEX `log_file_index`(`file_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '交付物文件关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_deliver_post_log_checker
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_deliver_post_log_checker`;
CREATE TABLE `t_pro_task_deliver_post_log_checker`  (
  `id` bigint(20) NOT NULL,
  `deliver_post_log_id` bigint(20) NULL DEFAULT 0 COMMENT '关联的交付物id',
  `checker_id` bigint(20) NULL DEFAULT 0 COMMENT '检查人的id(角色)',
  `remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '检查人留的备注信息',
  `check_status` int(11) NULL DEFAULT 0 COMMENT '检查状态 0未检查，1合格，2不合格',
  `score` int(11) UNSIGNED NULL DEFAULT 10 COMMENT '检查人的评分',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `deliver_post_log_index`(`deliver_post_log_id`) USING BTREE,
  INDEX `checker_index`(`checker_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '上传的交付物与检查人关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_detail
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_detail`;
CREATE TABLE `t_pro_task_detail`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `name` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '任务名称',
  `description` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '任务详情',
  `begin_time` bigint(20) NULL DEFAULT 0 COMMENT '任务开始时间 标准任务（标准时间戳），，，全局任务（项目开始结束时间） 取时间',
  `end_time` bigint(20) NULL DEFAULT 0 COMMENT '任务结束时间',
  `cycle` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '重复频率 例如【每天】',
  `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父任务id(本身为一级任务时为null) 关联子任务表',
  `sub_task` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '关联子日程表表名',
  `sub_project_id` bigint(20) NULL DEFAULT 0 COMMENT '关联的子项目的id',
  `sub_project` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '关联子项目表表名 eg:第一组wbs',
  `executor_role` bigint(20) NULL DEFAULT 0 COMMENT '负责人(角色)id',
  `checker_role` bigint(20) NULL DEFAULT 0 COMMENT '检查人（角色)id',
  `money` bigint(20) NULL DEFAULT 0 COMMENT '奖惩金额,单位：分',
  `delay` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '延迟模式，0时间到立刻切换 1延迟delay_time切换 2不切换',
  `delay_time` bigint(20) NULL DEFAULT 0 COMMENT '延迟时间',
  `loop_to` bigint(20) NULL DEFAULT 0 COMMENT '跳转的任务id',
  `loop_times` int(11) NULL DEFAULT 0 COMMENT '跳转次数',
  `virtual` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '任务类型，0普通任务 1虚拟任务',
  `level` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '任务等级 1一级任务 2二级任务',
  `has_group` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '此任务下有无分组 0无分组 1有分组',
  `finish_need_all` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否需要全部打卡完成',
  `all_member` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否包含全体成员 0不包含 1包含',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `priority` tinyint(2) NULL DEFAULT 0 COMMENT '优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急  默认0',
  `milestone` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '普通任务' COMMENT '任务标签 普通任务 重要任务 里程碑',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `detail_project_index`(`project_id`) USING BTREE,
  INDEX `detail_executor_index`(`executor_role`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务详情表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_hardware
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_hardware`;
CREATE TABLE `t_pro_task_hardware`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '硬件名称',
  `type` int(11) NULL DEFAULT 0 COMMENT '类型',
  `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '硬件备注名',
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '关联的任务id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '属于哪个用户',
  `mount_time` bigint(20) NULL DEFAULT 0 COMMENT '挂载的时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `hardware_task_index`(`task_detail_id`) USING BTREE,
  INDEX `hardware_user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '硬件设备表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_input_doc
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_input_doc`;
CREATE TABLE `t_pro_task_input_doc`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文件名称',
  `description` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `sequence` int(11) NULL DEFAULT 0,
  `is_upload` int(11) NULL DEFAULT 0 COMMENT '是否上传 0否 1是',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `deliver_task_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '输入文档表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_input_record
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_input_record`;
CREATE TABLE `t_pro_task_input_record`  (
  `id` bigint(20) NOT NULL,
  `input_doc_id` bigint(20) NULL DEFAULT 0 COMMENT '输入文档表id',
  `file_id` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '输入文件id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '上传人的userid',
  `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '文件的状态 0未使用，1正在使用',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注信息',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `input_doc_id_index`(`input_doc_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '输入文件上传记录表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_label
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_label`;
CREATE TABLE `t_pro_task_label`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id',
  `label_id` bigint(20) NULL DEFAULT 0 COMMENT '标签Id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_detail_index`(`task_detail_id`) USING BTREE,
  INDEX `label_index`(`label_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务标签关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_member
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_member`;
CREATE TABLE `t_pro_task_member`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id',
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_detail_index`(`task_detail_id`) USING BTREE,
  INDEX `member_index`(`member_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务关联成员表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_plugin
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_plugin`;
CREATE TABLE `t_pro_task_plugin`  (
  `id` bigint(20) NOT NULL,
  `plugin_id` bigint(20) NULL DEFAULT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '关联的任务id',
  `member_role_id` bigint(20) NULL DEFAULT 0 COMMENT '关联的角色id',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `description` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `sequence` int(11) NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `plugin_task_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '插件表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_show
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_show`;
CREATE TABLE `t_pro_task_show`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id',
  `time_show` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'MM-DD HH:mm' COMMENT '开始时间显示样式（默认 MM-dd HH:mm) 为空时不展示时间',
  `duration` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '时长展示单位 0：根据时长转换成对应分钟或小时  1：不展示  2：转化成分钟  3：转化成小时',
  `create_task` tinyint(2) UNSIGNED NULL DEFAULT 1 COMMENT '是否展示添加任务按钮 0不展示 1展示',
  `show_hardware` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否硬件按钮 0不展示 1展示',
  `show_deliver` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否展示交付物按钮 0不展示 1展示',
  `show_money` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否展示奖惩金额按钮 0不展示 1展示',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  `show_real_time` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '时间轴上显示计划时间还是实际时间 0计划时间，1实际时间',
  `show_finish` tinyint(2) UNSIGNED NULL DEFAULT 1 COMMENT '是否展示完成按钮 0不展示 1展示',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `task_detail_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务展示的配置表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_task_sub_time
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_sub_time`;
CREATE TABLE `t_pro_task_sub_time`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `begin_time` bigint(20) NULL DEFAULT 0 COMMENT '任务开始时间',
  `end_time` bigint(20) NULL DEFAULT 0 COMMENT '结束时间',
  `real_begin_time` bigint(20) NULL DEFAULT 0 COMMENT '实际开始时间',
  `real_end_time` bigint(20) NULL DEFAULT 0 COMMENT '实际结束时间',
  `complated_status` int(11) NULL DEFAULT 0 COMMENT '完成状态 0未开始 1进行中 2已结束',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_detail_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目任务表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_todo
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_todo`;
CREATE TABLE `t_pro_todo`  (
  `id` bigint(20) NOT NULL,
  `content` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '清单内容',
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id',
  `isFinish` tinyint(1) NULL DEFAULT 0 COMMENT '是否完成',
  `created_id` bigint(20) NULL DEFAULT 0 COMMENT '创建者id',
  `send_id` bigint(20) NULL DEFAULT 0 COMMENT '发送者id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `todo_task_index`(`task_detail_id`) USING BTREE,
  INDEX `todo_created_index`(`created_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代办事务清单' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_pro_user_attention_role
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_user_attention_role`;
CREATE TABLE `t_pro_user_attention_role`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色Id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE,
  INDEX `role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户关注的角色表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_auth
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_auth`;
CREATE TABLE `t_sys_auth`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `identify_type` tinyint(1) NULL DEFAULT 0 COMMENT '认证的类型 0微信小程序，1电话，2邮箱，3账号，4微信公众号，5微信网页登陆，6微博，7企业微信',
  `identifier` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户标识()手机号等',
  `credential` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户凭证/密码',
  `salt` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '盐，加密时所需',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `register_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '注册类型 0手动注册，1系统添加',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `auth_user_index`(`user_id`) USING BTREE,
  INDEX `auth_identify_index`(`identify_type`, `identifier`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '认证信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_balance_log
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_balance_log`;
CREATE TABLE `t_sys_balance_log`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0,
  `balance` bigint(11) NULL DEFAULT 0 COMMENT '当前余额',
  `offset` bigint(11) NULL DEFAULT 0 COMMENT '变更余额可以为负',
  `type` int(11) NULL DEFAULT 0,
  `description` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '余额表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_commited_file
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_commited_file`;
CREATE TABLE `t_sys_commited_file`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文件名',
  `path` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文件路径',
  `md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `sha1` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `time` bigint(20) NULL DEFAULT 0 COMMENT '上传的时间',
  `count` int(11) NULL DEFAULT 0 COMMENT '被引用的次数',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文件信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_domain
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_domain`;
CREATE TABLE `t_sys_domain`  (
  `id` bigint(20) NOT NULL,
  `domain_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '域名',
  `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'logo',
  `logo_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'logo的下载地址',
  `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司名',
  `system_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '系统名',
  `backdrop_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '登陆背景图路径',
  `show_calendar` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '是否显示日历 0不显示 1显示',
  `show_project_id` bigint(20) NULL DEFAULT 0 COMMENT '不展示日历时，默认展示的项目的id',
  `caption` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '标题',
  `headline` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '栏外标题',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  `forever_project_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '常驻项目id',
  `navigation_bar` tinyint(2) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '导航 0不显示导航，1横向导航，2纵向导航' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_domain_navigation_bar
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_domain_navigation_bar`;
CREATE TABLE `t_sys_domain_navigation_bar`  (
  `id` bigint(20) NOT NULL,
  `domain_id` bigint(20) NULL DEFAULT 0 COMMENT 'domainId',
  `text` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '文字内容',
  `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '0内部链接 1外部链接',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '对应的链接',
  `params` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '导航栏图标',
  `position` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '位置 0左侧/上，1右侧/下',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `domain_index`(`domain_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'domain导航详细信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_grade
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_grade`;
CREATE TABLE `t_sys_grade`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `sequence` int(11) NULL DEFAULT 0,
  `avatar_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '等级权限表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_imitation
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_imitation`;
CREATE TABLE `t_sys_imitation`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '被分享的用户变身表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_label
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_label`;
CREATE TABLE `t_sys_label`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '标签名',
  `code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '标签Code',
  `color` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '颜色',
  `description` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注说明',
  `level` tinyint(5) UNSIGNED NULL DEFAULT 1 COMMENT '标签优先级',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  `business_type` tinyint(1) NULL DEFAULT 0 COMMENT '业务类型 0项目 1任务',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_log
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_log`;
CREATE TABLE `t_sys_log`  (
  `id` bigint(20) NOT NULL,
  `url` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '接口路径',
  `method_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '接口描述',
  `params` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '接口参数',
  `result` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '接口返回值（或异常）',
  `created_at` timestamp NULL DEFAULT current_timestamp,
  `updated_at` timestamp NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `facility` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '设备信息',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '日志表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for t_sys_message_send
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_message_send`;
CREATE TABLE `t_sys_message_send`  (
  `id` bigint(32) NOT NULL,
  `operation_id` bigint(32) NULL DEFAULT 0 COMMENT '操作ID',
  `receiver_id` bigint(32) NULL DEFAULT 0 COMMENT '消息接收者ID --userid',
  `send_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '发送类型 0:ws,1:微信公众号',
  `send_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '发送状态 0失败 1成功',
  `read_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '阅读状态 0未读 1已读',
  `init_read` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否为初始阅读 0:否 1:是',
  `send_time` bigint(32) NULL DEFAULT 0 COMMENT '操作时间',
  `complete` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '发送状态 0失败 1成功',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `msg_send_operation_index`(`operation_id`) USING BTREE,
  INDEX `msg_send_reciver_index`(`receiver_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息内容' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_message_type
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_message_type`;
CREATE TABLE `t_sys_message_type`  (
  `id` bigint(32) NOT NULL,
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '发送消息的接口名',
  `path` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '接口路径',
  `operate_type` tinyint(5) UNSIGNED NULL DEFAULT 0 COMMENT '接口类型',
  `template` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '消息模板',
  `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '备注',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息类型总表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_operation
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_operation`;
CREATE TABLE `t_sys_operation`  (
  `id` bigint(32) NOT NULL,
  `operator_id` bigint(32) NULL DEFAULT 0 COMMENT '操作人Id--userid',
  `project_id` bigint(32) NULL DEFAULT 0 COMMENT '项目ID',
  `operate_type` tinyint(5) UNSIGNED NULL DEFAULT 0 COMMENT '操作类型--同t_sys_message_type',
  `operation_time` bigint(32) NULL DEFAULT 0 COMMENT '操作时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  `task_detail_id` bigint(32) NULL DEFAULT 0 COMMENT '任务详情id',
  `do_type` tinyint(1) NULL DEFAULT 0 COMMENT '操作类型(0-默认,1-上传,2-修改,3-删除,4-通过,5-驳回)',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `operation_union_index`(`operator_id`, `project_id`, `operate_type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息发送记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_operation_message
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_operation_message`;
CREATE TABLE `t_sys_operation_message`  (
  `id` bigint(32) NOT NULL,
  `operation_id` bigint(32) NULL DEFAULT 0 COMMENT '操作ID',
  `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '消息内容',
  `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '消息类型 0:普通文本 1:链接',
  `settings` varchar(511) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '消息配置 {projectId:1}',
  `sort` tinyint(5) UNSIGNED NULL DEFAULT 0 COMMENT '消息顺序',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `operation_msg_index`(`operation_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '消息发送内容' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_plugin
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_plugin`;
CREATE TABLE `t_sys_plugin`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '名称',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '详情',
  `scene` tinyint(2) NULL DEFAULT 0 COMMENT '0公共插件，1ptpro，2btpro，3mtpro，4htpro，5ctpro，6周会相关',
  `show_type` tinyint(2) NULL DEFAULT 2 COMMENT '0不显示，1任务头上右侧图标，2任务详情显示按钮，3任务展开面板显示(特殊形式)',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `plugin_icon` bigint(20) NULL DEFAULT 0 COMMENT '插件图标',
  `plugin_author` bigint(20) NULL DEFAULT 0 COMMENT '插件作者',
  `plugin_class` tinyint(2) NULL DEFAULT 0 COMMENT '插件类型(0-公共,1-会务,2-医疗,3-pims)',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `plugin_author`(`plugin_author`) USING BTREE,
  INDEX `plugin_icon`(`plugin_icon`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '显示分类' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_project
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_project`;
CREATE TABLE `t_sys_project`  (
  `id` bigint(20) NOT NULL,
  `creator_id` bigint(20) NULL DEFAULT 0 COMMENT '创建者的 user_id',
  `parent_task_id` bigint(20) NULL DEFAULT 0 COMMENT '父任务id',
  `scene_id` bigint(20) NULL DEFAULT 0 COMMENT '项目场景',
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '项目名称',
  `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `begin_time` bigint(20) NULL DEFAULT 0,
  `end_time` bigint(20) NULL DEFAULT 0,
  `address` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `published` tinyint(1) NULL DEFAULT 0 COMMENT '是否发布 0未发布 1发布',
  `template` tinyint(1) NULL DEFAULT 0 COMMENT '是否是模板项目 0不是模板 1模板',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父项目id',
  `home_page_show` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '是否首页展示',
  `highlight` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '是否高亮显示 0否 1是',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_creator_index`(`creator_id`) USING BTREE,
  INDEX `project_scene_index`(`scene_id`) USING BTREE,
  INDEX `project_parent_task_index`(`parent_task_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_project_label
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_project_label`;
CREATE TABLE `t_sys_project_label`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `label_id` bigint(20) NULL DEFAULT 0 COMMENT '标签Id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `label_index`(`label_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目标签关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_project_robot
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_project_robot`;
CREATE TABLE `t_sys_project_robot`  (
  `id` bigint(32) NOT NULL,
  `robot_id` bigint(32) NULL DEFAULT 0 COMMENT '机器人Id',
  `project_id` bigint(32) NULL DEFAULT 0 COMMENT '项目id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `robot_index`(`robot_id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '项目机器人关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_project_robot_message
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_project_robot_message`;
CREATE TABLE `t_sys_project_robot_message`  (
  `id` bigint(32) NOT NULL,
  `project_robot_id` bigint(32) NULL DEFAULT 0 COMMENT '在项目内机器人的id',
  `operate_type` tinyint(5) NULL DEFAULT 0 COMMENT '接口消息code',
  `all_message` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否关联所有消息接口，0否 1是',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_robot_index`(`project_robot_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '机器人关联消息类型表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_relevance_project
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_relevance_project`;
CREATE TABLE `t_sys_relevance_project`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `relevance_project_id` bigint(20) NULL DEFAULT 0 COMMENT '被关联的项目id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `relevance_project_index`(`relevance_project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_ring_msg
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_ring_msg`;
CREATE TABLE `t_sys_ring_msg`  (
  `id` bigint(20) NOT NULL,
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '消息内容（简略）',
  `value_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '消息内容（完整）',
  `sender_id` bigint(20) NULL DEFAULT 0 COMMENT '发送者的userId',
  `time` bigint(20) NULL DEFAULT 0 COMMENT '发送时间',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `sender_index`(`sender_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'ring消息详情表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_ring_send
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_ring_send`;
CREATE TABLE `t_sys_ring_send`  (
  `id` bigint(20) NOT NULL,
  `ring_id` bigint(20) NULL DEFAULT 0 COMMENT '消息详情id',
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '接收角色的id',
  `read_status` tinyint(1) NULL DEFAULT 0 COMMENT '是否已读 0未读 1已读',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  `read_time` bigint(20) NULL DEFAULT 0 COMMENT '消息被阅读的时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `ring_index`(`ring_id`) USING BTREE,
  INDEX `role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'ring消息与角色关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_robot
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_robot`;
CREATE TABLE `t_sys_robot`  (
  `id` bigint(32) NOT NULL,
  `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '机器人名',
  `web_hook` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT 'webHook地址',
  `client_type` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '机器人所属的软件 0企业微信 1钉钉',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '智能机器人表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_robot_log
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_robot_log`;
CREATE TABLE `t_sys_robot_log`  (
  `id` bigint(32) NOT NULL,
  `robot_id` bigint(32) NULL DEFAULT 0 COMMENT '机器人Id',
  `project_id` bigint(32) NULL DEFAULT 0 COMMENT '项目id',
  `task_id` bigint(32) NULL DEFAULT 0 COMMENT '任务id',
  `user_id` bigint(32) NULL DEFAULT 0 COMMENT '操作人id',
  `role_id` bigint(32) NULL DEFAULT 0 COMMENT '任务负责人id',
  `message_type_id` bigint(32) NULL DEFAULT 0 COMMENT '消息类型Id',
  `send_time` bigint(32) NULL DEFAULT 0 COMMENT '操作时间',
  `complete` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '发送状态 0失败 1成功',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `robot_index`(`robot_id`) USING BTREE,
  INDEX `project_index`(`project_id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '已经发送的通知消息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_scene
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_scene`;
CREATE TABLE `t_sys_scene`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `sequence` int(11) NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目场景表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_signin_field
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_signin_field`;
CREATE TABLE `t_sys_signin_field`  (
  `id` bigint(20) NOT NULL,
  `description` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '展示名',
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '变量名',
  `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '类型 0文本 1文本框 2单选 3多选',
  `field_value` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '类型值（文本，单选，多选，展示的内容 例：｛\"1\":\"男\",\"2\":\"女\"｝，）',
  `format` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '正则表达式，需要验证时',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '签到字段表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_user
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user`;
CREATE TABLE `t_sys_user`  (
  `id` bigint(20) NOT NULL,
  `grade_id` bigint(20) NULL DEFAULT 0 COMMENT '会员等级id',
  `avatar_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像',
  `nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '昵称',
  `gender` tinyint(1) NULL DEFAULT 0 COMMENT '性别',
  `country` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '国家',
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '省份',
  `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '城市',
  `language` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '语言',
  `phone` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号',
  `wechat` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '微信号',
  `email` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `balance` bigint(20) NULL DEFAULT 0 COMMENT '余额,单位：分',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `source` tinyint(1) NULL DEFAULT 0 COMMENT '注册来源 0：pt , 1跳绳',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_user_attention
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user_attention`;
CREATE TABLE `t_sys_user_attention`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '用户关注的项目id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `project_id`(`project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户关注项目表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_user_info
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_user_info`;
CREATE TABLE `t_sys_user_info`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `signature` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '个人签名',
  `introduction` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '个人简介',
  `birthday` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '生日',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '所在地',
  `web_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '网页',
  `company` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '公司',
  `position` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '职位',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户详细信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_sys_wx
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_wx`;
CREATE TABLE `t_sys_wx`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `open_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'openId',
  `union_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'unionId',
  `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '微信昵称',
  `head_img_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '微信头像',
  `sex` tinyint(2) UNSIGNED NULL DEFAULT 1 COMMENT '性别 0女 1男',
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '省',
  `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '市',
  `country` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '国家',
  `language` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '语言',
  `privilege` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户特权信息，json 数组',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `rec_status` tinyint(1) NULL DEFAULT 0,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '微信信息' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_util_addr_dispose
-- ----------------------------
DROP TABLE IF EXISTS `t_util_addr_dispose`;
CREATE TABLE `t_util_addr_dispose`  (
  `id` bigint(20) NOT NULL,
  `start_addr` int(11) NULL DEFAULT 0 COMMENT '起始地址',
  `end_addr` int(11) NULL DEFAULT 0 COMMENT '结束地址',
  `content_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '内容数量',
  `content_length` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '每个内容的长度（x,x,x,x）',
  `project` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '项目',
  `remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注信息',
  `operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态，0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '寄存器信息处理表' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_wps_file
-- ----------------------------
DROP TABLE IF EXISTS `t_wps_file`;
CREATE TABLE `t_wps_file`  (
  `id` bigint(32) NOT NULL,
  `current_version` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '当前版本号',
  `name` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文件名',
  `size` bigint(32) NULL DEFAULT 0 COMMENT '文件大小，单位为B',
  `download_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文档下载地址',
  `save_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文档存储地址',
  `creator` bigint(32) NULL DEFAULT 0 COMMENT '创建者ID',
  `modifier` bigint(32) NULL DEFAULT 0 COMMENT '修改者id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'wps文件上传' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_wps_file_user
-- ----------------------------
DROP TABLE IF EXISTS `t_wps_file_user`;
CREATE TABLE `t_wps_file_user`  (
  `id` bigint(32) NOT NULL,
  `user_id` bigint(32) NULL DEFAULT 0 COMMENT '项目ID',
  `version_id` bigint(32) UNSIGNED NULL DEFAULT 0 COMMENT '文件版本id',
  `operation` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0新建，1：读权限，2：写权限，3：编辑保存，4：打开旧版本号',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `wps_user_version_index`(`version_id`) USING BTREE,
  INDEX `wps_user_user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户操作文档记录' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_wps_file_version
-- ----------------------------
DROP TABLE IF EXISTS `t_wps_file_version`;
CREATE TABLE `t_wps_file_version`  (
  `id` bigint(32) NOT NULL,
  `file_id` bigint(32) UNSIGNED NULL DEFAULT 0 COMMENT '文件id',
  `version` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '版本号',
  `name` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文件名',
  `size` bigint(32) NULL DEFAULT 0 COMMENT '文件大小，单位为B',
  `download_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文档下载地址',
  `save_url` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '文档存储地址',
  `modifier` bigint(32) NULL DEFAULT 0 COMMENT '修改者id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uk_file_version`(`file_id`, `version`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件历史' ROW_FORMAT = Compact;

-- ----------------------------
-- Table structure for t_wps_notify
-- ----------------------------
DROP TABLE IF EXISTS `t_wps_notify`;
CREATE TABLE `t_wps_notify`  (
  `id` bigint(32) NOT NULL,
  `cmd` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '命令参数',
  `body` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '信息内容',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '状态 0正常 1禁用 2删除',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'wps通知' ROW_FORMAT = Compact;

SET FOREIGN_KEY_CHECKS = 1;
