insert into t_tbo_plinfo_e(fid,fbuycurrencyid,fbuyamount,fsellcurrencyid,fsellamount,fswaptype)
    select  p.fid,t.fcurrencyid buycurrencyid,t.famount buyamount,e.freccurrencyid reccurrencyid,e.frecamount recamount,s.frateswaptype
    from t_tbo_plinfo p,t_tm_trade t ,t_tm_trade_s s,t_tm_trade_e e
    where p.ftradebillid = t.fid  and t.fid=e.fid and t.fid=s.fid and p.ftradetypeid =952722152971330560 and  NOT EXISTS (select fid from t_tbo_plinfo_e e  where e.fid=p.fid);


insert into t_tbo_plinfo_e(fid,fstandardcurrencyid,famount,fexrate)
    select ttp.fid, ttt.fcurrencyid,ttt.famount,tttr.fcontractrate
    from t_tbo_plinfo ttp, t_tm_trade ttt, t_tm_trade_r tttr
    where
    ttp.ftradetypeid = 941771935417643008 and ttp.ftradebillid = ttt.fid and ttt.fid = tttr.fid and ttt.fprotecttypeid = 941771935417643008
    and not exists (select fid from t_tbo_plinfo_e ttpe where ttpe.fid = ttp.fid);