CREATE TABLE [FLOW_BASE_BUTTON](
	[ID] [varchar](8)  NOT NULL,
	[NAME] [varchar](50)  NULL,
	[TYPE] [char](1)  NULL,
	[PROPERTY] [varchar](300)  NULL,
	[ICO] [varchar](300)  NULL,
	[POSITION] [char](1)  NULL,
	[BNAME] [varchar](50)  NULL,
	[CODE] [varchar](4)  NULL,
	[ROLEIDS] [varchar](1000)  NULL,
 CONSTRAINT [PK_FLOW_BASE_BUTTON] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_CONFIG_ACTIVITY](
	[ID] [varchar](10)  NOT NULL,
	[FID] [varchar](10)  NULL,
	[IDENTIFICATION] [varchar](12)  NULL,
	[NAME] [varchar](100)  NULL,
	[DESC1] [varchar](300)  NULL,
	[TYPE] [char](1)  NULL,
	[ORDER1] [numeric](38, 0) NULL,
	[ISSIGN] [char](1)  NULL,
	[ASTRATEGY] [char](1)  NULL,
	[CSTRATEGY] [char](1)  NULL,
	[CNUM] [numeric](38, 0) NULL,
	[OPENHELP] [char](1)  NULL,
	[XYCSS] [varchar](500)  NULL,
	[ATTTYPE] [char](1)  NULL,
	[ATTNUM] [numeric](3, 0) NULL,
	[ISNOTE] [char](1)  NULL,
	[FORMPATH] [varchar](500)  NULL,
	[ISMESSAGE] [char](1)  NULL,
	[MESSAGE] [varchar](1000)  NULL,
	[ISSAVE1] [char](1)  NULL,
	[ISSAVE2] [char](1)  NULL,
	[ISLEAVE1] [char](1)  NULL,
	[ISLEAVE2] [char](1)  NULL,
	[ADDFORMPATH] [varchar](500)  NULL,
	[ADDFORMWIDTH] [varchar](10)  NULL,
	[ADDFORMHEIGHT] [varchar](10)  NULL,
	[ADDFORMMESSAGE] [varchar](500)  NULL,
	[ISBRANCH] [varchar](1)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_ACTIVITY] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [FLOW_CONFIG_ACTIVITY_BUTTON](
	[ID] [varchar](12)  NOT NULL,
	[FID] [varchar](10)  NULL,
	[BUTTONID] [varchar](8)  NULL,
	[BWHERE] [varchar](1000)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_ACTIVITY_BUTTON] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_CONFIG_ACTIVITY_CONNE](
	[ID] [varchar](10)  NOT NULL,
	[FID] [varchar](10)  NULL,
	[CID] [varchar](10)  NULL,
	[SID] [varchar](10)  NULL,
	[EID] [varchar](10)  NULL,
	[NAME] [varchar](100)  NULL,
	[DESC1] [varchar](300)  NULL,
	[WHERE1] [varchar](1000)  NULL,
	[TYPE] [varchar](2)  NULL,
	[ISNEED] [char](1)  NULL,
	[ISATT] [char](1)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_ACTIVITY_CONNE] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [FLOW_CONFIG_ACTIVITY_GROUP](
	[ID] [varchar](10)  NOT NULL,
	[ACTIVITYID] [varchar](10)  NULL,
	[GROUPID] [varchar](8)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_ACTIVITY_GROUP] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_CONFIG_CONN_AUTHOR](
	[ID] [varchar](8)  NOT NULL,
	[CONNTYPE] [char](1)  NULL,
	[CONNID] [varchar](10)  NULL,
	[AAID] [varchar](10)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_CONN_AUTHOR] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [FLOW_CONFIG_ENTRUST](
	[ID] [varchar](8)  NOT NULL,
	[SUSERNO] [varchar](16)  NULL,
	[IUSERNO] [varchar](16)  NULL,
	[SDATE] [datetime] NULL,
	[EDATE] [datetime] NULL,
 CONSTRAINT [PK_FLOW_CONFIG_ENTRUST] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_CONFIG_PACKAGE](
	[ID] [varchar](3)  NOT NULL,
	[IDENTIFICATION] [varchar](11)  NULL,
	[NAME] [varchar](100)  NULL,
	[DESC1] [varchar](300)  NULL,
	[STATUS] [char](1)  NULL,
	[ICO] [varchar](3)  NULL,
	[CREATEPSN] [varchar](16)  NULL,
	[CREATEDATE] [datetime] NULL,
	[FID] [varchar](3)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_PACKAGE] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_CONFIG_PROCESS](
	[ID] [varchar](10)  NOT NULL,
	[IDENTIFICATION] [varchar](10)  NULL,
	[NAME] [varchar](100)  NULL,
	[DESC1] [varchar](300)  NULL,
	[FLOWPACKAGE] [varchar](3)  NULL,
	[DOCID] [varchar](8)  NULL,
	[STATUS] [char](1)  NULL,
	[CREATEPSN] [varchar](16)  NULL,
	[CREATEDATE] [datetime] NULL,
	[CODE] [varchar](4)  NULL,
	[ICO] [varchar](2)  NULL,
	[TYPE] [char](1)  NULL,
	[CNUM] [numeric](3, 0) NULL,
	[FORMTYPE] [char](1)  NULL,
	[ISDELETEFORM] [char](1)  NULL,
        [DCODE] [varchar](64)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_PROCESS] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_CONFIG_PROCESS_CONNECTION](
	[ID] [varchar](10)  NOT NULL,
	[FID] [varchar](10)  NULL,
	[CID] [varchar](10)  NULL,
	[EID] [varchar](10)  NULL,
	[NAME] [varchar](100)  NULL,
	[FDESC] [varchar](300)  NULL,
	[FWHERE] [varchar](1000)  NULL,
	[TYPE] [varchar](2)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_PROCESS_CONNECTION] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)




