create table FLOW_BASE_BUTTON
(
  ID       VARCHAR2(8) not null,
  NAME     VARCHAR2(50),
  TYPE     CHAR(1),
  PROPERTY VARCHAR2(500),
  ICO      VARCHAR2(500),
  POSITION CHAR(1),
  BNAME    VARCHAR2(50),
  CODE     VARCHAR2(4),
  ROLEIDS  VARCHAR2(1000)
)
;
alter table FLOW_BASE_BUTTON
  add constraint PK_FLOW_BASE_BUTTON primary key (ID);


create table FLOW_CONFIG_ACTIVITY
(
  ID             VARCHAR2(10) not null,
  FID            VARCHAR2(10),
  IDENTIFICATION VARCHAR2(12),
  NAME           VARCHAR2(100),
  DESC1          VARCHAR2(300),
  TYPE           CHAR(1),
  ORDER1         NUMBER,
  ISSIGN         CHAR(1),
  ASTRATEGY      CHAR(1),
  CSTRATEGY      CHAR(1),
  CNUM           NUMBER,
  OPENHELP       CHAR(1),
  XYCSS          VARCHAR2(500),
  ATTTYPE        CHAR(1),
  ATTNUM         NUMBER(3),
  ISNOTE         CHAR(1),
  FORMPATH       VARCHAR2(500),
  ISMESSAGE      CHAR(1),
  MESSAGE        VARCHAR2(1000),
  ISSAVE1        CHAR(1),
  ISSAVE2        CHAR(1),
  ISLEAVE1       CHAR(1),
  ISLEAVE2       CHAR(1),
  ADDFORMPATH    VARCHAR2(500),
  ADDFORMWIDTH   VARCHAR2(10),
  ADDFORMHEIGHT  VARCHAR2(10),
  ADDFORMMESSAGE VARCHAR2(500),
  ISBRANCH       VARCHAR2(1)
)
;
alter table FLOW_CONFIG_ACTIVITY
  add constraint PK_FLOW_CONFIG_ACTIVITY primary key (ID);



create table FLOW_CONFIG_ACTIVITY_BUTTON
(
  ID       VARCHAR2(12) not null,
  FID      VARCHAR2(10),
  BUTTONID VARCHAR2(8),
  BWHERE    VARCHAR2(1000)
)
;
alter table FLOW_CONFIG_ACTIVITY_BUTTON
  add constraint PK_FLOW_CONFIG_ACTIVITY_BUTTON primary key (ID);



create table FLOW_CONFIG_ACTIVITY_CONNE
(
  ID     VARCHAR2(10) not null,
  FID    VARCHAR2(10),
  CID    VARCHAR2(10),
  SID    VARCHAR2(10),
  EID    VARCHAR2(10),
  NAME   VARCHAR2(100),
  DESC1  VARCHAR2(300),
  WHERE1 VARCHAR2(1000),
  TYPE   VARCHAR2(2),
  ISNEED CHAR(1),
  ISATT  CHAR(1)
)
;
alter table FLOW_CONFIG_ACTIVITY_CONNE
  add constraint PK_FLOW_CONFIG_ACTIVITY_CONNE primary key (ID);



create table FLOW_CONFIG_ACTIVITY_GROUP
(
  ID         VARCHAR2(10) not null,
  ACTIVITYID VARCHAR2(10),
  GROUPID    VARCHAR2(8)
)
;
alter table FLOW_CONFIG_ACTIVITY_GROUP
  add constraint PK_FLOW_CONFIG_ACTIVITY_GROUP primary key (ID);


create table FLOW_CONFIG_CONN_AUTHOR
(
  ID       VARCHAR2(8) not null,
  CONNTYPE CHAR(1),
  CONNID   VARCHAR2(10),
  AAID     VARCHAR2(10)
)
;
alter table FLOW_CONFIG_CONN_AUTHOR
  add constraint PK_FLOW_CONFIG_CONN_AUTHOR primary key (ID);


create table FLOW_CONFIG_ENTRUST
(
  ID      VARCHAR2(8) not null,
  SUSERNO VARCHAR2(16),
  IUSERNO VARCHAR2(16),
  SDATE   DATE,
  EDATE   DATE
)
;
alter table FLOW_CONFIG_ENTRUST
  add constraint PK_FLOW_CONFIG_ENTRUST primary key (ID);



