/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
 EXEC p_AlterColumn 'T_TCCIT_APITUDEINFO_S', 'FCOMPANYTYPE', 'BIGINT', 'NOT NULL', '1111', '0';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_APITUDEINFO_S' AND KSQL_COL_NAME ='FPROFITTYPE') 
 ALTER TABLE T_TCCIT_APITUDEINFO_S ADD (FPROFITTYPE VARCHAR(30) DEFAULT ' ' NOT NULL );
 EXEC p_AlterColumn 'T_TCCIT_APITUDEINFO', 'FCOMPANYTYPE', 'BIGINT', 'NOT NULL', '1111', '0';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_APITUDEINFO' AND KSQL_COL_NAME ='FPROFITTYPE') 
 ALTER TABLE T_TCCIT_APITUDEINFO ADD (FPROFITTYPE VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_MBYQKS_ACC') 
 CREATE TABLE T_TCCIT_MBYQKS_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,
FHAPPENYEAR DATETIME,
FLOSSTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FLOSSQIYETYPE BIGINT DEFAULT 0 NOT NULL,
FYJJZNX BIGINT DEFAULT 0 NOT NULL,
FKSDQND DATETIME,
FLOSSMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJYDMBJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDESCRIBE VARCHAR(255) DEFAULT ' ' NOT NULL,
FLJMBZCKSJE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_MBYQKS_ENTRY') 
 CREATE TABLE T_TCCIT_MBYQKS_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMBND DATETIME,
FMBKSLX VARCHAR(50) DEFAULT ' ' NOT NULL,
FMBZCKSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREMARKS VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_A100000_4_SUM') 
 CREATE TABLE T_TCCIT_DG_A100000_4_SUM (
FID BIGINT DEFAULT 0 NOT NULL,
FNSTZHSD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJSDJM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FJSZRXMSDJM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTXMSDJM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLMHJNSD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_DG_B105060_SUM') 
 CREATE TABLE T_TCCIT_DG_B105060_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,
FBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FLOSSTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FLOSSQIYETYPE BIGINT DEFAULT 0 NOT NULL,
FYJJZNX BIGINT DEFAULT 0 NOT NULL,
FLOSSMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFLZCJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYMBKSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBNKMBKSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSYJNSDMB DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSYJWSDMB DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDNKJZYHNDKSJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FHAPPENYEAR BIGINT DEFAULT 0 NOT NULL,
FKSDQND BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SETZ_JMYHHZ') 
 CREATE TABLE T_TCCIT_SETZ_JMYHHZ (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDEDUCTIBLERATIO DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAMOUNTORRATIO DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMYPKID BIGINT DEFAULT 0 NOT NULL,
FMYPARENTID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FCANUSE CHAR(1) DEFAULT ' ' NOT NULL,
FQUALIFIED CHAR(1) DEFAULT ' ' NOT NULL,
FORIITEMNO VARCHAR(50) DEFAULT ' ' NOT NULL
);



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