IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_CASHJOURNAL' AND KSQL_COL_NAME IN ('FRPTYPEBASEID'))
 ALTER TABLE T_CAS_CASHJOURNAL ADD (FRPTYPEBASEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_CASHJOURNAL' AND KSQL_COL_NAME IN ('FRPBASETYPE'))
 ALTER TABLE T_CAS_CASHJOURNAL ADD (FRPBASETYPE NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BANKJOURNAL_E' AND KSQL_COL_NAME IN ('FRPTYPEBASEID'))
 ALTER TABLE T_CAS_BANKJOURNAL_E ADD (FRPTYPEBASEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BANKJOURNAL_E' AND KSQL_COL_NAME IN ('FRPBASETYPE'))
 ALTER TABLE T_CAS_BANKJOURNAL_E ADD (FRPBASETYPE NVARCHAR(100) DEFAULT ' ' NOT NULL );

-- 已有电子回单字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL' AND KSQL_COL_NAME IN ('FISGETRECEIPT')) 
 ALTER TABLE T_CAS_PAYMENTBILL ADD (FISGETRECEIPT CHAR(1) DEFAULT '0' NOT NULL );
