📄 pagination.java
字号:
package org.common.util;
import java.util.ArrayList;
import java.util.List;
//分页
public class Pagination<T> implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 类名:PageBean
* 描述:用于分页显示的 JavaBean
*/
public Pagination() {
}
public int queryPageNo=1; // 请求的页号
public int rowsPerPage = 10; // 每页的行数
public int totalPage; // 总页数
public int totalRows; // 总行数
public List<T> resultList=new ArrayList<T>(0);//结果
public int getQueryPageNo() {
return queryPageNo;
}
public int getTotalPage() {
//根据总行数计算总页数
if(this.totalRows%this.rowsPerPage==0)
this.totalPage=this.totalRows/this.rowsPerPage;
else
this.totalPage=this.totalRows/this.rowsPerPage+1;
return totalPage;
}
public int getTotalRows() {
return totalRows;
}
public int getRowsPerPage() {
return rowsPerPage;
}
public void setQueryPageNo(int queryPageNo) {
this.queryPageNo = queryPageNo;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public void setRowsPerPage(int rowsPerPage) {
this.rowsPerPage = rowsPerPage;
}
public List getResultList() {
return resultList;
}
@SuppressWarnings("unchecked")
public void setResultList(List resultList) {
this.resultList = resultList;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -