分页 连接查询

public PageObject bookList(PageParameter req, Map args) {

  String sql = " select BID as ID,BNAME,BREMARK,BCOVER,USERNAME as CREATEDID,

TO_CHAR(CREATEDTIME,'YYYY-MM-DD HH24:MI:SS') as CREATEDTIME
 
 from tbbook b, tbuser u where b.CREATEDID = u.userid ";

  if (args.get("bname") != null 
            && ObjectUtils.toString(args.get("bname")).length() != 0) {

     sql += " and bname=:bname ";

  }
  sql += " order by b.createdtime asc ";

  return queryForSQLList(sql, req, args);
  
 }

 

你可能感兴趣的:(分页)