/**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_BALANCE_REG') 
 CREATE TABLE T_TCCIT_BALANCE_REG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBALANCEREGDATE DATETIME,
FBALANCEREGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBALANCEREGVOUCHER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBALANCEREGDESC VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_FINANCIAL_REG') 
 CREATE TABLE T_TCCIT_FINANCIAL_REG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFINANCIALREGDATE DATETIME,
FFINANCIALREGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINANCIALREGVOUCHER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFINANCIALREGDESC VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_IN_INCOME_REG') 
 CREATE TABLE T_TCCIT_IN_INCOME_REG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINCOMEREGDATE DATETIME,
FINCOMEREGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCOMEREGVOUCHER VARCHAR(50) DEFAULT ' ' NOT NULL,
FINCOMEREGDESC VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_PAY_REG') 
 CREATE TABLE T_TCCIT_PAY_REG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPAYREGDATE DATETIME,
FPAYREGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAYREGVOUCHER VARCHAR(50) DEFAULT ' ' NOT NULL,
FPAYREGDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FPAYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FREFCARDNO VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ZERO_RATING_INOUT') 
 CREATE TABLE T_TCCIT_ZERO_RATING_INOUT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FINCOMEDATE DATETIME,
FTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFISCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZERORATINGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBIZDESC VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROJECTNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROJECTNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FGOVNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSUMREGISTERINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMREGISTERPAY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMFINANCIAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMINCLUDEDTAXABLE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBALANCEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A105090' AND KSQL_COL_NAME ='FZCHXJE') 
 ALTER TABLE T_TCCIT_QYSDS_A105090 ADD (FZCHXJE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FYYLR') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FYYLR DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FFTKCCBFY') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FFTKCCBFY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FNSTZE') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FNSTZE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FNSTZHSD') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FNSTZHSD DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FJWSDSE') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FJWSDSE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FDYDGXSD') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FDYDGXSD DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FGXJWSDSE') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FGXJWSDSE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A108010' AND KSQL_COL_NAME ='FJWMSSDXJ') 
 ALTER TABLE T_TCCIT_QYSDS_A108010 ADD (FJWMSSDXJ DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A107040' AND KSQL_COL_NAME ='FGRCGBL') 
 ALTER TABLE T_TCCIT_QYSDS_A107040 ADD (FGRCGBL DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A107040' AND KSQL_COL_NAME ='FZYYWSRZB') 
 ALTER TABLE T_TCCIT_QYSDS_A107040 ADD (FZYYWSRZB DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A106000' AND KSQL_COL_NAME ='FNXBN') 
 ALTER TABLE T_TCCIT_QYSDS_A106000 ADD (FNXBN DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_QYSDS_A105000_B') 
 CREATE TABLE T_TCCIT_QYSDS_A105000_B (
FID BIGINT DEFAULT 0 NOT NULL,
FBXBZJJ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBXZBJ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYFSPKZBJ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZQHYZBJ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQHHYZBJ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDBJGZBJ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FXEDKZBJ DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_QYSDS_A105120_DK') 
 CREATE TABLE T_TCCIT_QYSDS_A105120_DK (
FID BIGINT DEFAULT 0 NOT NULL,
FEWBLXH VARCHAR(50) DEFAULT ' ' NOT NULL,
FEWBLNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSBBID VARCHAR(50) DEFAULT ' ' NOT NULL,
FSNMDKYE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBNMDKYE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSNMSSZBJYE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBNMSSZBJYE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSNMDKZCYE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBNMDKZCYE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJTBL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJSZBJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDKSSZBJYE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDKSSZBJ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNSTZJE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A107042' AND KSQL_COL_NAME ='FSSYH') 
 ALTER TABLE T_TCCIT_QYSDS_A107042 ADD (FSSYH VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A107042_BA' AND KSQL_COL_NAME ='FSYYHZC') 
 ALTER TABLE T_TCCIT_QYSDS_A107042_BA ADD (FSYYHZC VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A000000' AND KSQL_COL_NAME ='FHNMYGTZXX') 
 ALTER TABLE T_TCCIT_QYSDS_A000000 ADD (FHNMYGTZXX VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_INVEST_ASSET_JZBD') 
 CREATE TABLE T_TCCIT_INVEST_ASSET_JZBD (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME BIGINT DEFAULT 0 NOT NULL,
FASSETTYPE BIGINT DEFAULT 0 NOT NULL,
FINVESTTYPE BIGINT DEFAULT 0 NOT NULL,
FASSETSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FDESC VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_INVEST_JZBD_XX') 
 CREATE TABLE T_TCCIT_INVEST_JZBD_XX (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FJZBDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBOOKEDTIME DATETIME,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDQWJRSYDJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOTE VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ASSET_LOSS_PT_B') 
 CREATE TABLE T_TCCIT_ASSET_LOSS_PT_B (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ASSET_LOSS_PT') 
 CREATE TABLE T_TCCIT_ASSET_LOSS_PT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FZCSYZZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCLEANUPDATE DATETIME,
FBADDEBTDOCNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSETQUANTIY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCLEANUPQUANTITY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNIT BIGINT DEFAULT 0 NOT NULL,
FNOTE VARCHAR(255) DEFAULT ' ' NOT NULL,
FASSETORIGIN DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCLEANUPINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCLEANUPFEE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOMPENSATEINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFZCSSJXZC DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJSWZJTXE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJJSZJTXE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZCSYSSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTEMPDIFFER CHAR(1) DEFAULT ' ' NOT NULL,
FRECORDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSETLOSSTYPE BIGINT DEFAULT 0 NOT NULL,
FZCSSZBJHX DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_GETRE_DETAIL') 
 CREATE TABLE T_TCCIT_GETRE_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FYEAR DATETIME,
FDNYHBL VARCHAR(50) DEFAULT ' ' NOT NULL,
FINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOST DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRELAXTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPERIODCOST DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDIVIDESCALE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQJFYFTE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FXMSDE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSONREMARKS VARCHAR(1000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_GETREDUCE_ACC') 
 CREATE TABLE T_TCCIT_GETREDUCE_ACC (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTNAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FREDUCENAME BIGINT DEFAULT 0 NOT NULL,
FFIRSTYEAR DATETIME,
FREMARKS VARCHAR(1000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ZERO_RATING_ENTRY') 
 CREATE TABLE T_TCCIT_ZERO_RATING_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FINCOMEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEXPENSINGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBALANCEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINANCIALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCLUDEDTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ZERO_RATING_MIDD') 
 CREATE TABLE T_TCCIT_ZERO_RATING_MIDD (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FINCOMEDATE DATETIME,
FBIZNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFISCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZERORATINGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FINCOMEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMINCOMEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEXPENSINGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINANCIALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMFINANCIALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCLUDEDTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMINCLUDEDTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBALANCEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ZERO_RATING_SUM') 
 CREATE TABLE T_TCCIT_ZERO_RATING_SUM (
FID BIGINT DEFAULT 0 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,
FINCOMEDATEYEAR BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_ASSETS_LOSS_SUM' AND KSQL_COL_NAME ='FRESERVEVERIFY') 
 ALTER TABLE T_TCCIT_ASSETS_LOSS_SUM ADD (FRESERVEVERIFY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_GETREDU_SUM') 
 CREATE TABLE T_TCCIT_GETREDU_SUM (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FREDUCENAME BIGINT DEFAULT 0 NOT NULL,
FINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOST DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRELAXTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQJFYFTE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FXMSDE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEAR DATETIME,
FQZMSSD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQZJBSD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJMSDE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDNYHBL VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROJECTNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSHEETNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FYHSXMC VARCHAR(50) DEFAULT ' ' NOT NULL,
FYHFS VARCHAR(50) DEFAULT ' ' NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_POLICY_A' AND KSQL_COL_NAME ='FINCOME9') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FINCOME9 CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_POLICY_A' AND KSQL_COL_NAME ='FYHSX1') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FYHSX1 CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_POLICY_A' AND KSQL_COL_NAME ='FYHSX2') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FYHSX2 CHAR(1) DEFAULT ' ' NOT NULL );

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