目 录CONTENT

文章目录

简单版的审批流程设计器数据表设计

ByteNews
2022-01-20 / 0 评论 / 0 点赞 / 8,921 阅读 / 3,760 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-01-20,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

简单版的审批流程设计器数据表设计



SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for cowork_workflow
-- ----------------------------
DROP TABLE IF EXISTS `cowork_workflow`;
CREATE TABLE `cowork_workflow`  (
  `app_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'appkey',
  `worklfow_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程Id(主键)',
  `flow_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程名称',
  `flow_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程描述',
  PRIMARY KEY (`worklfow_key`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程模版' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for cowork_workflow_business
-- ----------------------------
DROP TABLE IF EXISTS `cowork_workflow_business`;
CREATE TABLE `cowork_workflow_business`  (
  `app_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'appkey',
  `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '业务Id(主键)',
  `flow_id` bigint(0) NULL DEFAULT NULL COMMENT '流程ID',
  `user_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人Id',
  `node_id` bigint(0) NULL DEFAULT NULL COMMENT '当前流程节点ID',
  `suggest` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批建议(批语、原因、理由)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程业务表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for cowork_workflow_line
-- ----------------------------
DROP TABLE IF EXISTS `cowork_workflow_line`;
CREATE TABLE `cowork_workflow_line`  (
  `app_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'appkey',
  `node_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '节点Id(主键)',
  `flow_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程ID',
  `node_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '节点名称',
  PRIMARY KEY (`node_key`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程线表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for cowork_workflow_node
-- ----------------------------
DROP TABLE IF EXISTS `cowork_workflow_node`;
CREATE TABLE `cowork_workflow_node`  (
  `app_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'appkey',
  `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '线Id(主键)',
  `flow_id` bigint(0) NULL DEFAULT NULL COMMENT '流程ID',
  `line_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '线名称',
  `pre_node_id` bigint(0) NULL DEFAULT NULL COMMENT '流程线上一个节点',
  `next_node_id` bigint(0) NULL DEFAULT NULL COMMENT '流程线下一个节点',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程节点表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for cowork_workflow_node_approve
-- ----------------------------
DROP TABLE IF EXISTS `cowork_workflow_node_approve`;
CREATE TABLE `cowork_workflow_node_approve`  (
  `app_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'appkey',
  `workflow_approve_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Id(主键)',
  `workflow_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程ID',
  `node_id` bigint(0) NULL DEFAULT NULL COMMENT '流程节点ID',
  `approve_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型(1:指定人,2:部门)',
  `approve_target_key` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人Id',
  PRIMARY KEY (`workflow_approve_key`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程审批人员表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;

0

评论区