/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_ERRORFIELD_MAP' AND KSQL_COL_NAME IN ('FBEFORECULLING'))
 ALTER TABLE T_FCS_ERRORFIELD_MAP ADD (FBEFORECULLING CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_ERRORFIELD_MAP' AND KSQL_COL_NAME IN ('FFEATURECULLINGID'))
 ALTER TABLE T_FCS_ERRORFIELD_MAP ADD (FFEATURECULLINGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_ERRORFIELD_SCENE')
 CREATE TABLE T_FCS_ERRORFIELD_SCENE (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKFEATURE_CULLING_L')
 CREATE TABLE T_FCS_RISKFEATURE_CULLING_L (
FPKID NVARCHAR(50) 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_RISKFEATURE_ENTRY')
 CREATE TABLE T_FCS_RISKFEATURE_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,
FFEATURE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FFEATURE_TAG NCLOB DEFAULT ' '
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKSCENE_CULLING')
 CREATE TABLE T_FCS_RISKSCENE_CULLING (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(80) 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,
FBILLENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCLASSNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


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

/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISK_LOG')
 CREATE TABLE T_FCS_RISK_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FRISKSCREENID BIGINT DEFAULT 0 NOT NULL,
FEXECTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDETAIL NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FEXECUSERID BIGINT DEFAULT 0 NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKBILL_LOG')
 CREATE TABLE T_FCS_RISKBILL_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FRISKLOGID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FEXECRES NVARCHAR(50) DEFAULT ' ' NOT NULL,
FERRORMSG NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FRISKSCREENID BIGINT DEFAULT 0 NOT NULL,
FEXECUSERID BIGINT DEFAULT 0 NOT NULL,
FBATCHID NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FEXECNUM BIGINT DEFAULT 0 NOT NULL,
FSUCCESSNUM BIGINT DEFAULT 0 NOT NULL,
FFAILNUM BIGINT DEFAULT 0 NOT NULL,
FBILLTYPEID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FEXECINFO NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_RISKSCREEN_LOG')
 CREATE TABLE T_FCS_RISKSCREEN_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FRISKLOGID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FEXECRES NVARCHAR(50) DEFAULT ' ' NOT NULL,
FERRORMSG NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FEXECUSERID BIGINT DEFAULT 0 NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FSCREENBATCHID BIGINT DEFAULT 0 NOT NULL,
FSCREENITEM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME,
FRISKSCREENID BIGINT DEFAULT 0 NOT NULL,
FBILLTYPEID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FBILLTEXT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLTEXT_TAG NCLOB DEFAULT ''
);



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

