/**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_DEDUCT_OTHER_DET') 
 CREATE TABLE T_TCCIT_DEDUCT_OTHER_DET (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FTAXORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FBIZNAME VARCHAR(50) 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(255) 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 '0' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A100000' AND KSQL_COL_NAME ='FSHARETYPE') 
 ALTER TABLE T_TCCIT_QYSDS_A100000 ADD (FSHARETYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A100000' AND KSQL_COL_NAME ='FJZFD') 
 ALTER TABLE T_TCCIT_QYSDS_A100000 ADD (FJZFD DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A100000' AND KSQL_COL_NAME ='FJZJE') 
 ALTER TABLE T_TCCIT_QYSDS_A100000 ADD (FJZJE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A100000' AND KSQL_COL_NAME ='FBNSJYBTSDSE') 
 ALTER TABLE T_TCCIT_QYSDS_A100000 ADD (FBNSJYBTSDSE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A109000' AND KSQL_COL_NAME ='FZJGYXSMZDFYHJE') 
 ALTER TABLE T_TCCIT_QYSDS_A109000 ADD (FZJGYXSMZDFYHJE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A109000' AND KSQL_COL_NAME ='FZJGQNLJYXSMZDFYHJE') 
 ALTER TABLE T_TCCIT_QYSDS_A109000 ADD (FZJGQNLJYXSMZDFYHJE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A109000' AND KSQL_COL_NAME ='FZJGYMZDFYHTZFPJE') 
 ALTER TABLE T_TCCIT_QYSDS_A109000 ADD (FZJGYMZDFYHTZFPJE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A109000' AND KSQL_COL_NAME ='FZJGBNSJYBTSDSE') 
 ALTER TABLE T_TCCIT_QYSDS_A109000 ADD (FZJGBNSJYBTSDSE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A107010' AND KSQL_COL_NAME ='FJJKCBL') 
 ALTER TABLE T_TCCIT_QYSDS_A107010 ADD (FJJKCBL DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A000000' AND KSQL_COL_NAME ='FDEVSTYLE') 
 ALTER TABLE T_TCCIT_QYSDS_A000000 ADD (FDEVSTYLE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_QYSDS_A107042' AND KSQL_COL_NAME ='FISSELECT') 
 ALTER TABLE T_TCCIT_QYSDS_A107042 ADD (FISSELECT CHAR(1) DEFAULT '0' NOT NULL );

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