-- 清理申请单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CLRAPPLYBILL' AND KSQL_COL_NAME ='FCURRENCYID')
ALTER TABLE T_FA_CLRAPPLYBILL ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );

-- 清理申请单分录
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CLRAPPLYBILLENTRY' AND KSQL_COL_NAME ='FCLEARORIGINALVAL')
ALTER TABLE T_FA_CLRAPPLYBILLENTRY ADD (FCLEARORIGINALVAL DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CLRAPPLYBILLENTRY' AND KSQL_COL_NAME ='FCLEARACCUMDEPRE')
ALTER TABLE T_FA_CLRAPPLYBILLENTRY ADD (FCLEARACCUMDEPRE DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CLRAPPLYBILLENTRY' AND KSQL_COL_NAME ='FCLEARDECVAL')
ALTER TABLE T_FA_CLRAPPLYBILLENTRY ADD (FCLEARDECVAL DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CLRAPPLYBILLENTRY' AND KSQL_COL_NAME ='FCLEARPRERESIDUALVAL')
ALTER TABLE T_FA_CLRAPPLYBILLENTRY ADD (FCLEARPRERESIDUALVAL DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CLRAPPLYBILLENTRY' AND KSQL_COL_NAME ='FCLEARNETWORTH')
ALTER TABLE T_FA_CLRAPPLYBILLENTRY ADD (FCLEARNETWORTH DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CLRAPPLYBILLENTRY' AND KSQL_COL_NAME ='FCLEARNETAMOUNT')
ALTER TABLE T_FA_CLRAPPLYBILLENTRY ADD (FCLEARNETAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
