/**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_ASSETS_LOSS_DET') 
 CREATE TABLE T_TCCIT_ASSETS_LOSS_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,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_ASSETS_LOSS_SUM') 
 CREATE TABLE T_TCCIT_ASSETS_LOSS_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,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FZZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCOMESUM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDISPOSALINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDAMAGESINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FASSETSBASE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORIGINAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMDEPRECIATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FABNORMALINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FASSETSLOSSAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNSTZJE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_NEW_INVEST_ASSET') 
 CREATE TABLE T_TCCIT_NEW_INVEST_ASSET (
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,
FTAXPAYERID VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSETTYPE BIGINT DEFAULT 0 NOT NULL,
FINVESTTYPE BIGINT DEFAULT 0 NOT NULL,
FASSETSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FDESC VARCHAR(50) DEFAULT ' ' NOT NULL,
FLJTZCBRZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJJYSF DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJJSJC DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_NEW_INVEST_DETAIL') 
 CREATE TABLE T_TCCIT_NEW_INVEST_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSPTAXTREETMENT VARCHAR(50) DEFAULT ' ' NOT NULL,
FQUANTITY VARCHAR(50) DEFAULT ' ' NOT NULL,
FACCOUNTINGDOC VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATE DATETIME,
FTZCBRZJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTRADETAXFEE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXBASE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPRICEFORM VARCHAR(50) DEFAULT ' ' NOT NULL,
FNOTE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_HJZCZJTX_ACCOUNT') 
 CREATE TABLE T_TCCIT_HJZCZJTX_ACCOUNT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FASSETSNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSETSNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FPOSTINGDATE DATETIME,
FBUYTIME DATETIME,
FGLQTNSTZSX VARCHAR(50) DEFAULT ' ' NOT NULL,
FYFXCDWXZC CHAR(1) DEFAULT ' ' NOT NULL,
FTAXASSETSTYPE BIGINT DEFAULT 0 NOT NULL,
FZZCTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FJSZJTXLX BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_HJZCZJTX_ACCOUNT_L') 
 CREATE TABLE T_TCCIT_HJZCZJTX_ACCOUNT_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL
);



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