/**
* 把原来没有分页的sql转换成有分页的sql
*
* @param noPageSql
* @return
*/
public String getOraclePageSql(String noPageSql) {
return "select * from ( select row_.*, rownum rownum_ from ( "+ noPageSql + " ) row_ where rownum <= ?) where rownum_ > ?";
}
/**
* 获得分页的总数
* @param strNoPageSql
* @return
*/
public String getPageSizeSql(String strNoPageSql,int intPageSize){
return "select decode(mod(count(*),"+intPageSize+"),0,count(*)/"+intPageSize+",trunc(count(*)/"+intPageSize+",0)+1) as pages from ("+strNoPageSql+")";
}