/**Begin C:\anzhuang\PDM_UPGRADE\PDM1\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_VER_XFS' AND KSQL_COL_NAME ='FENABLE') 
 ALTER TABLE T_TCTB_TAX_VER_XFS ADD (FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_VER_YHS' AND KSQL_COL_NAME ='FENABLE') 
 ALTER TABLE T_TCTB_TAX_VER_YHS ADD (FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_HJBHS') 
 CREATE TABLE T_TCTB_TAX_VER_HJBHS (
FID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FVER BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCSHYGC CHAR(1) DEFAULT '0' NOT NULL,
FACSB CHAR(1) DEFAULT '0' NOT NULL,
FCXWSJZCLCS CHAR(1) DEFAULT '0' NOT NULL,
FSHLJJZCLCS CHAR(1) DEFAULT '0' NOT NULL,
FPOLLUTANTTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_HJBHS_E') 
 CREATE TABLE T_TCTB_TAX_VER_HJBHS_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FREMARK VARCHAR(400) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_QTSF') 
 CREATE TABLE T_TCTB_TAX_VER_QTSF (
FID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FVER BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TAX_VER_QTSF_E') 
 CREATE TABLE T_TCTB_TAX_VER_QTSF_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCOLLECTRATE BIGINT DEFAULT 0 NOT NULL,
FCOLLECTITEM BIGINT DEFAULT 0 NOT NULL,
FTAXPERIOD VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNTRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEFFECTIVESTART DATETIME,
FEFFECTIVEEND DATETIME,
FCOLLECTSUBRATE VARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End C:\anzhuang\PDM_UPGRADE\PDM1\TCTB_table.sql **/
