--代发单付款日期升级 
update t_cas_agentpaybill a set fpaytime=(select distinct fbookdate from t_cas_bankjournal e where fsourcebilltype='cas_agentpaybill' and e.fsourcebillid=a.fid) where fpaytime is null and fid in (select fsourcebillid from t_cas_bankjournal where fsourcebilltype='cas_agentpaybill');

update t_cas_agentpaybill a set fpaytime=(select distinct fbookdate from t_cas_cashjournal e where fsourcebilltype='cas_agentpaybill' and e.fsourcebillid=a.fid) where fpaytime is null and fid in (select fsourcebillid from t_cas_cashjournal where fsourcebilltype='cas_agentpaybill');
