提交 | 用户 | 时间
|
fd2207
|
1 |
package com.jcdm.common.core.page; |
懒 |
2 |
|
|
3 |
import com.jcdm.common.utils.StringUtils; |
|
4 |
|
|
5 |
/** |
|
6 |
* 分页数据 |
|
7 |
* |
|
8 |
* @author jc |
|
9 |
*/ |
|
10 |
public class PageDomain |
|
11 |
{ |
|
12 |
/** 当前记录起始索引 */ |
|
13 |
private Integer pageNum; |
|
14 |
|
|
15 |
/** 每页显示记录数 */ |
|
16 |
private Integer pageSize; |
|
17 |
|
|
18 |
/** 排序列 */ |
|
19 |
private String orderByColumn; |
|
20 |
|
|
21 |
/** 排序的方向desc或者asc */ |
|
22 |
private String isAsc = "asc"; |
|
23 |
|
|
24 |
/** 分页参数合理化 */ |
|
25 |
private Boolean reasonable = true; |
|
26 |
|
|
27 |
public String getOrderBy() |
|
28 |
{ |
|
29 |
if (StringUtils.isEmpty(orderByColumn)) |
|
30 |
{ |
|
31 |
return ""; |
|
32 |
} |
|
33 |
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; |
|
34 |
} |
|
35 |
|
|
36 |
public Integer getPageNum() |
|
37 |
{ |
|
38 |
return pageNum; |
|
39 |
} |
|
40 |
|
|
41 |
public void setPageNum(Integer pageNum) |
|
42 |
{ |
|
43 |
this.pageNum = pageNum; |
|
44 |
} |
|
45 |
|
|
46 |
public Integer getPageSize() |
|
47 |
{ |
|
48 |
return pageSize; |
|
49 |
} |
|
50 |
|
|
51 |
public void setPageSize(Integer pageSize) |
|
52 |
{ |
|
53 |
this.pageSize = pageSize; |
|
54 |
} |
|
55 |
|
|
56 |
public String getOrderByColumn() |
|
57 |
{ |
|
58 |
return orderByColumn; |
|
59 |
} |
|
60 |
|
|
61 |
public void setOrderByColumn(String orderByColumn) |
|
62 |
{ |
|
63 |
this.orderByColumn = orderByColumn; |
|
64 |
} |
|
65 |
|
|
66 |
public String getIsAsc() |
|
67 |
{ |
|
68 |
return isAsc; |
|
69 |
} |
|
70 |
|
|
71 |
public void setIsAsc(String isAsc) |
|
72 |
{ |
|
73 |
if (StringUtils.isNotEmpty(isAsc)) |
|
74 |
{ |
|
75 |
// 兼容前端排序类型 |
|
76 |
if ("ascending".equals(isAsc)) |
|
77 |
{ |
|
78 |
isAsc = "asc"; |
|
79 |
} |
|
80 |
else if ("descending".equals(isAsc)) |
|
81 |
{ |
|
82 |
isAsc = "desc"; |
|
83 |
} |
|
84 |
this.isAsc = isAsc; |
|
85 |
} |
|
86 |
} |
|
87 |
|
|
88 |
public Boolean getReasonable() |
|
89 |
{ |
|
90 |
if (StringUtils.isNull(reasonable)) |
|
91 |
{ |
|
92 |
return Boolean.TRUE; |
|
93 |
} |
|
94 |
return reasonable; |
|
95 |
} |
|
96 |
|
|
97 |
public void setReasonable(Boolean reasonable) |
|
98 |
{ |
|
99 |
this.reasonable = reasonable; |
|
100 |
} |
|
101 |
} |