/**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_APPORTION_SUMMARY' AND KSQL_COL_NAME ='FYEAR') 
 ALTER TABLE T_TCCIT_APPORTION_SUMMARY ADD (FYEAR INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_BRANCH') 
 CREATE TABLE T_TCCIT_BRANCH (
FID BIGINT DEFAULT 0 NOT NULL,
FENDDATE DATETIME,
FSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FREGISTERTYPE BIGINT DEFAULT 0 NOT NULL,
FDECLARETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCODEANDNAME BIGINT DEFAULT 0 NOT NULL,
FACCOUNTINGSTANDARDS VARCHAR(30) DEFAULT ' ' NOT NULL,
FASSETS DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEMPLOYEESNUM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FILLEGAL CHAR(1) DEFAULT ' ' NOT NULL,
FINCOME1 CHAR(1) DEFAULT ' ' NOT NULL,
FINCOME2 CHAR(1) DEFAULT ' ' NOT NULL,
FINCOME3 CHAR(1) DEFAULT ' ' NOT NULL,
FINCOME4 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT1 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT2 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT3 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT4 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT5 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT6 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT7 CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCT8 CHAR(1) DEFAULT ' ' NOT NULL,
FASSET1 CHAR(1) DEFAULT ' ' NOT NULL,
FASSET2 CHAR(1) DEFAULT ' ' NOT NULL,
FASSET3 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER1 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER2 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER3 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER4 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER5 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER6 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER7 CHAR(1) DEFAULT ' ' NOT NULL,
FOTHER8 CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_BRANCH_DECLARE') 
 CREATE TABLE T_TCCIT_BRANCH_DECLARE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDECLAREID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_APITUDEINFO_F') 
 CREATE TABLE T_TCCIT_APITUDEINFO_F (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FAPITUDETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FEXPORTTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCOMPANYTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREDITRATING VARCHAR(30) DEFAULT ' ' NOT NULL,
FWORKERTOTAL BIGINT DEFAULT 0 NOT NULL,
FPROFITMYEAR VARCHAR(50) DEFAULT ' ' NOT NULL,
FANNUALCOME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOCIETYTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSOCIETYTOTAL BIGINT DEFAULT 0 NOT NULL,
FYXSY CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_BRANCH_PR_SUMMARY') 
 CREATE TABLE T_TCCIT_BRANCH_PR_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FBQFSE DECIMAL(23,10) DEFAULT 0 NOT NULL
);



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