IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_INTEREST_DETAIL') 
 CREATE TABLE T_FA_INTEREST_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) 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,
FORGID BIGINT DEFAULT 0 NOT NULL,
FLEASECONTRACTID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_INTEREST_DETAIL_E') 
 CREATE TABLE T_FA_INTEREST_DETAIL_E (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDATE DATETIME,
FBEGINBALANCE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FLEASELIABPAY DECIMAL(19,4) DEFAULT 0 NOT NULL,
FLEASELIABINT DECIMAL(19,4) DEFAULT 0 NOT NULL,
FENDBALANCE DECIMAL(19,4) DEFAULT 0 NOT NULL
);