create table FLOW_CONFIG_PACKAGE
(
  ID             VARCHAR2(3) not null,
  IDENTIFICATION VARCHAR2(11),
  NAME           VARCHAR2(100),
  DESC1          VARCHAR2(300),
  STATUS         CHAR(1),
  ICO            VARCHAR2(3),
  CREATEPSN      VARCHAR2(16),
  CREATEDATE     DATE,
  FID            VARCHAR2(3)
)
;
alter table FLOW_CONFIG_PACKAGE
  add constraint PK_FLOW_CONFIG_PACKAGE primary key (ID);


create table FLOW_CONFIG_PROCESS
(
  ID             VARCHAR2(10) not null,
  IDENTIFICATION VARCHAR2(10),
  NAME           VARCHAR2(100),
  DESC1          VARCHAR2(300),
  FLOWPACKAGE    VARCHAR2(3),
  DOCID          VARCHAR2(8),
  STATUS         CHAR(1),
  CREATEPSN      VARCHAR2(16),
  CREATEDATE     DATE,
  CODE           VARCHAR2(4),
  ICO            VARCHAR2(2),
  TYPE           CHAR(1),
  CNUM           NUMBER(3),
  FORMTYPE       CHAR(1),
  ISDELETEFORM   CHAR(1),
  DCODE          VARCHAR2(64)
)
;
alter table FLOW_CONFIG_PROCESS
  add constraint PK_FLOW_CONFIG_PROCESS primary key (ID);



create table FLOW_CONFIG_PROCESS_CONNECTION
(
  ID    VARCHAR2(10) not null,
  FID   VARCHAR2(10),
  CID   VARCHAR2(10),
  EID   VARCHAR2(10),
  NAME  VARCHAR2(100),
  FDESC  VARCHAR2(300),
  FWHERE VARCHAR2(1000),
  TYPE  VARCHAR2(2)
)
;
alter table FLOW_CONFIG_PROCESS_CONNECTION
  add constraint PK_FLOW_CONFIG_PROCESS_CONNECT primary key (ID);


create table FLOW_CONFIG_PROSESS_GROUP
(
  ID        VARCHAR2(10) not null,
  PROSESSID VARCHAR2(10),
  GROUPID   VARCHAR2(8),
  TYPE      CHAR(1),
  ISDEPT    CHAR(1)
)
;
alter table FLOW_CONFIG_PROSESS_GROUP
  add constraint PK_FLOW_CONFIG_PROSESS_GROUP primary key (ID);




create table FLOW_CONFIG_TIME
(
  ID          VARCHAR2(8) not null,
  FID         VARCHAR2(10),
  DAY         NUMBER,
  NAME        VARCHAR2(50),
  ABNORMITYID VARCHAR2(2),
  FREQUENCY   NUMBER
)
;
alter table FLOW_CONFIG_TIME
  add constraint PK_FLOW_CONFIG_TIME primary key (ID);



create table FLOW_MANAGE_NOTE
(
  ID          VARCHAR2(20) not null,
  FLOWRUNID   VARCHAR2(20),
  CONNID      VARCHAR2(100),
  FLOWNAME    VARCHAR2(500),
  USERID      VARCHAR2(16),
  OPERATETIME DATE,
  OPERATEIP   VARCHAR2(50),
  OPERATETYPE VARCHAR2(50)
)
;
alter table FLOW_MANAGE_NOTE
  add constraint PK_FLOW_MANAGE_NOTE primary key (ID);


create table FLOW_RUNTIME_ACTIVITY
(
  ID        VARCHAR2(20) not null,
  FID       VARCHAR2(20),
  SACTIVITY VARCHAR2(10),
  EACTIVITY VARCHAR2(10),
  NAME      VARCHAR2(300),
  DOPSN     VARCHAR2(16),
  DODATE    DATE,
  DOIDEA    VARCHAR2(1000),
  DOFLAG    CHAR(1),
  SENDPSN   VARCHAR2(16),
  SENDDATE  DATE,
  FORMPATH  VARCHAR2(500),
  DOIP      VARCHAR2(30)
)
;
alter table FLOW_RUNTIME_ACTIVITY
  add constraint PK_FLOW_RUNTIME_ACTIVITY primary key (ID);



