/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_TRANSFERAPPLYBILL')
CREATE TABLE T_CAS_TRANSFERAPPLYBILL (
                                         FID BIGINT DEFAULT 0 NOT NULL,
                                         FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
                                         FBILLSTATUS NVARCHAR(5) DEFAULT ' ' NOT NULL,
                                         FCREATORID BIGINT DEFAULT 0 NOT NULL,
                                         FMODIFYERID BIGINT DEFAULT 0 NOT NULL,
                                         FAUDITORID BIGINT DEFAULT 0 NOT NULL,
                                         FAUDITDATE DATETIME,
                                         FMODIFYTIME DATETIME,
                                         FCREATETIME DATETIME,
                                         FAPPLYORGID BIGINT DEFAULT 0 NOT NULL,
                                         FAPPLYDATE DATETIME,
                                         FAPPLYCAUSE NVARCHAR(512) DEFAULT ' ' NOT NULL,
                                         FPAYCURRENCYID BIGINT DEFAULT 0 NOT NULL,
                                         FPAYEECURRENCYID BIGINT DEFAULT 0 NOT NULL,
                                         FEXRATETABLEID BIGINT DEFAULT 0 NOT NULL,
                                         FEXRATEDATE DATETIME,
                                         FEXRATERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
                                         FPAYEEAMOUT DECIMAL(19,6) DEFAULT 0 NOT NULL,
                                         FPAYAMOUT DECIMAL(19,6) DEFAULT 0 NOT NULL,
                                         FTRANSFERTYPE BIGINT DEFAULT 0 NOT NULL,
                                         FISDIFFCUR CHAR(1) DEFAULT '0' NOT NULL,
                                         FPAIDSTATUS NVARCHAR(5) DEFAULT ' ' NOT NULL,
                                         FFBACKBILLFLAG CHAR(1) DEFAULT '0' NOT NULL,
                                         FPARTPAY CHAR(1) DEFAULT '0' NOT NULL,
                                         FINVALIDFLAG CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_TRANSFERAPPLY_ENTRY')
CREATE TABLE T_CAS_TRANSFERAPPLY_ENTRY (
                                           FSEQ INT DEFAULT 0 NOT NULL,
                                           FID BIGINT DEFAULT 0 NOT NULL,
                                           FENTRYID BIGINT DEFAULT 0 NOT NULL,
                                           FPAYORGID BIGINT DEFAULT 0 NOT NULL,
                                           FRECBANKNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
                                           FUSAGE NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FPRIORITY NVARCHAR(25) DEFAULT ' ' NOT NULL,
                                           FPAYSTATUS NVARCHAR(25) DEFAULT ' ' NOT NULL,
                                           FSTATUSEXPLAIN NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FPAYDATE DATETIME,
                                           FPAYBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
                                           FEPAYEEAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
                                           FEPAYEETYPE NVARCHAR(100) DEFAULT ' ' NOT NULL,
                                           FEPAYEE BIGINT DEFAULT 0 NOT NULL,
                                           FEPAYEEID BIGINT DEFAULT 0 NOT NULL,
                                           FEPAYEENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FEPAYEEACCBANKID BIGINT DEFAULT 0 NOT NULL,
                                           FEPAYEEACCBANK BIGINT DEFAULT 0 NOT NULL,
                                           FEPAYEEACCBANKNUM NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FEPAYEEBANKID BIGINT DEFAULT 0 NOT NULL,
                                           FEUSERACCBANK BIGINT DEFAULT 0 NOT NULL,
                                           FSETTLETNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FEACCOUNTNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FSETTLEMENTTYPEID BIGINT DEFAULT 0 NOT NULL,
                                           FPAYERACCBANKID BIGINT DEFAULT 0 NOT NULL,
                                           FPAYERBANKID BIGINT DEFAULT 0 NOT NULL,
                                           FEACCTSHORT NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FBALANCE DECIMAL(19,6) DEFAULT 0 NOT NULL,
                                           FLASTMODIFYTIME DATETIME,
                                           FPAYMENTCHANNEL NVARCHAR(50) DEFAULT ' ' NOT NULL,
                                           FEXPECTDATE DATETIME,
                                           FBACKBILL CHAR(1) DEFAULT '0' NOT NULL,
                                           FRECSWIFTCODE NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FRECROUTINGNUM NVARCHAR(255) DEFAULT ' ' NOT NULL,
                                           FRECOTHERCODE NVARCHAR(255) DEFAULT ' ' NOT NULL
);



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