/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_BALANCEMODEL_CASH')
 CREATE TABLE T_CAS_BALANCEMODEL_CASH (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FMONTHSTART DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMONTHBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREVENUEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTROKE BIGINT DEFAULT 0 NOT NULL,
FENDDATE DATETIME,
FISUPGRADE CHAR(1) DEFAULT '0' NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FMONTH BIGINT DEFAULT 0 NOT NULL,
FISRESET CHAR(1) DEFAULT '0' NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_BALANCEMODEL_JOURNA')
 CREATE TABLE T_CAS_BALANCEMODEL_JOURNA (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FMONTHSTART DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMONTHBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREVENUEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTROKE BIGINT DEFAULT 0 NOT NULL,
FENDDATE DATETIME,
FISUPGRADE CHAR(1) DEFAULT '0' NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FMONTH BIGINT DEFAULT 0 NOT NULL,
FISRESET CHAR(1) DEFAULT '0' NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_BALANCEMODEL_STATE')
 CREATE TABLE T_CAS_BALANCEMODEL_STATE (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FMONTHSTART DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMONTHBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREVENUEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTROKE BIGINT DEFAULT 0 NOT NULL,
FENDDATE DATETIME,
FISUPGRADE CHAR(1) DEFAULT '0' NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FMONTH BIGINT DEFAULT 0 NOT NULL,
FISRESET CHAR(1) DEFAULT '0' NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL
);



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