|
@@ -138,7 +138,9 @@ public class PageInfo<T> implements Serializable {
|
|
|
}
|
|
|
|
|
|
public int getTotalPage() {
|
|
|
- this.totalPage = new BigDecimal(total).divide(new BigDecimal(limit), 0, BigDecimal.ROUND_CEILING).intValue();
|
|
|
+ if(limit>0){
|
|
|
+ this.totalPage=new BigDecimal(total).divide(new BigDecimal(limit),0,BigDecimal.ROUND_CEILING).intValue();
|
|
|
+ }
|
|
|
return totalPage;
|
|
|
}
|
|
|
|
|
@@ -148,6 +150,9 @@ public class PageInfo<T> implements Serializable {
|
|
|
|
|
|
public void setTotal(int total) {
|
|
|
this.total = total;
|
|
|
+ if(limit>0){
|
|
|
+ this.totalPage=new BigDecimal(total).divide(new BigDecimal(limit),0,BigDecimal.ROUND_CEILING).intValue();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public List<T> getRows() {
|