/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SEASONAL_DG_BILL') 
 CREATE TABLE T_TCCIT_SEASONAL_DG_BILL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPROFITAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBQYBTSE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_YEAR_DG_BILL') 
 CREATE TABLE T_TCCIT_YEAR_DG_BILL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMPAYTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBNYBTSDSE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_DG_B105037_SUM' AND KSQL_COL_NAME ='FLABEL') 
 ALTER TABLE T_TCCIT_DG_B105037_SUM ADD (FLABEL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_INVEST_CZ_ENT' AND KSQL_COL_NAME ='FJYFSFWGLF') 
 ALTER TABLE T_TCCIT_INVEST_CZ_ENT ADD (FJYFSFWGLF VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_INVEST_CZ_ENT' AND KSQL_COL_NAME ='FTSXSWCLSSJE') 
 ALTER TABLE T_TCCIT_INVEST_CZ_ENT ADD (FTSXSWCLSSJE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_INVEST_CZ_ENT' AND KSQL_COL_NAME ='FCZSL') 
 ALTER TABLE T_TCCIT_INVEST_CZ_ENT ADD (FCZSL DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SEASONAL_CALC_DET') 
 CREATE TABLE T_TCCIT_SEASONAL_CALC_DET (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSUMAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMYPKID BIGINT DEFAULT 0 NOT NULL,
FMYPARENTID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
