Commit b50749bd authored by 刘弈臻's avatar 刘弈臻

工具

parent 4bd4eafb
package com.govmade.common.utils;
import java.io.Serializable;
import java.util.List;
/**
* 树形数据分页工具类
*
* @author 刘弈臻
* @date 2018年8月14日
*/
public class PageTreeUtils implements Serializable{
private static final long serialVersionUID = 1L;
private int totalCount; // 总记录数
private int pageSize; // 每页记录数
private int totalPage; // 总页数
private int currPage; // 当前页数
private List<?> list; // 列表数据
/**
* 分页
*
* @param list
* 列表数据
* @param totalCount
* 总记录数
* @param pageSize
* 每页记录数
* @param currPage
* 当前页数
*/
public PageTreeUtils(List<?> list, int totalCount, int pageSize, int currPage) {
this.list = list;
this.totalCount = totalCount;
this.pageSize = pageSize;
this.currPage = currPage;
this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment