/**Begin D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_RDATA_CUSTSET' AND KSQL_COL_NAME ='FTEMPLATEID') 
 ALTER TABLE T_BCM_RDATA_CUSTSET ADD (FTEMPLATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_CHECKRECORDSUM') 
 CREATE TABLE T_BCM_CHECKRECORDSUM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FENTITYID BIGINT DEFAULT 0 NOT NULL,
FCHECKTMPL BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT '1' NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FPROCESSID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FCVTDIFMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FOPENTITYID BIGINT DEFAULT 0 NOT NULL,
FMYENTITYID BIGINT DEFAULT 0 NOT NULL,
FMYCVTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FOPCVTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISAUTOELIM CHAR(1) DEFAULT '0' NOT NULL,
FCREATETYPE CHAR(1) DEFAULT '0' NOT NULL,
FMARK NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_CHECKRECORDSUMENT') 
 CREATE TABLE T_BCM_CHECKRECORDSUMENT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHECKTMPLENTRYID BIGINT DEFAULT 0 NOT NULL,
FELIMMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCVTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISDIFFITEM CHAR(1) DEFAULT '0' NOT NULL,
FISMYDATA CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_CHECKRECORDLINK') 
 CREATE TABLE T_BCM_CHECKRECORDLINK (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FCHECKRECORDSUMID BIGINT DEFAULT 0 NOT NULL,
FCHECKRECORDID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
