分页对象
package com.gzw.util.page;
public class PageRequest {
private Integer currentPage;
private Integer pageSize;
private Integer index;
public Integer getCurrentPage() {
return currentPage == null ? 1 : currentPage;
}
public Integer getIndex(){
return ((this.currentPage == null ? 1 : this.currentPage)-1) * this.pageSize;
}
public void setCurrentPage(Integer page) {
this.currentPage = page;
}
public Integer getPageSize() {
return pageSize == null ? 10 : pageSize;
}
public void setPageSize(Integer limit) {
this.pageSize = limit;
}
}
- 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
分页使用
LIMIT #{index},#{pageSize}