create table FLOW_RUNTIME_ENTRUSTLOG
(
  ID       VARCHAR2(8) not null,
  SUSERNO  VARCHAR2(16),
  IUSERNO  VARCHAR2(16),
  SDATE    DATE,
  EDATE    DATE,
  TYPE     CHAR(1),
  FLOWNAME VARCHAR2(150),
  FLOWID   VARCHAR2(20),
  FLOWNODE VARCHAR2(50),
  LOGDATE  DATE
)
;
alter table FLOW_RUNTIME_ENTRUSTLOG
  add constraint PK_FLOW_RUNTIME_ENTRUSTLOG primary key (ID);



create table FLOW_RUNTIME_PROCESS
(
  ID            VARCHAR2(20) not null,
  FLOWID        VARCHAR2(10),
  FLOWPATH      VARCHAR2(1000),
  NAME          VARCHAR2(1000),
  CREATEPSN     VARCHAR2(16),
  CREATEDATE    DATE,
  ACCEPTPSN     VARCHAR2(3000),
  ACCEPTDATE    DATE,
  CURRACTIVITY  VARCHAR2(10),
  READCOUNT     NUMBER,
  STATE         VARCHAR2(1),
  FORMTABLE     VARCHAR2(50),
  FORMID        VARCHAR2(50),
  OTHERID       VARCHAR2(500),
  ACCEPTPSNNUM  NUMBER(10),
  FACCEPTPSN    VARCHAR2(3000),
  FDATE         DATE,
  ISABNORMITY   CHAR(1),
  ABNORMITYDATE DATE,
  PARENTID      VARCHAR2(500),
  PARENTID1     VARCHAR2(500),
  RID           VARCHAR2(50),
  RECORDID      VARCHAR2(30),
  FUID          VARCHAR2(2500)
)
;
alter table FLOW_RUNTIME_PROCESS
  add constraint PK_FLOW_RUNTIME_PROCESS primary key (ID);




insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000011', '删除', '1', 'doDelete();', 'buttonDelete.gif', '2', '删除', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000012', '初始化流程', '1', 'doInit();', 'buttonReturn.gif', '2', '初始化流程', null, null);

insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000014', '下一步', '1', 'doNext();', 'PuBtnNext.gif', '2', '下一步', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000010', '移交', '1', 'devolve();', 'IcoAdd.gif', '2', '移交', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000001', '处理返回', '1', 'doReturn();', 'buttonReturn.gif', '2', '处理返回', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000004', '办结', '1', 'doFinish();', 'IcoEdit.gif', '2', '办结', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000002', '退回', '1', 'doUntread();', 'buttonReturn.gif', '2', '退回', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000003', '完成', '1', 'doFinish();', 'IcoEdit.gif', '2', '完成', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000005', '打印', '5', 'Openprint(''../../ZrCollEngine/Print/DoPrint.jsp'')', 'IcoPrint.gif', '2', '打印', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000007', '保存', '1', 'saveColl(''1'');', 'buttonSave.gif', '2', '保存', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000008', '提交', '1', 'saveColl(''2'');', 'IcoAdd.gif', '2', '提交', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000009', '关闭', '4', 'doClose();', 'buttonClose.gif', '3', '关闭', '02', null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000035', '送部门承办', '1', 'dodept();', 'IcoAdd.gif', '2', '送部门承办', null, '321,304');
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000040', '分送', '1', 'dosend(''0000000006'','''',''2'','''',''0'');//说明：第一个参数为指定显示传阅的活动id,第二个参数为待选择传阅人的角色编号，多个编号间用,号隔开,第三个参数为单位编号左包含的编码位数,第四个参数为是否是本部门的人,1表示本部门的人员，参数为空时表示选择所有的人员,第五个参数为是否发送短信。', 'office4.gif', '2', '分送(不受流程流转影响)', null, null);
insert into FLOW_BASE_BUTTON (ID, NAME, TYPE, PROPERTY, ICO, POSITION, BNAME, CODE, ROLEIDS)
values ('00000041', '已阅', '1', 'dosendFinish();', 'office5.gif', '2', '分送(已阅)', null, null);
commit;


