/*
 Navicat Premium Data Transfer

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

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

 Date: 25/07/2021 11:44:49
*/

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,
  `business_id` bigint(20) NULL DEFAULT 0 COMMENT '业务id',
  `business_type` tinyint(2) UNSIGNED NULL DEFAULT 0 COMMENT '业务id的类型 0任务 1插件 2其他',
  `t_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `t_value` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `description` varchar(255) 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,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '常量表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_constant
-- ----------------------------

-- ----------------------------
-- Table structure for t_label
-- ----------------------------
DROP TABLE IF EXISTS `t_label`;
CREATE TABLE `t_label`  (
  `id` bigint(20) NOT NULL,
  `label_type_id` bigint(20) NULL DEFAULT 0 COMMENT '标签类型id',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
  `level` tinyint(1) UNSIGNED NULL DEFAULT 0 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,
  INDEX `label_type_id`(`label_type_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_label
-- ----------------------------
INSERT INTO `t_label` VALUES (1, 1, '毫秒', 0, '2021-07-20 11:15:06', '2021-07-20 16:36:32', 0);
INSERT INTO `t_label` VALUES (2, 1, '秒', 1, '2021-07-20 11:15:13', '2021-07-20 16:36:32', 0);
INSERT INTO `t_label` VALUES (3, 1, '分', 2, '2021-07-20 11:15:21', '2021-07-20 16:36:32', 0);
INSERT INTO `t_label` VALUES (4, 1, '时', 3, '2021-07-20 11:15:27', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (5, 1, '天', 4, '2021-07-20 11:15:35', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (6, 1, '周', 5, '2021-07-20 11:15:42', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (7, 1, '月', 6, '2021-07-20 11:15:48', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (8, 1, '季度', 7, '2021-07-20 11:16:01', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (9, 1, '年', 8, '2021-07-20 11:16:14', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (10, 1, '年代', 9, '2021-07-20 11:16:21', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (11, 1, '世纪', 10, '2021-07-20 11:16:30', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (12, 1, '千年', 11, '2021-07-20 11:16:36', '2021-07-20 16:36:33', 0);
INSERT INTO `t_label` VALUES (13, 2, '项目', 0, '2021-07-20 11:16:43', '2021-07-20 16:36:36', 0);
INSERT INTO `t_label` VALUES (14, 2, '任务', 1, '2021-07-20 11:16:52', '2021-07-20 16:36:36', 0);
INSERT INTO `t_label` VALUES (15, 2, '日常任务', 2, '2021-07-20 11:17:00', '2021-07-20 16:36:37', 0);
INSERT INTO `t_label` VALUES (16, 2, '定期任务', 3, '2021-07-20 11:17:06', '2021-07-20 20:28:34', 0);
INSERT INTO `t_label` VALUES (17, 3, '普通任务', 0, '2021-07-20 11:17:27', '2021-07-20 16:36:57', 0);
INSERT INTO `t_label` VALUES (18, 3, '关键任务', 1, '2021-07-20 11:17:37', '2021-07-20 21:54:07', 0);
INSERT INTO `t_label` VALUES (19, 3, '里程碑', 2, '2021-07-20 11:17:45', '2021-07-20 16:36:57', 0);
INSERT INTO `t_label` VALUES (20, 4, '图片', 0, '2021-07-20 11:17:56', '2021-07-20 16:37:11', 0);
INSERT INTO `t_label` VALUES (21, 4, '链接', 1, '2021-07-20 11:18:03', '2021-07-20 16:37:11', 0);
INSERT INTO `t_label` VALUES (22, 4, '音频', 2, '2021-07-20 11:18:10', '2021-07-20 16:37:11', 0);
INSERT INTO `t_label` VALUES (23, 4, '语音', 3, '2021-07-20 11:18:23', '2021-07-20 16:37:11', 0);
INSERT INTO `t_label` VALUES (24, 4, 'word', 4, '2021-07-20 11:18:29', '2021-07-20 16:37:11', 0);
INSERT INTO `t_label` VALUES (25, 4, 'excel', 5, '2021-07-20 11:18:37', '2021-07-20 16:37:11', 0);
INSERT INTO `t_label` VALUES (26, 4, 'pdf', 6, '2021-07-20 11:18:43', '2021-07-20 16:37:11', 0);
INSERT INTO `t_label` VALUES (27, 4, '富文本', 7, '2021-07-20 11:18:53', '2021-07-20 16:37:12', 0);
INSERT INTO `t_label` VALUES (28, 4, '动作', 8, '2021-07-20 11:18:59', '2021-07-20 16:37:12', 0);
INSERT INTO `t_label` VALUES (29, 5, '公共', 0, '2021-07-20 11:19:09', '2021-07-20 16:37:14', 0);
INSERT INTO `t_label` VALUES (30, 5, '医疗', 1, '2021-07-20 11:19:17', '2021-07-20 16:37:14', 0);
INSERT INTO `t_label` VALUES (31, 5, '会务', 2, '2021-07-20 11:19:26', '2021-07-20 16:37:15', 0);
INSERT INTO `t_label` VALUES (32, 6, '项目成员', 0, '2021-07-20 11:19:37', '2021-07-20 20:33:44', 0);
INSERT INTO `t_label` VALUES (34, 6, '项目经理', 1, '2021-07-20 11:20:00', '2021-08-05 16:24:31', 0);
INSERT INTO `t_label` VALUES (35, 6, '干系人', 2, '2021-07-20 11:20:07', '2021-08-05 16:24:31', 0);
INSERT INTO `t_label` VALUES (36, 6, '管代', 3, '2021-07-20 11:20:19', '2021-08-05 16:24:31', 0);
INSERT INTO `t_label` VALUES (37, 6, '上帝', 4, '2021-07-20 11:20:28', '2021-08-05 16:24:31', 0);
INSERT INTO `t_label` VALUES (38, 6, '创建者', 5, '2021-08-05 16:19:54', '2021-08-05 16:19:54', 0);

-- ----------------------------
-- Table structure for t_label_business
-- ----------------------------
DROP TABLE IF EXISTS `t_label_business`;
CREATE TABLE `t_label_business`  (
  `id` bigint(20) NOT NULL,
  `label_id` bigint(20) NULL DEFAULT 0 COMMENT '标签id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `business_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '业务类型(0-任务,1-插件,2-任务)',
  `business_id` bigint(20) NULL DEFAULT 0 COMMENT '业务id（任务id、插件id、角色id等）',
  `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,
  INDEX `label_id`(`label_id`) USING BTREE,
  INDEX `user_id`(`user_id`) USING BTREE,
  INDEX `business_id`(`business_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签与业务关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_label_business
-- ----------------------------

-- ----------------------------
-- Table structure for t_label_type
-- ----------------------------
DROP TABLE IF EXISTS `t_label_type`;
CREATE TABLE `t_label_type`  (
  `id` bigint(20) NOT NULL,
  `label_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '标签类型(0-显示颗粒度,1-任务,2重要性,3-输入输出类型,4业务类型,5-角色)',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '描述',
  `default_level` tinyint(1) UNSIGNED NULL DEFAULT 0 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,
  INDEX `label_type_index`(`label_type`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签类型表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_label_type
-- ----------------------------
INSERT INTO `t_label_type` VALUES (1, 0, '时间颗粒度', 4, '2021-07-20 11:12:40', '2021-07-20 11:12:40', 0);
INSERT INTO `t_label_type` VALUES (2, 1, '任务', 3, '2021-07-20 11:12:54', '2021-07-20 11:13:35', 0);
INSERT INTO `t_label_type` VALUES (3, 2, '重要性', 1, '2021-07-20 11:13:56', '2021-07-20 11:13:56', 0);
INSERT INTO `t_label_type` VALUES (4, 3, '输入/输出类型', 4, '2021-07-20 11:14:11', '2021-07-20 11:14:11', 0);
INSERT INTO `t_label_type` VALUES (5, 4, '业务类型', 0, '2021-07-20 20:32:10', '2021-07-20 20:32:35', 0);
INSERT INTO `t_label_type` VALUES (6, 5, '角色', 0, '2021-07-20 11:14:21', '2021-07-20 20:32:40', 0);

-- ----------------------------
-- Table structure for t_pro_member
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_member`;
CREATE TABLE `t_pro_member`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `phone` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '手机号',
  `name` 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 '头像',
  `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,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `member_user_index`(`user_id`) USING BTREE,
  INDEX `member_project_index`(`project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成员表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_member
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_member_stakeholder
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_member_stakeholder`;
CREATE TABLE `t_pro_member_stakeholder`  (
  `id` bigint(20) NOT NULL,
  `memeber_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `stakeholder_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '奖惩干系人名称',
  `stakeholder_phone` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '奖惩干系人手机号',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT 'userId',
  `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,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `stakeholder_member_index`(`memeber_id`) USING BTREE,
  INDEX `stakeholder_user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '奖惩干系人表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_member_stakeholder
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_parent_task
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_parent_task`;
CREATE TABLE `t_pro_parent_task`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `parent_task_detail_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 `task_index`(`task_detail_id`) USING BTREE,
  INDEX `parent_task_index`(`parent_task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务关系表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_parent_task
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_role
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role`;
CREATE TABLE `t_pro_role`  (
  `id` bigint(20) NOT NULL,
  `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '角色名',
  `label_id` bigint(20) NULL DEFAULT 0 COMMENT '一级角色标签id',
  `project_id` bigint(20) NULL DEFAULT 0 COMMENT '项目id',
  `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,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `role_label_index`(`label_id`) USING BTREE,
  INDEX `role_project_index`(`project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_role
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_role_member
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role_member`;
CREATE TABLE `t_pro_role_member`  (
  `id` bigint(20) NOT NULL,
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `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,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `role_member_role_index`(`role_id`) USING BTREE,
  INDEX `role_member_member_index`(`member_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色成员关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_role_member
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_role_repulsion
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role_repulsion`;
CREATE TABLE `t_pro_role_repulsion`  (
  `id` bigint(20) NOT NULL,
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `repulsion_role_id` bigint(20) NULL DEFAULT 0 COMMENT '被排斥的角色id',
  `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,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `repulsion_index`(`role_id`) USING BTREE,
  INDEX `repulsion_role_index`(`repulsion_role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色互斥表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_role_repulsion
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_role_show
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role_show`;
CREATE TABLE `t_pro_role_show`  (
  `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',
  `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,
  `sequence` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `role_show_user_index`(`user_id`) USING BTREE,
  INDEX `role_show_project_index`(`project_id`) USING BTREE,
  INDEX `role_show_role_index`(`role_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色栏展示表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_role_show
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_role_task
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_role_task`;
CREATE TABLE `t_pro_role_task`  (
  `id` bigint(20) NOT NULL,
  `role_id` bigint(20) NULL DEFAULT 0 COMMENT '角色id',
  `task_id` bigint(20) NULL DEFAULT 0 COMMENT '任务id', 
  `role_duty` tinyint(1) DEFAULT 0 COMMENT '角色职责(0-负责人,1-检查人)',
  `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,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `role_task_role_index`(`role_id`) USING BTREE,
  INDEX `role_task_task_index`(`task_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色任务关联表' ROW_FORMAT = Compact;




-- ----------------------------
-- Records of t_pro_role_task
-- ----------------------------

-- ----------------------------
-- 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,
  `name` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '任务名称',
  `description` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '任务描述',
  `cycle` 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;

-- ----------------------------
-- Records of t_pro_task_status_record
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_task_sub
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_sub`;
CREATE TABLE `t_pro_task_sub`  (
  `id` bigint(20) NOT NULL,
  `plan_start_time` bigint(20) NULL DEFAULT 0 COMMENT '计划开始时间',
  `plan_duration` bigint(20) NULL DEFAULT 0 COMMENT '计划时长',
  `plan_end_time` bigint(20) NULL DEFAULT 0 COMMENT '计划结束时间',
  `real_start_time` bigint(20) NULL DEFAULT 0 COMMENT '实际开始时间',
  `real_duration` bigint(20) NULL DEFAULT 0 COMMENT '实际时长',
  `real_end_time` bigint(20) NULL DEFAULT 0 COMMENT '计划结束时间',
  `task_status` tinyint(1) NULL DEFAULT 0 COMMENT '任务完成状态 0未开始 1进行中 2暂停 3完成',
  `task_detail_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 `task_detail_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务分解表' ROW_FORMAT = Compact;



-- ----------------------------
-- Records of t_pro_task_detail
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_task_flow
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_flow`;
CREATE TABLE `t_pro_task_flow`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `flow_type` bigint(20) NULL DEFAULT -1 COMMENT '流转策略(-1-不切换,0-时间到立即奇幻,其他-最多等待多少秒)',
  `jump_task_detail_id` int(10) 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 `jump_index`(`jump_task_detail_id`) USING BTREE,
  INDEX `task_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务流转表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_task_flow
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_task_notify
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_notify`;
CREATE TABLE `t_pro_task_notify`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `lifecycle` tinyint(1) NULL DEFAULT 0 COMMENT '生命周期',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '路径',
  `appoint_param` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '指定参数',
  `notify_type` tinyint(1) NULL DEFAULT 0 COMMENT '通知方式（不通知,HTTP,消息系统）',
  `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_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务通知表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_task_notify
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_task_panel_info
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_panel_info`;
CREATE TABLE `t_pro_task_panel_info`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `back_color` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '背景色',
  `round_corner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '圆角',
  `border` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '边框',
  `shadow` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '阴影',
  `width` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '宽',
  `height` varchar(50) 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,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `row` int(11) NULL DEFAULT 1 COMMENT '行',
  `col` int(11) NULL DEFAULT 1 COMMENT '列',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务面板信息表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_task_panel_info
-- ----------------------------

-- ----------------------------
-- 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,
  `param` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数',
  `plgin_row` int(10) NULL DEFAULT 0 COMMENT '插件行',
  `plgin_col` int(10) NULL DEFAULT 0 COMMENT '插件列',
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `plugin_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,
  `colspan` int(11) NULL DEFAULT 0 COMMENT '跨列',
  `rowspan` int(11) NULL DEFAULT 0 COMMENT '跨行',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_index`(`task_detail_id`) USING BTREE,
  INDEX `plugin_index`(`plugin_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务插件关联表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_task_plugin
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_task_process
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_process`;
CREATE TABLE `t_pro_task_process`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `next_task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '下一个任务id',
  `process_type` tinyint(1) NULL DEFAULT 0 COMMENT '关联类型（0开始前，1开始时，2开始后，3结束前，4结束时，5结束后）',
  `time_difference` 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 `task_index`(`task_detail_id`) USING BTREE,
  INDEX `next_task_index`(`next_task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务上下道工序表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_task_process
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_task_status_record
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_status_record`;
CREATE TABLE `t_pro_task_status_record`  (
  `id` bigint(20) NOT NULL,
  `task_sub_id` bigint(20) NULL DEFAULT 0 COMMENT '任务分解id',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `task_status` tinyint(1) NULL DEFAULT 0 COMMENT '任务状态（开始，暂停，继续，结束）',
  `update_status_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 `task_sub_index`(`task_sub_id`) USING BTREE,
  INDEX `user_index`(`user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务状态记录表' ROW_FORMAT = Compact;


-- ----------------------------
-- Records of t_pro_task_sub
-- ----------------------------

-- ----------------------------
-- Table structure for t_pro_task_version
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_version`;
CREATE TABLE `t_pro_task_version`  (
  `id` bigint(20) NOT NULL,
  `task_detail_id` bigint(20) NULL DEFAULT 0 COMMENT '任务详情id',
  `task_version_info` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '版本信息',
  `project_type` tinyint(1) 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,
  `rec_status` tinyint(1) UNSIGNED NULL DEFAULT 0,
  `address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_index`(`task_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务版本表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_task_version
-- ----------------------------

-- ----------------------------
-- 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 '接口返回值（或异常）',
  `facility` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '设备信息',
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '用户id',
  `operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
  `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,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '日志表' ROW_FORMAT = Compact;


SET FOREIGN_KEY_CHECKS = 1;


-- ----------------------------
-- Table structure for t_pro_task_share
-- ----------------------------
DROP TABLE IF EXISTS `t_pro_task_share`;
CREATE TABLE `t_pro_task_share`  (
  `id` bigint(20) NOT NULL,
  `original_project_id` bigint(20) NULL DEFAULT 0 COMMENT '原项目id',
  `share_user_id` bigint(20) NULL DEFAULT 0 COMMENT '分享人id',
  `share_type` tinyint(1) NULL DEFAULT 0 COMMENT '分享类型(0-分享,1-体验)',
  `share_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 `original_project_index`(`original_project_id`) USING BTREE,
  INDEX `share_user_index`(`share_user_id`) USING BTREE,
  INDEX `share_project_index`(`share_project_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '任务分享表' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of t_pro_task_share
-- ----------------------------


-- ---2021.08.26 生产已同步----------
DROP TABLE IF EXISTS `t_pro_project_share`;
CREATE TABLE `t_pro_project_share`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '分享用户id',
  `url` varchar(255) NULL DEFAULT '' COMMENT '分享链接(全路径)',
  `code` varchar(255) NULL DEFAULT '' COMMENT '角色项目用户id.MD5加密',
  `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_id_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;

DROP TABLE IF EXISTS `t_pro_share_member`;
CREATE TABLE `t_pro_share_member`  (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NULL DEFAULT 0 COMMENT '被分享用户id',
  `share_id` bigint(20) NULL DEFAULT 0 COMMENT '分卸链接id',
  `member_id` bigint(20) NULL DEFAULT 0 COMMENT '成员id',
  `type` 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,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `user_id_index`(`user_id`) USING BTREE,
  INDEX `share_id_index`(`share_id`) USING BTREE,
  INDEX `member_id_index`(`member_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '被分享成员信息表' ROW_FORMAT = Compact;



-- DROP TABLE IF EXISTS `t_sys_holidays`;
-- CREATE TABLE `t_sys_holidays`  (
--   `id` bigint(20) NOT NULL,
--   `year` varchar(64) DEFAULT '' COMMENT '哪一年',
--   `holiday` varchar(64) DEFAULT '' COMMENT '假期',
--   `workday` varchar(64) DEFAULT '' COMMENT '调休',

--   `operator` bigint(20) NULL DEFAULT 0 COMMENT '操作人id',
--   `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,
--   PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '节假日表' ROW_FORMAT = Compact;


-- INSERT INTO `t_sys_holidays` VALUES (1, '2021', '01-01,01-02,01-03,02-11,02-12,02-13,02-14,02-15,02-16,02-17,04-03,04-04,04-05,05-01,05-02,05-03,05-04,05-05,06-12,06-13,06-14,09-19,09-20,09-21,10-01,10-02,10-03,10-04,10-05,10-06,10-07', '02-07,02-20,04-25,05-08,09-18,09-26,10-09', 0, '2021-11-01 17:12:01', '2021-11-03 17:46:39', 0);
-- INSERT INTO `t_sys_holidays` VALUES (2, '2022', '01-01,01-02,01-03,01-31,02-01,02-02,02-03,02-04,02-05,02-06,04-03,04-04,04-05,04-30,05-01,05-02,05-03,05-04,06-03,06-04,06-05,09-10,09-11,09-12,10-01,10-02,10-03,10-04,10-05,10-06,10-07', '01-29,01-30,04-02,04-24,05-07,10-08,10-09', 0, '2021-11-03 17:51:07', '2021-11-03 17:51:18', 0);
