oracle-wram-flow-all.sql 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. create table FLOW_SKIP
  2. (
  3. ID NUMBER(20) not null
  4. constraint FLOW_SKIP_PK
  5. primary key,
  6. DEFINITION_ID NUMBER(20) not null,
  7. NOW_NODE_CODE VARCHAR2(100) not null,
  8. NOW_NODE_TYPE NUMBER(1),
  9. NEXT_NODE_CODE VARCHAR2(100) not null,
  10. NEXT_NODE_TYPE NUMBER(1),
  11. SKIP_NAME VARCHAR2(100),
  12. SKIP_TYPE VARCHAR2(40),
  13. SKIP_CONDITION VARCHAR2(200),
  14. COORDINATE VARCHAR2(100),
  15. CREATE_TIME DATE,
  16. UPDATE_TIME DATE,
  17. DEL_FLAG VARCHAR2(1),
  18. TENANT_ID VARCHAR2(40)
  19. )
  20. /
  21. comment on table FLOW_SKIP is '节点跳转关联表'
  22. /
  23. comment on column FLOW_SKIP.ID is '主键id'
  24. /
  25. comment on column FLOW_SKIP.DEFINITION_ID is '流程定义id'
  26. /
  27. comment on column FLOW_SKIP.NOW_NODE_CODE is '当前流程节点类型 (0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)'
  28. /
  29. comment on column FLOW_SKIP.NOW_NODE_TYPE is '下一个流程节点类型 (0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)'
  30. /
  31. comment on column FLOW_SKIP.NEXT_NODE_CODE is '下一个流程节点编码'
  32. /
  33. comment on column FLOW_SKIP.NEXT_NODE_TYPE is '下一个流程节点类型 (0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)'
  34. /
  35. comment on column FLOW_SKIP.SKIP_NAME is '跳转名称'
  36. /
  37. comment on column FLOW_SKIP.SKIP_TYPE is '跳转类型 (PASS审批通过 REJECT退回)'
  38. /
  39. comment on column FLOW_SKIP.SKIP_CONDITION is '跳转条件'
  40. /
  41. comment on column FLOW_SKIP.COORDINATE is '坐标'
  42. /
  43. comment on column FLOW_SKIP.CREATE_TIME is '创建时间'
  44. /
  45. comment on column FLOW_SKIP.UPDATE_TIME is '更新时间'
  46. /
  47. comment on column FLOW_SKIP.DEL_FLAG is '删除标志'
  48. /
  49. comment on column FLOW_SKIP.TENANT_ID is '租户id'
  50. /
  51. create table FLOW_HIS_TASK
  52. (
  53. ID NUMBER(20) not null,
  54. DEFINITION_ID NUMBER(20) not null,
  55. INSTANCE_ID NUMBER(20) not null,
  56. TASK_ID NUMBER(20) not null,
  57. NODE_CODE VARCHAR2(100),
  58. NODE_NAME VARCHAR2(100),
  59. NODE_TYPE NUMBER(1),
  60. TARGET_NODE_CODE VARCHAR2(100),
  61. TARGET_NODE_NAME VARCHAR2(100),
  62. FLOW_STATUS NUMBER(2),
  63. MESSAGE VARCHAR2(500),
  64. CREATE_TIME DATE,
  65. UPDATE_TIME DATE,
  66. DEL_FLAG VARCHAR2(1),
  67. TENANT_ID VARCHAR2(40),
  68. APPROVER VARCHAR2(40),
  69. COOPERATE_TYPE NUMBER(1) default 0,
  70. COLLABORATOR VARCHAR2(40)
  71. )
  72. /
  73. comment on table FLOW_HIS_TASK is '历史任务记录表'
  74. /
  75. comment on column FLOW_HIS_TASK.ID is '主键id'
  76. /
  77. comment on column FLOW_HIS_TASK.DEFINITION_ID is '对应flow_definition表的id'
  78. /
  79. comment on column FLOW_HIS_TASK.INSTANCE_ID is '对应flow_instance表的id'
  80. /
  81. comment on column FLOW_HIS_TASK.TASK_ID is '对应flow_task表的id'
  82. /
  83. comment on column FLOW_HIS_TASK.NODE_CODE is '开始节点编码'
  84. /
  85. comment on column FLOW_HIS_TASK.NODE_NAME is '开始节点名称'
  86. /
  87. comment on column FLOW_HIS_TASK.NODE_TYPE is '开始节点类型 (0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)'
  88. /
  89. comment on column FLOW_HIS_TASK.TARGET_NODE_CODE is '目标节点编码'
  90. /
  91. comment on column FLOW_HIS_TASK.TARGET_NODE_NAME is '目标节点名称'
  92. /
  93. comment on column FLOW_HIS_TASK.FLOW_STATUS is '流程状态(1审批中 2 审批通过 9已退回 10失效)'
  94. /
  95. comment on column FLOW_HIS_TASK.MESSAGE is '审批意见'
  96. /
  97. comment on column FLOW_HIS_TASK.CREATE_TIME is '创建时间'
  98. /
  99. comment on column FLOW_HIS_TASK.UPDATE_TIME is '更新时间'
  100. /
  101. comment on column FLOW_HIS_TASK.DEL_FLAG is '删除标志'
  102. /
  103. comment on column FLOW_HIS_TASK.TENANT_ID is '租户id'
  104. /
  105. comment on column FLOW_HIS_TASK.APPROVER is '审批者'
  106. /
  107. comment on column FLOW_HIS_TASK.COOPERATE_TYPE is '协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)'
  108. /
  109. comment on column FLOW_HIS_TASK.COLLABORATOR is '协作人'
  110. /
  111. create table FLOW_DEFINITION
  112. (
  113. ID NUMBER(20) not null
  114. constraint FLOW_DEFINITION_PK
  115. primary key,
  116. FLOW_CODE VARCHAR2(40) not null,
  117. FLOW_NAME VARCHAR2(100) not null,
  118. VERSION VARCHAR2(20) not null,
  119. IS_PUBLISH NUMBER(1) default 0 not null,
  120. FROM_CUSTOM VARCHAR2(1) default 'N',
  121. FROM_PATH VARCHAR2(100),
  122. CREATE_TIME DATE,
  123. UPDATE_TIME DATE,
  124. DEL_FLAG VARCHAR2(1),
  125. TENANT_ID VARCHAR2(40)
  126. )
  127. /
  128. comment on table FLOW_DEFINITION is '流程定义表'
  129. /
  130. comment on column FLOW_DEFINITION.ID is '主键id'
  131. /
  132. comment on column FLOW_DEFINITION.FLOW_CODE is '流程编码'
  133. /
  134. comment on column FLOW_DEFINITION.FLOW_NAME is '流程名称'
  135. /
  136. comment on column FLOW_DEFINITION.VERSION is '流程版本'
  137. /
  138. comment on column FLOW_DEFINITION.IS_PUBLISH is '是否发布 (0未发布 1已发布 9失效)'
  139. /
  140. comment on column FLOW_DEFINITION.FROM_CUSTOM is '审批表单是否自定义 (Y是 N否)'
  141. /
  142. comment on column FLOW_DEFINITION.FROM_PATH is '审批表单路径'
  143. /
  144. comment on column FLOW_DEFINITION.CREATE_TIME is '创建时间'
  145. /
  146. comment on column FLOW_DEFINITION.UPDATE_TIME is '更新时间'
  147. /
  148. comment on column FLOW_DEFINITION.DEL_FLAG is '删除标志'
  149. /
  150. comment on column FLOW_DEFINITION.TENANT_ID is '租户id'
  151. /
  152. create table FLOW_INSTANCE
  153. (
  154. ID NUMBER not null
  155. constraint FLOW_INSTANCE_PK
  156. primary key,
  157. DEFINITION_ID NUMBER not null,
  158. BUSINESS_ID VARCHAR2(40) not null,
  159. NODE_TYPE NUMBER(1),
  160. NODE_CODE VARCHAR2(100),
  161. NODE_NAME VARCHAR2(100),
  162. VARIABLE CLOB,
  163. FLOW_STATUS NUMBER(2),
  164. CREATE_BY VARCHAR2(64) default '',
  165. CREATE_TIME DATE,
  166. UPDATE_TIME DATE,
  167. EXT VARCHAR2(500),
  168. DEL_FLAG VARCHAR2(1),
  169. TENANT_ID VARCHAR2(40)
  170. )
  171. /
  172. comment on table FLOW_INSTANCE is '流程实例表'
  173. /
  174. comment on column FLOW_INSTANCE.ID is '主键id'
  175. /
  176. comment on column FLOW_INSTANCE.DEFINITION_ID is '对应flow_definition表的id'
  177. /
  178. comment on column FLOW_INSTANCE.BUSINESS_ID is '业务id'
  179. /
  180. comment on column FLOW_INSTANCE.NODE_TYPE is '开始节点类型 (0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)'
  181. /
  182. comment on column FLOW_INSTANCE.NODE_CODE is '开始节点编码'
  183. /
  184. comment on column FLOW_INSTANCE.NODE_NAME is '开始节点名称'
  185. /
  186. comment on column FLOW_INSTANCE.VARIABLE is '任务变量'
  187. /
  188. comment on column FLOW_INSTANCE.FLOW_STATUS is '流程状态(0待提交 1审批中 2 审批通过 3自动通过 8已完成 9已退回 10失效)'
  189. /
  190. comment on column FLOW_INSTANCE.CREATE_BY is '创建者'
  191. /
  192. comment on column FLOW_INSTANCE.CREATE_TIME is '创建时间'
  193. /
  194. comment on column FLOW_INSTANCE.UPDATE_TIME is '更新时间'
  195. /
  196. comment on column FLOW_INSTANCE.EXT is '扩展字段'
  197. /
  198. comment on column FLOW_INSTANCE.DEL_FLAG is '删除标志'
  199. /
  200. comment on column FLOW_INSTANCE.TENANT_ID is '租户id'
  201. /
  202. create table FLOW_NODE
  203. (
  204. ID NUMBER(20) not null
  205. constraint FLOW_NODE_PK
  206. primary key,
  207. NODE_TYPE NUMBER(1) not null,
  208. DEFINITION_ID NUMBER(20) not null,
  209. NODE_CODE VARCHAR2(100) not null,
  210. NODE_NAME VARCHAR2(100),
  211. NODE_RATIO NUMBER(6,3),
  212. COORDINATE VARCHAR2(100),
  213. SKIP_ANY_NODE VARCHAR2(100) default 'N',
  214. LISTENER_TYPE VARCHAR2(100),
  215. LISTENER_PATH VARCHAR2(500),
  216. HANDLER_TYPE VARCHAR2(100),
  217. HANDLER_PATH VARCHAR2(400),
  218. VERSION VARCHAR2(20),
  219. CREATE_TIME DATE,
  220. UPDATE_TIME DATE,
  221. DEL_FLAG VARCHAR2(1),
  222. TENANT_ID VARCHAR2(40),
  223. PERMISSION_FLAG VARCHAR2(200)
  224. )
  225. /
  226. comment on table FLOW_NODE is '流程结点表'
  227. /
  228. comment on column FLOW_NODE.ID is '主键id'
  229. /
  230. comment on column FLOW_NODE.NODE_TYPE is '节点类型(0开始节点 1中间节点 2结束结点 3互斥网关 4并行网关)'
  231. /
  232. comment on column FLOW_NODE.DEFINITION_ID is '对应flow_definition表的id'
  233. /
  234. comment on column FLOW_NODE.NODE_CODE is '流程节点编码'
  235. /
  236. comment on column FLOW_NODE.NODE_NAME is '流程节点名称'
  237. /
  238. comment on column FLOW_NODE.NODE_RATIO is '流程签署比例值'
  239. /
  240. comment on column FLOW_NODE.COORDINATE is '坐标'
  241. /
  242. comment on column FLOW_NODE.SKIP_ANY_NODE is '是否可以退回任意节点 (Y是 N否)'
  243. /
  244. comment on column FLOW_NODE.LISTENER_TYPE is '监听器类型'
  245. /
  246. comment on column FLOW_NODE.LISTENER_PATH is '监听器路径'
  247. /
  248. comment on column FLOW_NODE.HANDLER_TYPE is '处理器类型'
  249. /
  250. comment on column FLOW_NODE.HANDLER_PATH is '处理器路径'
  251. /
  252. comment on column FLOW_NODE.VERSION is '版本'
  253. /
  254. comment on column FLOW_NODE.CREATE_TIME is '创建时间'
  255. /
  256. comment on column FLOW_NODE.UPDATE_TIME is '更新时间'
  257. /
  258. comment on column FLOW_NODE.DEL_FLAG is '删除标志'
  259. /
  260. comment on column FLOW_NODE.TENANT_ID is '租户id'
  261. /
  262. comment on column FLOW_NODE.PERMISSION_FLAG is '权限标识(权限类型:权限标识,可以多个,用逗号隔开)'
  263. /
  264. create table FLOW_TASK
  265. (
  266. ID NUMBER(20) not null
  267. constraint FLOW_TASK_PK
  268. primary key,
  269. DEFINITION_ID NUMBER(20) not null,
  270. INSTANCE_ID NUMBER(20) not null,
  271. NODE_CODE VARCHAR2(100),
  272. NODE_NAME VARCHAR2(100),
  273. NODE_TYPE NUMBER(1),
  274. CREATE_TIME DATE,
  275. UPDATE_TIME DATE,
  276. DEL_FLAG VARCHAR2(1),
  277. TENANT_ID VARCHAR2(40)
  278. )
  279. /
  280. comment on table FLOW_TASK is '待办任务表'
  281. /
  282. comment on column FLOW_TASK.ID is '主键id'
  283. /
  284. comment on column FLOW_TASK.DEFINITION_ID is '对应flow_definition表的id'
  285. /
  286. comment on column FLOW_TASK.INSTANCE_ID is '对应flow_instance表的id'
  287. /
  288. comment on column FLOW_TASK.NODE_CODE is '节点编码'
  289. /
  290. comment on column FLOW_TASK.NODE_NAME is '节点名称'
  291. /
  292. comment on column FLOW_TASK.NODE_TYPE is '节点类型 (0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)'
  293. /
  294. comment on column FLOW_TASK.CREATE_TIME is '创建时间'
  295. /
  296. comment on column FLOW_TASK.UPDATE_TIME is '更新时间'
  297. /
  298. comment on column FLOW_TASK.DEL_FLAG is '删除标志'
  299. /
  300. comment on column FLOW_TASK.TENANT_ID is '租户id'
  301. /
  302. create table FLOW_USER
  303. (
  304. ID NUMBER(20) not null
  305. constraint FLOW_USER_PK
  306. primary key,
  307. TYPE VARCHAR2(1) not null,
  308. PROCESSED_BY VARCHAR2(80),
  309. ASSOCIATED NUMBER(20) not null,
  310. CREATE_TIME DATE,
  311. CREATE_BY VARCHAR2(80),
  312. UPDATE_TIME DATE,
  313. DEL_FLAG VARCHAR2(1),
  314. TENANT_ID VARCHAR2(40)
  315. )
  316. /
  317. comment on table FLOW_USER is '待办任务表'
  318. /
  319. comment on column FLOW_USER.ID is '主键id'
  320. /
  321. comment on column FLOW_USER.TYPE is '人员类型(1代办任务的审批人权限 2代办任务的转办人权限 3待办任务的委托人权限)'
  322. /
  323. comment on column FLOW_USER.PROCESSED_BY is '权限人)'
  324. /
  325. comment on column FLOW_USER.ASSOCIATED is '关联表id'
  326. /
  327. comment on column FLOW_USER.CREATE_TIME is '创建时间'
  328. /
  329. comment on column FLOW_USER.CREATE_BY is '节点名称'
  330. /
  331. comment on column FLOW_USER.UPDATE_TIME is '更新时间'
  332. /
  333. comment on column FLOW_USER.DEL_FLAG is '删除标志'
  334. /
  335. comment on column FLOW_USER.TENANT_ID is '租户id'
  336. /
  337. create index USER_PROCESSED_TYPE
  338. on FLOW_USER (PROCESSED_BY, TYPE)
  339. /