package com.chenyang.nse.bussiness.webtools.dao;

public class PageInfo {
   private Integer pageno = 1;
   private Long count = 0L;
   private Integer pagesize = 10;

   public Long getTotal() {
      Long totalPage = this.getPagesize() != 0 ? this.count / (long)this.getPagesize() : 0L;
      return this.getPagesize() != 0 ? (this.count % (long)this.getPagesize() == 0L ? totalPage : totalPage + 1L) : 0L;
   }

   public int getOffset() {
      return this.count == 0L ? 0 : (this.pageno - 1) * this.getPagesize();
   }

   public Integer getPageno() {
      return this.pageno;
   }

   public void setPageno(Integer pageno) {
      this.pageno = pageno;
   }

   public Long getCount() {
      return this.count;
   }

   public void setCount(Long count) {
      this.count = count;
   }

   public Integer getPagesize() {
      return this.pagesize;
   }

   public void setPagesize(Integer pagesize) {
      this.pagesize = pagesize;
   }
}
