/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_TASKFLOW') 
 CREATE TABLE T_FCS_TASKFLOW (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZAPPID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZENTITYID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBEGINOPERATE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZFILTER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZFILTERCONFIG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZFILTERCONFIG_TAG NCLOB,
FEXECUTORID BIGINT DEFAULT 0 NOT NULL,
FEXCEPTIONRECEIVERID BIGINT DEFAULT 0 NOT NULL,
FISREVOPERATE CHAR(1) DEFAULT '0' NOT NULL,
FISSHOWDETAILS CHAR(1) DEFAULT '0' NOT NULL,
FBEGINOPERATENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_TASKFLOW_L') 
 CREATE TABLE T_FCS_TASKFLOW_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_TASKFLOW_ORG') 
 CREATE TABLE T_FCS_TASKFLOW_ORG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_TASKFLOW_TASK') 
 CREATE TABLE T_FCS_TASKFLOW_TASK (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTASKNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATEKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMICROSERVICE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMAINENTITYID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISACROSSBILL CHAR(1) DEFAULT '0' NOT NULL,
FMSERVICECONFIG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMSERVICECONFIG_TAG NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_TASKEXESUM_LOG') 
 CREATE TABLE T_FCS_TASKEXESUM_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FTASKFLOWNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKFLOWNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXESTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECUTORID BIGINT DEFAULT 0 NOT NULL,
FSUMLOGID BIGINT DEFAULT 0 NOT NULL,
FENDTIME DATETIME,
FEXCEPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_TASKEXEDETAIL_LOG') 
 CREATE TABLE T_FCS_TASKEXEDETAIL_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FRESULT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZENTITYID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATEKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCOSTTIME INT DEFAULT 0 NOT NULL,
FTRACEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUMLOGID BIGINT DEFAULT 0 NOT NULL,
FOPERATENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZBILLID BIGINT DEFAULT 0 NOT NULL,
FEXCEPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
