/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULEPROP') 
 CREATE TABLE T_FCS_SCHEDULEPROP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(50) 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,
FTASKTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECUTORID BIGINT DEFAULT 0 NOT NULL,
FINFORECEIVERID BIGINT DEFAULT 0 NOT NULL,
FBIZAPP NVARCHAR(36) DEFAULT ' ' NOT NULL,
FBUSSINESS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZFILTER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZFILTERCONFIG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZFILTERCONFIG_TAG NCLOB DEFAULT '',
FSCHEPLANID NVARCHAR(36) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULEPROP_L') 
 CREATE TABLE T_FCS_SCHEDULEPROP_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMMENT NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULE_ORG') 
 CREATE TABLE T_FCS_SCHEDULE_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,
FORGNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHETASKENTRY') 
 CREATE TABLE T_FCS_SCHETASKENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FOPERATEKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMSETTING NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCHEJOBID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FPARAMCONTENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPARAMCONTENT_TAG NCLOB DEFAULT '',
FOPERATENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCHEAPPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHETASKENTRY_L') 
 CREATE TABLE T_FCS_SCHETASKENTRY_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULEPARAM') 
 CREATE TABLE T_FCS_SCHEDULEPARAM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(50) 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,
FCLASSNAMEID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FBIZAPP NVARCHAR(36) DEFAULT ' ' NOT NULL,
FBUSSINESS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATEKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMBOFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULEPARAM_L') 
 CREATE TABLE T_FCS_SCHEDULEPARAM_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMMENT NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHPARAMENTRY') 
 CREATE TABLE T_FCS_SCHPARAMENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPARAM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREQUIRE CHAR(1) DEFAULT '0' NOT NULL,
FPARAMTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMVAL NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHPARAMENTRY_L') 
 CREATE TABLE T_FCS_SCHPARAMENTRY_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPARAMNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCOMBOVAL NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FPARAMDESC NVARCHAR(400) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULE_LOG') 
 CREATE TABLE T_FCS_SCHEDULE_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(50) 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,
FSCHEDULEID BIGINT DEFAULT 0 NOT NULL,
FTASKTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMAINTASKID NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULE_LOG_ENTRY') 
 CREATE TABLE T_FCS_SCHEDULE_LOG_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMODIFIERFIELD BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATEFIELD DATETIME,
FEXECUTESTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FEXECUTEDETAILS NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FQUANTITY BIGINT DEFAULT 0 NOT NULL,
FFAILSUMQUANTITY BIGINT DEFAULT 0 NOT NULL,
FTASKID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCHEJOBID NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULE_LOG_ENTRY_L') 
 CREATE TABLE T_FCS_SCHEDULE_LOG_ENTRY_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULEDETAIL_LOG') 
 CREATE TABLE T_FCS_SCHEDULEDETAIL_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(50) 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,
FTASKNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXCEPTION NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FEXECUTETIME DATETIME,
FSCHEDULEID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCBILLID BIGINT DEFAULT 0 NOT NULL,
FBUSSINESS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FLASTEXECTIME DATETIME,
FEXECNUMBER BIGINT DEFAULT 0 NOT NULL,
FBIZAPPID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FOPERSUMLOGID BIGINT DEFAULT 0 NOT NULL,
FOPER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_SCHEDULEOPERSUM_LOG') 
 CREATE TABLE T_FCS_SCHEDULEOPERSUM_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FSCHEDULEID BIGINT DEFAULT 0 NOT NULL,
FBIZAPPID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FBUSSINESS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECSTARTDATE DATETIME,
FEXECENDDATE DATETIME,
FEXECSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLQTY BIGINT DEFAULT 0 NOT NULL,
FEXECDETAIL NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSCHEMASUMLOGID BIGINT DEFAULT 0 NOT NULL,
FSUCCESSBILLQTY BIGINT DEFAULT 0 NOT NULL,
FFAILBILLQTY BIGINT DEFAULT 0 NOT NULL,
FOPERNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);



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