地质所 沉降监测网建设项目
zmk
2024-05-16 6cc8b13ee47303a907f8e57b018406c46d8928e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.javaweb.common.core.page;
 
import com.javaweb.common.constant.Constants;
import com.javaweb.common.utils.ServletUtils;
 
/**
 * 表格数据处理
 * 
 * @author ruoyi
 */
public class TableSupport
{
    /**
     * 封装分页对象
     */
    public static PageDomain getPageDomain()
    {
        PageDomain pageDomain = new PageDomain();
        pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
        pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
        pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
        pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
        if(pageDomain.getPageNum()==null||pageDomain.getPageNum()==0){
            pageDomain.setPageNum(1);
        }
        if(pageDomain.getPageSize()==null||pageDomain.getPageSize()<=0){
            pageDomain.setPageSize(10);
        }
        return pageDomain;
    }
 
    public static PageDomain buildPageRequest()
    {
        return getPageDomain();
    }
}