首页 > 其他分享 >OA 系统工作流引擎 Camunda 实践(2)

OA 系统工作流引擎 Camunda 实践(2)

时间:2023-02-28 10:22:40浏览次数:45  
标签:COMMENT utf8mb4 DEFAULT bigint OA 引擎 Camunda NULL id

再把一部分流程相关的表和代码做一下开源和解释,有疑问的评论

 

除了Camunda自身的表,还需要建立一些存储流程相关的基础数据表,如下

 

  1 SET NAMES utf8mb4;
  2 SET FOREIGN_KEY_CHECKS = 0;
  3 
  4 -- ----------------------------
  5 -- Table structure for jbpm_approval_process_record
  6 -- ----------------------------
  7 DROP TABLE IF EXISTS `jbpm_approval_process_record`;
  8 CREATE TABLE `jbpm_approval_process_record`  (
  9   `id` bigint NOT NULL COMMENT '主键',
 10   `business_process_id` bigint NULL DEFAULT NULL COMMENT '业务数据和流程实例关系表id',
 11   `process_instance_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程实例id',
 12   `task_def_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务节点key',
 13   `approval_node` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批节点(发起人、审核人、执行人、抄送人)',
 14   `audit_method` int NULL DEFAULT NULL COMMENT '审批方式(0=自己,1=或签,2=会签,3=顺序签)',
 15   `approval_node_list` json NULL COMMENT '审批节点详情列表(用户id,用户姓名,审批状态【审核中,已通过,已拒绝,转交,撤回】,转交人json,操作时间,备审批注)',
 16   `task_is_end` int NULL DEFAULT 0 COMMENT '任务节点是否结束(0=否,1=是)',
 17   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
 18   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
 19   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
 20   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
 21   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
 22   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
 23   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
 24   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
 25   PRIMARY KEY (`id`) USING BTREE,
 26   INDEX `business_process_id`(`business_process_id`) USING BTREE,
 27   INDEX `process_instance_id`(`process_instance_id`) USING BTREE,
 28   INDEX `task_def_key`(`task_def_key`) USING BTREE
 29 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '审批流程记录' ROW_FORMAT = Dynamic;
 30 
 31 -- ----------------------------
 32 -- Table structure for jbpm_business_draft
 33 -- ----------------------------
 34 DROP TABLE IF EXISTS `jbpm_business_draft`;
 35 CREATE TABLE `jbpm_business_draft`  (
 36   `id` bigint NOT NULL COMMENT '主键',
 37   `process_definition_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义key',
 38   `process_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程名称',
 39   `apply_user_id` bigint NULL DEFAULT NULL COMMENT '申请人id',
 40   `apply_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '申请人姓名',
 41   `dept_id` bigint NULL DEFAULT NULL COMMENT '部门id',
 42   `dept_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门名称',
 43   `summary` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '摘要',
 44   `from_data_json` json NULL COMMENT '表单数据json',
 45   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
 46   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
 47   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
 48   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
 49   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
 50   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
 51   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
 52   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
 53   PRIMARY KEY (`id`) USING BTREE,
 54   INDEX `process_definition_key`(`process_definition_key`) USING BTREE,
 55   INDEX `apply_user_id`(`apply_user_id`) USING BTREE
 56 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '业务流程申请草稿' ROW_FORMAT = Dynamic;
 57 
 58 -- ----------------------------
 59 -- Table structure for jbpm_business_process
 60 -- ----------------------------
 61 DROP TABLE IF EXISTS `jbpm_business_process`;
 62 CREATE TABLE `jbpm_business_process`  (
 63   `id` bigint NOT NULL COMMENT '主键',
 64   `process_definition_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义key',
 65   `process_instance_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程实例id',
 66   `process_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程名称',
 67   `apply_user_id` bigint NULL DEFAULT NULL COMMENT '申请人id',
 68   `apply_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '申请人姓名',
 69   `dept_id` bigint NULL DEFAULT NULL COMMENT '部门id',
 70   `dept_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门名称',
 71   `summary` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '摘要',
 72   `delivery_time` datetime(0) NULL DEFAULT NULL COMMENT '送达时间',
 73   `state` int NULL DEFAULT NULL COMMENT '流程状态(1=审核中,2=办理中,3=已同意,4=驳回,5=撤回,6=作废,7=已重新发起)',
 74   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
 75   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
 76   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
 77   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
 78   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
 79   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
 80   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
 81   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
 82   PRIMARY KEY (`id`) USING BTREE,
 83   INDEX `process_definition_key`(`process_definition_key`) USING BTREE,
 84   INDEX `process_instance_id`(`process_instance_id`) USING BTREE,
 85   INDEX `apply_user_id`(`apply_user_id`) USING BTREE,
 86   INDEX `state`(`state`) USING BTREE
 87 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '业务数据和流程实例关系表' ROW_FORMAT = Dynamic;
 88 
 89 -- ----------------------------
 90 -- Table structure for jbpm_business_read
 91 -- ----------------------------
 92 DROP TABLE IF EXISTS `jbpm_business_read`;
 93 CREATE TABLE `jbpm_business_read`  (
 94   `id` bigint NOT NULL COMMENT '主键',
 95   `business_process_id` bigint NULL DEFAULT NULL COMMENT '业务数据和流程实例关系表id',
 96   `user_id` bigint NULL DEFAULT NULL COMMENT '阅读用户id',
 97   `state` int NULL DEFAULT 0 COMMENT '阅读状态(0=未阅,1=已阅)',
 98   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
 99   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
100   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
101   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
102   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
103   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
104   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
105   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
106   PRIMARY KEY (`id`) USING BTREE,
107   INDEX `business_process_id`(`business_process_id`) USING BTREE,
108   INDEX `user_id`(`user_id`) USING BTREE
109 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '申请业务阅读表' ROW_FORMAT = Dynamic;
110 
111 -- ----------------------------
112 -- Table structure for jbpm_process_gateway_rule
113 -- ----------------------------
114 DROP TABLE IF EXISTS `jbpm_process_gateway_rule`;
115 CREATE TABLE `jbpm_process_gateway_rule`  (
116   `id` bigint NOT NULL COMMENT '主键',
117   `PROC_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义KEY',
118   `TASK_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务定义key',
119   `node_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网关节点名称',
120   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
121   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
122   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
123   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
124   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
125   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
126   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
127   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
128   PRIMARY KEY (`id`) USING BTREE,
129   INDEX `PROC_DEF_KEY_`(`PROC_DEF_KEY_`) USING BTREE,
130   INDEX `TASK_DEF_KEY_`(`TASK_DEF_KEY_`) USING BTREE
131 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程网关定义规则表' ROW_FORMAT = Dynamic;
132 
133 -- ----------------------------
134 -- Table structure for jbpm_process_group
135 -- ----------------------------
136 DROP TABLE IF EXISTS `jbpm_process_group`;
137 CREATE TABLE `jbpm_process_group`  (
138   `id` bigint NOT NULL COMMENT '主键',
139   `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程分组名称',
140   `sort` int NULL DEFAULT NULL COMMENT '排序',
141   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
142   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
143   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
144   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
145   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
146   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
147   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
148   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
149   PRIMARY KEY (`id`) USING BTREE,
150   INDEX `name`(`name`) USING BTREE
151 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程分组表' ROW_FORMAT = Dynamic;
152 
153 -- ----------------------------
154 -- Table structure for jbpm_process_node_condition_rule
155 -- ----------------------------
156 DROP TABLE IF EXISTS `jbpm_process_node_condition_rule`;
157 CREATE TABLE `jbpm_process_node_condition_rule`  (
158   `id` bigint NOT NULL COMMENT '主键',
159   `PROC_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义KEY',
160   `TASK_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务定义key',
161   `condition_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '条件节点名称',
162   `table_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表名1',
163   `condition_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '条件关键字1',
164   `operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作符(=,>,>=,<,<=,!=,区间)',
165   `target_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值',
166   `target_value1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值1(操作符是‘区间’时用)',
167   `target_value1_operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值1操作符(<,<=)(操作符是‘区间’时用)',
168   `target_value2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值2(操作符是‘区间’时用)',
169   `target_value2_operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值2操作符(<,<=)(操作符是‘区间’时用)',
170   `table_name_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表名2',
171   `condition_key_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '条件关键字2',
172   `operator_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作符(=,>,>=,<,<=,!=,区间)',
173   `target_value_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值',
174   `target_value1_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值1(操作符是‘区间’时用)',
175   `target_value1_operator_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值1操作符(<,<=)(操作符是‘区间’时用)',
176   `target_value2_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值2(操作符是‘区间’时用)',
177   `target_value2_operator_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目标值2操作符(<,<=)(操作符是‘区间’时用)',
178   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
179   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
180   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
181   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
182   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
183   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
184   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
185   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
186   PRIMARY KEY (`id`) USING BTREE,
187   INDEX `PROC_DEF_KEY_`(`PROC_DEF_KEY_`) USING BTREE,
188   INDEX `TASK_DEF_KEY_`(`TASK_DEF_KEY_`) USING BTREE
189 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程网关定义条件规则表' ROW_FORMAT = Dynamic;
190 
191 -- ----------------------------
192 -- Table structure for jbpm_process_node_rule
193 -- ----------------------------
194 DROP TABLE IF EXISTS `jbpm_process_node_rule`;
195 CREATE TABLE `jbpm_process_node_rule`  (
196   `id` bigint NOT NULL COMMENT '主键',
197   `PROC_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义KEY',
198   `TASK_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务定义key',
199   `node_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网关节点名称',
200   `audit_type` int NULL DEFAULT NULL COMMENT '审核人类型(0=指定用户,1=部门主管,2=角色,3=表单内联系人,4=连续主管,5=自选用户)',
201   `audit_method` int NULL DEFAULT NULL COMMENT '审批方式(0=自己,1=或签,2=会签,3=顺序签)',
202   `is_admin_audit` int NULL DEFAULT NULL COMMENT '是否管理员审批(0=无,1=自动通过,2=移交管理员)',
203   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
204   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
205   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
206   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
207   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
208   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
209   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
210   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
211   PRIMARY KEY (`id`) USING BTREE,
212   INDEX `PROC_DEF_KEY_`(`PROC_DEF_KEY_`) USING BTREE,
213   INDEX `TASK_DEF_KEY_`(`TASK_DEF_KEY_`) USING BTREE
214 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程节点定义规则表' ROW_FORMAT = Dynamic;
215 
216 -- ----------------------------
217 -- Table structure for jbpm_process_node_user_rule
218 -- ----------------------------
219 DROP TABLE IF EXISTS `jbpm_process_node_user_rule`;
220 CREATE TABLE `jbpm_process_node_user_rule`  (
221   `id` bigint NOT NULL COMMENT '主键',
222   `PROC_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义KEY',
223   `TASK_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务定义key',
224   `data_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据类型(user=用户id,role=角色id,form=表单内联系人字段,lianxuzhuguan=连续主管查询级别,required=是否必选)',
225   `data_value` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据值',
226   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
227   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
228   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
229   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
230   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
231   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
232   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
233   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
234   PRIMARY KEY (`id`) USING BTREE,
235   INDEX `PROC_DEF_KEY_`(`PROC_DEF_KEY_`) USING BTREE,
236   INDEX `TASK_DEF_KEY_`(`TASK_DEF_KEY_`) USING BTREE
237 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程节点定义用户规则表' ROW_FORMAT = Dynamic;
238 
239 -- ----------------------------
240 -- Table structure for jbpm_process_role_rule
241 -- ----------------------------
242 DROP TABLE IF EXISTS `jbpm_process_role_rule`;
243 CREATE TABLE `jbpm_process_role_rule`  (
244   `id` bigint NOT NULL COMMENT '主键',
245   `role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色id',
246   `PROC_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义KEY',
247   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
248   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
249   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
250   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
251   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
252   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
253   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
254   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
255   PRIMARY KEY (`id`) USING BTREE,
256   INDEX `role_id`(`role_id`) USING BTREE,
257   INDEX `PROC_DEF_KEY_`(`PROC_DEF_KEY_`) USING BTREE
258 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程定义角色规则表' ROW_FORMAT = Dynamic;
259 
260 -- ----------------------------
261 -- Table structure for jbpm_process_user_rule
262 -- ----------------------------
263 DROP TABLE IF EXISTS `jbpm_process_user_rule`;
264 CREATE TABLE `jbpm_process_user_rule`  (
265   `id` bigint NOT NULL COMMENT '主键',
266   `user_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户id',
267   `PROC_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义KEY',
268   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
269   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
270   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
271   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
272   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
273   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
274   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
275   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
276   PRIMARY KEY (`id`) USING BTREE,
277   INDEX `user_id`(`user_id`) USING BTREE,
278   INDEX `PROC_DEF_KEY_`(`PROC_DEF_KEY_`) USING BTREE
279 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程定义用户规则表' ROW_FORMAT = Dynamic;
280 
281 -- ----------------------------
282 -- Table structure for jbpm_taskinstance_ext
283 -- ----------------------------
284 DROP TABLE IF EXISTS `jbpm_taskinstance_ext`;
285 CREATE TABLE `jbpm_taskinstance_ext`  (
286   `id` bigint NOT NULL COMMENT '主键',
287   `PROC_DEF_KEY_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义KEY',
288   `PROC_DEF_ID_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程定义ID',
289   `biz_id_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '业务主键',
290   `biz_code_` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '业务编码',
291   `process_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程图标',
292   `process_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程名称',
293   `process_group_id` bigint NULL DEFAULT NULL COMMENT '所属分组id',
294   `process_data_type_id` bigint NULL DEFAULT NULL COMMENT '数据类型id',
295   `process_state` int NULL DEFAULT 0 COMMENT '状态(0=启用,1=停用)',
296   `process_remark` varchar(900) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程说明',
297   `initator_auto` int NULL DEFAULT 0 COMMENT '发起人审批时自动通过(0=否,1=是)',
298   `is_draft` int NULL DEFAULT 0 COMMENT '是否草稿(0=否,1=是)',
299   `process_model_param_str` json NULL COMMENT '流程模型参数字符串,为了前端回显方便',
300   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
301   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
302   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
303   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
304   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
305   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
306   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
307   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
308   `sort` varchar(7) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '排序',
309   PRIMARY KEY (`id`) USING BTREE,
310   INDEX `PROC_DEF_KEY_`(`PROC_DEF_KEY_`) USING BTREE,
311   INDEX `PROC_DEF_ID_`(`PROC_DEF_ID_`) USING BTREE,
312   INDEX `process_name`(`process_name`) USING BTREE,
313   INDEX `process_group_id`(`process_group_id`) USING BTREE,
314   INDEX `updated_time`(`is_delete`, `sort`, `updated_time`) USING BTREE
315 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程实例与业务数据关系表' ROW_FORMAT = Dynamic;
316 
317 SET FOREIGN_KEY_CHECKS = 1;
View Code

 

 

 

 

我再举一个业务例子请假表,如下

 1 SET NAMES utf8mb4;
 2 SET FOREIGN_KEY_CHECKS = 0;
 3 
 4 -- ----------------------------
 5 -- Table structure for vacate
 6 -- ----------------------------
 7 DROP TABLE IF EXISTS `vacate`;
 8 CREATE TABLE `vacate`  (
 9   `id` bigint NOT NULL COMMENT '主键',
10   `apply_user_id` bigint NULL DEFAULT NULL COMMENT '申请人ID',
11   `apply_time` datetime(0) NULL DEFAULT NULL COMMENT '申请时间',
12   `vacate_type` bigint NULL DEFAULT NULL COMMENT '请假类型',
13   `start_time` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
14   `end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
15   `duration` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请假时长',
16   `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '请假事由',
17   `attach_files` json NULL COMMENT '附件',
18   `status` int NULL DEFAULT NULL COMMENT '状态',
19   `hours` decimal(10, 2) NULL DEFAULT NULL COMMENT '剩余工时',
20   `is_active` int NULL DEFAULT NULL COMMENT '是否启用 1已启用 0 禁用',
21   `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0=否,1=是)',
22   `created_by` bigint NULL DEFAULT NULL COMMENT '创建人',
23   `created_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
24   `updated_by` bigint NULL DEFAULT NULL COMMENT '更新人',
25   `updated_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
26   `deleted_by` bigint NULL DEFAULT NULL COMMENT '删除人',
27   `deleted_time` datetime(0) NULL DEFAULT NULL COMMENT '删除时间',
28   `revision` bigint NULL DEFAULT NULL COMMENT '乐观锁',
29   PRIMARY KEY (`id`) USING BTREE,
30   INDEX `apply_user_id`(`apply_user_id`) USING BTREE COMMENT '申请人',
31   INDEX `status`(`status`) USING BTREE COMMENT '状态'
32 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '请假表' ROW_FORMAT = Dynamic;
33 
34 SET FOREIGN_KEY_CHECKS = 1;
View Code

 

标签:COMMENT,utf8mb4,DEFAULT,bigint,OA,引擎,Camunda,NULL,id
From: https://www.cnblogs.com/hezemin/p/17163018.html

相关文章