--互换-已实现损益的类型为买入结算记账损益数据升级
update t_tbo_plinfo_entrys e set fbizbillvoucherpl = (select tt.fvoucherpl from t_tm_trade t,t_tm_trade_e tt,t_tbo_plinfo p  where e.fid=p.fid and t.fid=tt.fid and  t.fid=p.ftradebillid )
where fid in (select p.fid from t_tbo_plinfo p where p.ftradetypeid in (952722152971330560)) and fbiztype ='buysettle' and (fbizbillvoucherpl is null or fbizbillvoucherpl = 0)
and exists (select tt.fvoucherpl from t_tm_trade t,t_tm_trade_e tt,t_tbo_plinfo p
where t.fid=p.ftradebillid and e.fid=p.fid and t.fid=tt.fid and  tt.fvoucherpl is not null and tt.fvoucherpl !=0);


--互换-已实现损益的类型为非买入结算记账损益数据升级
update t_tbo_plinfo_entrys e set fbizbillvoucherpl = (select fvoucher_pl from t_tm_businessbill_e bs where e.fbizbillid =bs.fid )
where fid in (select p.fid from t_tbo_plinfo p where p.ftradetypeid in (952722152971330560)) and fbiztype !='buysettle' and (fbizbillvoucherpl is null or fbizbillvoucherpl = 0)
and exists (select fvoucher_pl from t_tm_businessbill_e bs where bs.fid=e.fbizbillid and  bs.fvoucher_pl is not null and bs.fvoucher_pl !=0);