process.sql 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. CREATE DATABASE `saas_process` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  2. use `saas_process`;
  3. create table `process_rule`
  4. (
  5. id int unsigned primary key not null auto_increment,
  6. company_id int unsigned not null,
  7. biz_module varchar(100) comment '业务模块',
  8. biz_type varchar(30) not null comment '业务类型',
  9. name varchar(100) not null comment '流程名称',
  10. enabled boolean comment '是否启用',
  11. creator_id int unsigned,
  12. creator_name varchar(100),
  13. create_time datetime,
  14. updater_id int unsigned,
  15. updater_name varchar(100),
  16. update_time datetime
  17. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流程规则';
  18. create table `process_rule_node`
  19. (
  20. id int unsigned primary key not null auto_increment,
  21. company_id int unsigned not null,
  22. rule_id int unsigned not null,
  23. order_num int comment '顺序',
  24. name varchar(100) not null comment '节点名称',
  25. type smallint default 1 comment '节点类型 1-审批 2-知会',
  26. handler_type smallint default 1 comment '操作人员类型 1-发起人自选 2-人员 3-角色 4-部门领导',
  27. handler text comment '操作人员',
  28. sign_type smallint default 1 comment '1-会签 2-或签',
  29. creator_id int unsigned,
  30. creator_name varchar(100),
  31. create_time datetime,
  32. updater_id int unsigned,
  33. updater_name varchar(100),
  34. update_time datetime
  35. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流程规则节点';
  36. create table `process_instance`
  37. (
  38. id int unsigned primary key not null auto_increment,
  39. company_id int unsigned not null,
  40. rule_id int unsigned not null,
  41. biz_id int unsigned not null comment '业务单据ID',
  42. biz_code varchar(100) comment '业务单据编号',
  43. view_type varchar(100) comment '视图类型',
  44. status smallint default 1 comment '1-已发起 2-已结束',
  45. operation smallint comment '结束操作 1-同意 2-不同意 3-强制同意 4-强制不同意',
  46. creator_id int unsigned,
  47. creator_name varchar(100),
  48. create_time datetime,
  49. updater_id int unsigned,
  50. updater_name varchar(100),
  51. update_time datetime
  52. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流程实例';
  53. create table `process_instance_item`
  54. (
  55. id int unsigned primary key not null auto_increment,
  56. company_id int unsigned not null,
  57. instance_id int unsigned not null,
  58. rule_node_id int unsigned not null,
  59. order_num int comment '顺序',
  60. handler_id int unsigned not null comment '执行人',
  61. handler_name varchar(100) comment '执行人名',
  62. status smallint default 1 comment '执行状态 1-未开始 2-已开始 3-已结束',
  63. operation smallint default 1 comment '操作 1-同意 2-驳回 3-变更 4-阅读 5-自动结束 6-强制结束',
  64. comment text comment '审批意见',
  65. remark text comment '备注',
  66. starter_id int unsigned,
  67. starter_name varchar(100),
  68. start_time datetime comment '开始时间',
  69. creator_id int unsigned,
  70. creator_name varchar(100),
  71. create_time datetime,
  72. updater_id int unsigned,
  73. updater_name varchar(100),
  74. update_time datetime
  75. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流程实例任务';