/**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_YEAR_RULE' AND KSQL_COL_NAME ='FITEMTYPE') 
 ALTER TABLE T_TCCIT_YEAR_RULE ADD (FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_POLICY_A' AND KSQL_COL_NAME ='FINCOME10') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FINCOME10 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 ='FYHSX3') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FYHSX3 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 ='FYHSX4') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FYHSX4 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 ='FACCOUNTCRITERION') 
 ALTER TABLE T_TCCIT_POLICY_A ADD (FACCOUNTCRITERION BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_INVEST_CYSY') 
 CREATE TABLE T_TCCIT_INVEST_CYSY (
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,
FASSETSTATUS 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_CYSY_ENT') 
 CREATE TABLE T_TCCIT_INVEST_CYSY_ENT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBIZNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCYSYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSFSJMS VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZDATE DATETIME,
FQRSRJE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMSSRJE DECIMAL(23,10),
FNOTE VARCHAR(255) DEFAULT ' ' NOT NULL,
FSWKJQRSR VARCHAR(50) DEFAULT ' ' NOT NULL
);



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