/*
 * $Id: Paging.java,v 1.0 2016/07/28 wangqx Exp $
 */
package cn.com.liandisys.ycjt.ggcx.common.vo;

/**
 * @author wangqx
 * 2016-7-28
 */
public class Paging {

    private int page = 0; //页数

    private long totalrows = 0L; //总行数

    private int rows; //行数

    private int firstResult = -1;

    private int maxResult = -1;

    public int getFirstResult() {

        if (firstResult == -1)
            firstResult = page * rows - rows; //hibernate分页起始数从0开始

        return firstResult;
    }

    public int getMaxResult() {

        maxResult = getFirstResult() + rows - 1;

        return maxResult;
    }

    /**
     * @return the rows
     */
    public int getRows() {

        return rows;
    }

    /**
     * @param rows the rows to set
     */
    public void setRows(int rows) {

        this.rows = rows;
    }

    /**
     * @return the page
     */
    public int getPage() {

        return page;
    }

    /**
     * @param page the page to set
     */
    public void setPage(int page) {

        this.page = page;
    }

    /**
     * @return the totalrows
     */
    public long getTotalrows() {

        return totalrows;
    }

    /**
     * @param totalrows the totalrows to set
     */
    public void setTotalRows(long totalrows) {

        this.totalrows = totalrows;
    }
}