All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jeesuite.mybatis.plugin.pagination.Page Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.jeesuite.mybatis.plugin.pagination;

import java.util.ArrayList;
import java.util.List;

public class Page extends PageParams{

    //总记录数
    private long total;
    //总页数
    private int pages;
    //结果集
    private List data;
     
	public Page() {}
	
	public Page(PageParams pageParams,long total, List data) {
		setPageNo(pageParams.getPageNo());
		setPageSize(pageParams.getPageSize());
		this.total = total;
		this.data = data;
		this.pages = (int) ((this.total / this.getPageSize()) + (this.total % this.getPageSize() == 0 ? 0 : 1));
	}



	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public int getPages() {
		return pages;
	}
	public void setPages(int pages) {
		this.pages = pages;
	}
	public List getData() {
		return data == null ? (data = new ArrayList<>()) : data;
	}
	public void setData(List data) {
		this.data = data;
	}
    
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy