--代发单单数据升级
INSERT INTO t_cas_agentpaybill_e(FID)
SELECT FID FROM t_cas_agentpaybill A WHERE NOT EXISTS 
(SELECT FID FROM t_cas_agentpaybill_e B WHERE A.FID = B.FID);

--升级代发单、付款单支付渠道
update t_cas_agentpaybill_e set fpaymentchannel='bei' where fid in ( select fid from t_cas_agentpaybill where FIsCommitBE='1');
update t_cas_paymentbill_e set fpaymentchannel='bei' where fid in ( select fid from t_cas_paymentbill where FIsCommitBE='1');

update t_cas_agentpaybill_e set fpaymentchannel='onlinebank' where fpaymentchannel is null or fpaymentchannel=' ';
update t_cas_paymentbill_e set fpaymentchannel='onlinebank' where fpaymentchannel is null or fpaymentchannel=' ';