/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_PREFERENTIAL_ITEM' AND KSQL_COL_NAME ='FLEVYTYPE') 
 ALTER TABLE T_TCCIT_PREFERENTIAL_ITEM ADD (FLEVYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_PROFITS_ITEMS' AND KSQL_COL_NAME ='FLEVYTYPE') 
 ALTER TABLE T_TCCIT_PROFITS_ITEMS ADD (FLEVYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_APPORTION_SJJT') 
 CREATE TABLE T_TCCIT_APPORTION_SJJT (
FID BIGINT DEFAULT 0 NOT NULL,
FROWNO BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FTAXORGID BIGINT DEFAULT 0 NOT NULL,
FTAXORGNAME1 VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXORGNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FUNIFIEDSOCIALCODE1 VARCHAR(50) DEFAULT ' ' NOT NULL,
FUNIFIEDSOCIALCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEMOLUMENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALASSETS DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_RECOUP_DEF_SJJT') 
 CREATE TABLE T_TCCIT_RECOUP_DEF_SJJT (
FID BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FITEM VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_YJ_QYYH_SUM_SJJT') 
 CREATE TABLE T_TCCIT_YJ_QYYH_SUM_SJJT (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO BIGINT DEFAULT 0 NOT NULL,
FCOMPANYTYPE BIGINT DEFAULT 0 NOT NULL,
FFTRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFTSDE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJMRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJMSE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FTAXORG BIGINT DEFAULT 0 NOT NULL,
FTAXORGNAME VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ZERORATING_SJJT') 
 CREATE TABLE T_TCCIT_ZERORATING_SJJT (
FID BIGINT DEFAULT 0 NOT NULL,
FSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FINCOMEDATE DATETIME,
FTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFISCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZERORATINGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCOMEREGAMMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAYREGAMMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBALANCEREGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZERORATINGINAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);



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