select a.id as id,b.username as username,c.username as payto,a.amount as amount,a.trade_time as trade_time,d.explanation as explanation from trade_line a,user_info b,user_info c,trade_type d where a.id not in (select id from trade_line where rownum<={(curpage-1)*pagesize)} and trade_type like ‘{tradetype}’ and (user_id='{loginBean.getUserId()}' or payto_id='{loginBean.getUserId()}') and to_char(trade_time,'YYYYMMDD') between '{begindate}' and '{enddate}') and rownum<={pagesize} and a.trade_type like '{tradetype}' and (a.user_id='{loginBean.getUserId()}' or a.payto_id='{loginBean.getUserId()}') and to_char(a.trade_time,'YYYYMMDD') between '{begindate}' and '{enddate}' and a.user_id=b.user_id and a.payto_id=c.user_id and a.trade_type=d.trade_type order by a.id;
其中大括号内的是变量