/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKBUSIINFO')
 CREATE TABLE T_FCS_RISKBUSIINFO (
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,
FBUSINESS NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKBUSIINFO_L')
 CREATE TABLE T_FCS_RISKBUSIINFO_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
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKCONFIG_L')
 CREATE TABLE T_FCS_RISKCONFIG_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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKDIAGFILTER')
 CREATE TABLE T_FCS_RISKDIAGFILTER (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FFLCONDITIONNAME NVARCHAR(500) DEFAULT ' ',
FFLCONDITION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFLCONDITION_TAG NCLOB DEFAULT ' ',
FFLOBJECTID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FFLOBJSCOPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFLOBJSCOPE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFLOBJSCOPE_TAG NCLOB DEFAULT ' '
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKDIAGITEM')
 CREATE TABLE T_FCS_RISKDIAGITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FSCREENITEM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCHECKWAY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSIMILARITY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAPPBILLID NVARCHAR(36) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKDIAGPARAM')
 CREATE TABLE T_FCS_RISKDIAGPARAM (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPARAM NVARCHAR(150) DEFAULT ' ' NOT NULL,
FPARAMINFO NVARCHAR(150) DEFAULT ' ' NOT NULL,
FPARAMFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMBILL NVARCHAR(36) DEFAULT ' ' NOT NULL,
FISLINK CHAR(1) DEFAULT '0' NOT NULL,
FPARAMBILLID NVARCHAR(36) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKSCREEN')
 CREATE TABLE T_FCS_RISKSCREEN (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) 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,
FBILLENTITY NVARCHAR(36) DEFAULT ' ' NOT NULL,
FCONDITIONDESC NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCONDITION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONDITION_TAG NCLOB DEFAULT ' '
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKSCREENITEMENTRY')
 CREATE TABLE T_FCS_RISKSCREENITEMENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FERRORDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSCREENITEM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCONTROLMODEL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSUBENABLE CHAR(1) DEFAULT '0' NOT NULL,
FSCREENSETTINGID BIGINT DEFAULT 0 NOT NULL,
FSCRESETDESC NVARCHAR(50) DEFAULT ' ' NOT NULL
);


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



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_ERRORDATA')
 CREATE TABLE T_FCS_ERRORDATA (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) 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,
FDATATYPEID NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBIZTIME DATETIME,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FCOUNTERPARTY NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOPPUNIT NVARCHAR(80) DEFAULT ' ' NOT NULL,
FDEBITAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCREDITAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPAYBANK NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOPPBANK NVARCHAR(80) DEFAULT ' ' NOT NULL,
FREASONPROCESS NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FRESULT NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FRISKSCREENINGID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_ERRORDATA_SUBENTRY')
 CREATE TABLE T_FCS_ERRORDATA_SUBENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FERRORDESC NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FERRORDESCDETAIL NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_ERRORFIELD_MAP')
 CREATE TABLE T_FCS_ERRORFIELD_MAP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) 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,
FSRCENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESTENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_ERRORFIELD_ENTRY')
 CREATE TABLE T_FCS_ERRORFIELD_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDESTFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESTFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCFIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKTRADE_WARN')
 CREATE TABLE T_FCS_RISKTRADE_WARN (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) 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,
FBILLENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FWARNOP NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAIWARN CHAR(1) DEFAULT '0' NOT NULL,
FSUSPECTBILL CHAR(1) DEFAULT '0' NOT NULL,
FSMARTINSIGHT CHAR(1) DEFAULT '0' NOT NULL,
FDATAANALYSIS CHAR(1) DEFAULT '0' NOT NULL,
FSMARTSETTINGID BIGINT DEFAULT 0 NOT NULL,
FRISKSCREENINGID BIGINT DEFAULT 0 NOT NULL
);


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



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