PageResults.java
1.3 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package com.w1hd.zzhnc.util;
import java.util.List;
/**
* 分页返回对象
*
* @author Administrator
*
* @param <T>
*/
public class PageResults<T> {
// 当前页
private int page;
// 总页数
private int total;
private int pageSize;
private int sum;
private String customfiled1;//自定义字段1
public String getCustomfiled1() {
return customfiled1;
}
public void setCustomfiled1(String customfiled1) {
this.customfiled1 = customfiled1;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
private int totalPages;
public int getTotalPages() {
totalPages = (total + pageSize - 1) / pageSize;
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
// 记录
private List<T> rows;
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public List<T> getRows() {
return rows;
}
public void setRows(List<T> rows) {
this.rows = rows;
}
public int getSum() {
return sum;
}
public void setSum(int sum) {
this.sum = sum;
}
}