/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_COREBILL_SETTING')
 CREATE TABLE T_CAS_COREBILL_SETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) 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,
FFORMID NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBIZTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCLAIMOCCUPY CHAR(1) DEFAULT '0' NOT NULL,
FWRITEBACK CHAR(1) DEFAULT '0' NOT NULL,
FBACKAPPID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FBACKSERVICENAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBACKMETHODNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBACKKDTXNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBACKCLOUD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FRECBACKOBJECTID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FUNSETTLE CHAR(1) DEFAULT '0' NOT NULL,
FISPRESET CHAR(1) DEFAULT '0' NOT NULL,
FSETTLE CHAR(1) DEFAULT '0' NOT NULL,
FOCCUPYCLOUD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOCCUPYSERVICENAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOCCUPYMETHODNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOCCUPYSHOWOBJECTID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOCCUPYAPPID NVARCHAR(50) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_COREBILL_SETTING_OE')
 CREATE TABLE T_CAS_COREBILL_SETTING_OE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPARENTENTRYID BIGINT DEFAULT 0 NOT NULL,
FOCCUPYPARAMDES NVARCHAR(255) DEFAULT ' ' NOT NULL,
FOCCUPYPARAMTAG NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOCCUPYOBJPROPNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FOCCUPYPARAMTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOCCUPYLEVEL NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_COREBILL_SETTING_PE')
 CREATE TABLE T_CAS_COREBILL_SETTING_PE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FREPPARAMNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FREPTAG NVARCHAR(80) DEFAULT ' ' NOT NULL,
FREPQUERYFIELD NVARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_COREBILL_SETTING_QE')
 CREATE TABLE T_CAS_COREBILL_SETTING_QE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FREQPARAMTAG NVARCHAR(80) DEFAULT ' ' NOT NULL,
FREQBILLFIELDNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FREQBILLFIELDPROP NVARCHAR(80) DEFAULT ' ' NOT NULL,
FREQSOURCE NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_COREBILL_SETTING_RE')
 CREATE TABLE T_CAS_COREBILL_SETTING_RE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPARENTENTRYID BIGINT DEFAULT 0 NOT NULL,
FRECPARAMTAG NVARCHAR(80) DEFAULT ' ' NOT NULL,
FOBJPROPNAME NVARCHAR(250) DEFAULT ' ' NOT NULL,
FPARAMTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMDES NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLEVEL NVARCHAR(50) DEFAULT ' ' NOT NULL
);



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