parent
be3f3dd55e
commit
4f2a32e733
|
|
@ -51,21 +51,11 @@ public class Constants
|
||||||
* 当前记录起始索引
|
* 当前记录起始索引
|
||||||
*/
|
*/
|
||||||
public static final String PAGE_NUM = "pageNum";
|
public static final String PAGE_NUM = "pageNum";
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前记录起始索引默认值
|
|
||||||
*/
|
|
||||||
public static final int PAGE_NUM_DEFAULT_VALUE = 1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每页显示记录数
|
* 每页显示记录数
|
||||||
*/
|
*/
|
||||||
public static final String PAGE_SIZE = "pageSize";
|
public static final String PAGE_SIZE = "pageSize";
|
||||||
|
|
||||||
/**
|
|
||||||
* 每页显示记录数默认值
|
|
||||||
*/
|
|
||||||
public static final int PAGE_SIZE_DEFAULT_VALUE = 10;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序列
|
* 排序列
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,11 @@ public class BaseController
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
Integer pageNum = pageDomain.getPageNum();
|
Integer pageNum = pageDomain.getPageNum();
|
||||||
Integer pageSize = pageDomain.getPageSize();
|
Integer pageSize = pageDomain.getPageSize();
|
||||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||||
PageHelper.startPage(pageNum, pageSize, orderBy);
|
{
|
||||||
|
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||||
|
PageHelper.startPage(pageNum, pageSize, orderBy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ public class TableSupport
|
||||||
public static PageDomain getPageDomain()
|
public static PageDomain getPageDomain()
|
||||||
{
|
{
|
||||||
PageDomain pageDomain = new PageDomain();
|
PageDomain pageDomain = new PageDomain();
|
||||||
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM, Constants.PAGE_NUM_DEFAULT_VALUE));
|
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
|
||||||
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE, Constants.PAGE_SIZE_DEFAULT_VALUE));
|
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
|
||||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
|
pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
|
||||||
pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
|
pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
|
||||||
return pageDomain;
|
return pageDomain;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue