	package com.iamberry.wechat.core.entity.drp;


public class PageBeanEarningLogs implements java.io.Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2538758270678877235L;
	private int count;      //记录总数
	private int pageSize;   //每一页的记录数
	private int pageNumber;  //页码
	private int pageCount;   //总页数
	private int recordBegin ; //查询的开始记录数
	
	private Object condition;
	
	public PageBeanEarningLogs(){
		
	}
	
	public PageBeanEarningLogs(int count,int pageSize,int recordBegin){
		this.count=count;
		this.pageSize=pageSize;
		this.recordBegin=recordBegin;
	}
	
	public void init(int count,int pageSize,int pageNumber){
		this.count=count;
		this.pageSize=pageSize;
		this.pageNumber=pageNumber;
		initRecordBegin();
	}
	
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public int getPageSize() {
		if(pageSize==0) return 6;
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getPageNumber() {
		if(this.pageNumber==0)
			this.pageNumber=1;
		return pageNumber;
	}
	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}
	public int getPageCount() {
		if(pageSize>0 && count>0 ){
			this.pageCount=(int) Math.ceil((double)count/pageSize);
		}else{
			this.pageCount=0;
		}
		return pageCount;
	}
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}
	public int getRecordBegin() {
		return recordBegin;
	}
	public void setRecordBegin(int recordBegin) {
		this.recordBegin = recordBegin;
	}
	/**
	 * @decription 初始化分页查询的开始记录数
	 */
	public void initRecordBegin(){
		if(pageNumber==1) this.recordBegin = 0;
		if(pageNumber>1){
			this.recordBegin=this.getPageSize()*(this.pageNumber-1);
		}
	}
	
	//获取下一页内容设置
	public void setTurnToNextPage(){
		pageNumber=pageNumber+1;
		initRecordBegin();
	}

	public Object getCondition() {
		return condition;
	}

	public void setCondition(Object condition) {
		this.condition = condition;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	
	
	



	
	
	
	
}
