/***合同台站分表 增加 甲方 甲方类型***/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CONTRACTBILL_S' AND KSQL_COL_NAME ='FPARTANEW')
ALTER TABLE T_ER_CONTRACTBILL_S ADD (FPARTANEW BIGINT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CONTRACTBILL_S' AND KSQL_COL_NAME ='FPARTATYPENEW')
ALTER TABLE T_ER_CONTRACTBILL_S ADD (FPARTATYPENEW VARCHAR(50) DEFAULT ' ' NOT NULL );

/****对公报销单、预付单、暂估单 关联合同分录增加 甲方 甲方类型***/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMCONTRACT' AND KSQL_COL_NAME ='FCONTRACTPARTANEW')
ALTER TABLE T_ER_PUBREIMCONTRACT ADD (FCONTRACTPARTANEW BIGINT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMCONTRACT' AND KSQL_COL_NAME ='FCONTRACTPARTATYPENEW')
ALTER TABLE T_ER_PUBREIMCONTRACT ADD (FCONTRACTPARTATYPENEW VARCHAR(50) DEFAULT ' ' NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_COSTESTIMATECONTRACT' AND KSQL_COL_NAME ='FCONTRACTPARTANEW')
ALTER TABLE T_ER_COSTESTIMATECONTRACT ADD (FCONTRACTPARTANEW BIGINT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_COSTESTIMATECONTRACT' AND KSQL_COL_NAME ='FCONTRACTPARTATYPENEW')
ALTER TABLE T_ER_COSTESTIMATECONTRACT ADD (FCONTRACTPARTATYPENEW VARCHAR(50) DEFAULT ' ' NOT NULL );



IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PREPAYCONTRACT' AND KSQL_COL_NAME ='FCONTRACTPARTANEW')
ALTER TABLE T_ER_PREPAYCONTRACT ADD (FCONTRACTPARTANEW BIGINT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PREPAYCONTRACT' AND KSQL_COL_NAME ='FCONTRACTPARTATYPENEW')
ALTER TABLE T_ER_PREPAYCONTRACT ADD (FCONTRACTPARTATYPENEW VARCHAR(50) DEFAULT ' ' NOT NULL );

















