📄 pagebean.java
字号:
package com.st0705.erp.base;
public class PageBean{
private int pag;//当前显示第几页
private int first;//从第几页开始
private int size;//查询最多条数
private int count;//获取查询所有记录条数
private int total;//共有几页
public int getFirst() {
return first;
}
public void setFirst(int first) {
this.first = first;
}
public int getPag() {
return pag;
}
public void setPag(int pag) {
if(pag<=0){
this.first=0;
this.pag=0;
}else if(pag>=total){
if(count%size==0){
this.first=count-size;
}else{
this.size=count%size;
this.first=count-size;
}
this.pag=total-1;
}else{
this.first=(pag)*size;
this.pag=pag;
}
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count=count;
if(count%size==0){
total=(int)(Math.ceil(count/size));
}else{
total=(int)(Math.ceil(count/size)+1);
}
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -