/**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_POLICY_A' AND KSQL_COL_NAME ='FDEDUCT11') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FDEDUCT11 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 ='FDEDUCT12') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FDEDUCT12 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 ='FDEDUCT13') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FDEDUCT13 CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_B105019_DET') 
 CREATE TABLE T_TCCIT_DG_B105019_DET (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FSUBJECTID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FTABLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FENTRYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_B105019_SUM') 
 CREATE TABLE T_TCCIT_DG_B105019_SUM (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FZZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_B105020_DET') 
 CREATE TABLE T_TCCIT_DG_B105020_DET (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FSUBJECTID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FTABLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FENTRYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_B105020_SUM') 
 CREATE TABLE T_TCCIT_DG_B105020_SUM (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FZZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_B105021_DET') 
 CREATE TABLE T_TCCIT_DG_B105021_DET (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FSUBJECTID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FTABLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FENTRYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_B105021_SUM') 
 CREATE TABLE T_TCCIT_DG_B105021_SUM (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMYPKID BIGINT DEFAULT 0 NOT NULL,
FMYPARENTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_HIGH_TECH_DEVELOP') 
 CREATE TABLE T_TCCIT_HIGH_TECH_DEVELOP (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDEVELOPRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCURRYEAR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPRETWOYEAR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPRETHREEYEAR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDEVELOPTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_HIGH_TECH_INCOME') 
 CREATE TABLE T_TCCIT_HIGH_TECH_INCOME (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINCOMETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FINCOMERATE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_GYXJZ_ACC') 
 CREATE TABLE T_TCCIT_GYXJZ_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,
FYEAR DATETIME,
FSJZC DECIMAL(23,10) DEFAULT 0 NOT NULL,
FKCXE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAFTERONE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAFTERTWO DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAFTERTHREE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSYJZKKCJE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_HIGH_TECH_ACCOUNT') 
 CREATE TABLE T_TCCIT_HIGH_TECH_ACCOUNT (
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,
FYEAR DATETIME,
FMARK VARCHAR(50) DEFAULT ' ' NOT NULL,
FHIGHTECHSCOPE BIGINT DEFAULT 0 NOT NULL,
FPEOPLES BIGINT DEFAULT 0 NOT NULL,
FTOTALPEOPLES BIGINT DEFAULT 0 NOT NULL,
FPEOPLERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FKEYRATE1 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FKEYRATE2 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FKEYRATE3 DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_INVEST_CZ') 
 CREATE TABLE T_TCCIT_INVEST_CZ (
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,
FISALLDISPOSE 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_CZ_ENT') 
 CREATE TABLE T_TCCIT_INVEST_CZ_ENT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBUSINESSNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTRANSTYPE BIGINT DEFAULT 0 NOT NULL,
FBUSSIDATE DATETIME,
FTRANSPARTY VARCHAR(50) DEFAULT ' ' NOT NULL,
FTEXTFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FCZSYZJJRBNSYJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCZSSZBJHXJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZCCZSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQSHCZGXHLSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPCSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJSJC DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FASSETLOSSTYPE BIGINT DEFAULT 0 NOT NULL,
FSYCZTSXSWCL VARCHAR(50) DEFAULT ' ' NOT NULL,
FNOTE VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_GOVDEFER_MIDD') 
 CREATE TABLE T_TCCIT_GOVDEFER_MIDD (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FHTZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDNSDBZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJSDBZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDNJZSY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJJZSY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSYJZSYJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FGOVDEPARTMENT VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTINGMETHOD VARCHAR(50) DEFAULT ' ' NOT NULL,
FSUBSIDYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FLJSDBZAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJJZSYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSYWJZAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRELATEASSETCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FNOTE VARCHAR(255) DEFAULT ' ' NOT NULL,
FYEAR DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_NOTTACC_MIDD') 
 CREATE TABLE T_TCCIT_NOTTACC_MIDD (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FHTZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDNSSSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJSSSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJZZSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDNZZSR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSYJZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FINCOMETYPE BIGINT DEFAULT 0 NOT NULL,
FLJTAXINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJBOOKINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSYJZAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYEAR DATETIME
);



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