CREATE TABLE [FLOW_CONFIG_PROSESS_GROUP](
	[ID] [varchar](10)  NOT NULL,
	[PROSESSID] [varchar](10)  NULL,
	[GROUPID] [varchar](8)  NULL,
	[TYPE] [char](1)  NULL,
	[ISDEPT] [char](1)  NULL,
 CONSTRAINT [PK_FLOW_CONFIG_PROSESS_GROUP] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_CONFIG_TIME](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](10)  NULL,
	[DAY] [numeric](38, 0) NULL,
	[NAME] [varchar](50)  NULL,
	[ABNORMITYID] [varchar](2)  NULL,
	[FREQUENCY] [numeric](38, 0) NULL,
 CONSTRAINT [PK_FLOW_CONFIG_TIME] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_MANAGE_NOTE](
	[ID] [varchar](20)  NOT NULL,
	[FLOWRUNID] [varchar](20)  NULL,
	[CONNID] [varchar](100)  NULL,
	[FLOWNAME] [varchar](500)  NULL,
	[USERID] [varchar](16)  NULL,
	[OPERATETIME] [datetime] NULL,
	[OPERATEIP] [varchar](50)  NULL,
	[OPERATETYPE] [varchar](50)  NULL,
 CONSTRAINT [PK_FLOW_MANAGE_NOTE] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_RUNTIME_ACTIVITY](
	[ID] [varchar](20)  NOT NULL,
	[FID] [varchar](20)  NULL,
	[SACTIVITY] [varchar](10)  NULL,
	[EACTIVITY] [varchar](10)  NULL,
	[NAME] [varchar](300)  NULL,
	[DOPSN] [varchar](16)  NULL,
	[DODATE] [datetime] NULL,
	[DOIDEA] [varchar](1000)  NULL,
	[DOFLAG] [char](1)  NULL,
	[SENDPSN] [varchar](16)  NULL,
	[SENDDATE] [datetime] NULL,
	[FORMPATH] [varchar](500)  NULL,
	[DOIP] [varchar](30)  NULL,
 CONSTRAINT [PK_FLOW_RUNTIME_ACTIVITY] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_RUNTIME_ENTRUSTLOG](
	[ID] [varchar](8)  NOT NULL,
	[SUSERNO] [varchar](16)  NULL,
	[IUSERNO] [varchar](16)  NULL,
	[SDATE] [datetime] NULL,
	[EDATE] [datetime] NULL,
	[TYPE] [char](1)  NULL,
	[FLOWNAME] [varchar](150)  NULL,
	[FLOWID] [varchar](20)  NULL,
	[FLOWNODE] [varchar](50)  NULL,
	[LOGDATE] [datetime] NULL,
 CONSTRAINT [PK_FLOW_RUNTIME_ENTRUSTLOG] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [FLOW_RUNTIME_PROCESS](
	[ID] [varchar](20)  NOT NULL,
	[FLOWID] [varchar](10)  NULL,
	[FLOWPATH] [varchar](1000)  NULL,
	[NAME] [varchar](1000)  NULL,
	[CREATEPSN] [varchar](16)  NULL,
	[CREATEDATE] [datetime] NULL,
	[ACCEPTPSN] [varchar](3000)  NULL,
	[ACCEPTDATE] [datetime] NULL,
	[CURRACTIVITY] [varchar](10)  NULL,
	[READCOUNT] [numeric](38, 0) NULL,
	[STATE] [varchar](1)  NULL,
	[FORMTABLE] [varchar](50)  NULL,
	[FORMID] [varchar](50)  NULL,
	[OTHERID] [varchar](500)  NULL,
	[ACCEPTPSNNUM] [numeric](10, 0) NULL,
	[FACCEPTPSN] [varchar](3000)  NULL,
	[FDATE] [datetime] NULL,
	[ISABNORMITY] [char](1)  NULL,
	[ABNORMITYDATE] [datetime] NULL,
	[PARENTID] [varchar](500)  NULL,
	[PARENTID1] [varchar](500)  NULL,
	[RID] [varchar](50)  NULL,
	[RECORDID] [varchar](30)  NULL,
        [FUID] [varchar](2500)  NULL,
 CONSTRAINT [PK_FLOW_RUNTIME_PROCESS] PRIMARY KEY CLUSTERED 
(
	[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);



