-- 火车订单添加 下载地址 内部下载地址 火车票车票号
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINBILL' AND KSQL_COL_NAME ='FDOWNLOADLINK')
 ALTER TABLE T_ER_TRAINBILL ADD (FDOWNLOADLINK VARCHAR(500) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINBILL' AND KSQL_COL_NAME ='FKDDOWNLOADLINK')
ALTER TABLE T_ER_TRAINBILL ADD (FKDDOWNLOADLINK VARCHAR(500) DEFAULT ' ' NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINBILL' AND KSQL_COL_NAME ='FTRAINTICKETNUM')
ALTER TABLE T_ER_TRAINBILL ADD (FTRAINTICKETNUM VARCHAR(255) DEFAULT ' ' NOT NULL);

-- 火车结算单添加 下载地址 内部下载地址 火车票车票号字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINCHECKINGBILL' AND KSQL_COL_NAME ='FDOWNLOADLINK')
 ALTER TABLE T_ER_TRAINCHECKINGBILL ADD (FDOWNLOADLINK VARCHAR(500) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINCHECKINGBILL' AND KSQL_COL_NAME ='FKDDOWNLOADLINK')
ALTER TABLE T_ER_TRAINCHECKINGBILL ADD (FKDDOWNLOADLINK VARCHAR(500) DEFAULT ' ' NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINCHECKINGBILL' AND KSQL_COL_NAME ='FTRAINTICKETNUM')
ALTER TABLE T_ER_TRAINCHECKINGBILL ADD (FTRAINTICKETNUM VARCHAR(255) DEFAULT ' ' NOT NULL);

-- 商旅付款申请单添加 月结账单编号 发票号码字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGPAYENTRY' AND KSQL_COL_NAME ='FCHECKINGBILLNO')
ALTER TABLE T_ER_CHECKINGPAYENTRY ADD (FCHECKINGBILLNO VARCHAR(255) DEFAULT ' ' NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGPAYENTRY' AND KSQL_COL_NAME ='FINVOICENUM')
ALTER TABLE T_ER_CHECKINGPAYENTRY ADD (FINVOICENUM VARCHAR(255) DEFAULT ' ' NOT NULL);


