Page.java
1.4 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
package com.espeed.reading.util;
/**
*
* @项目名称: 邮件跟踪系统
* @版权所有: 深圳市科飞时速网络技术有限公司(0755-88843776)
* @技术支持: info@21gmail.com
* @单元名称: 分页实体类
* @开始时间: 2017-10-16
* @开发人员: 杨志钊
*/
public class Page {
private Integer currentPage = 1;// 当前页
private Integer pageSize = 10;// 每页量
private Integer start;// 分页开始记录条数
private Long totalRecord;// 总记录数
private Integer totalPage;// 总页数
public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getStart() {
return start;
}
public void setStart(Integer start) {
this.start = start;
}
public Long getTotalRecord() {
return totalRecord;
}
public void setTotalRecord(Long totalRecord) {
if (totalRecord != null) {
this.start = (this.currentPage - 1) * this.pageSize;
this.totalPage = (int) ((totalRecord % this.pageSize) == 0 ? (totalRecord / this.pageSize)
: (totalRecord / this.pageSize) + 1);
}
this.totalRecord = totalRecord;
}
public Integer getTotalPage() {
return totalPage;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
}