
正文
分页工具类PageResult
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
1、工具类public class PageResult implements Serializable { private Long total;//总记录数
private List rows;//当前页面结果 public Long getTotal() {
return total;
} public void setTotal(Long total) {
this.total = total;
} public List getRows() {
return rows;
} public void setRows(List rows) {
this.rows = rows;
} public PageResult(Long total, List rows) {
this.total = total;
this.rows = rows;
} public PageResult() {
}
}
2、使用工具类
public class PageResult implements Serializable { private Long total;//总记录数
private List rows;//当前页面结果 public Long getTotal() {
return total;
} public void setTotal(Long total) {
this.total = total;
} public List getRows() {
return rows;
} public void setRows(List rows) {
this.rows = rows;
} public PageResult(Long total, List rows) {
this.total = total;
this.rows = rows;
} public PageResult() {
}
}
该工具类是用于返回的是分页效果。需要返回PageResult类型。
@RequestMapper("..")
public PageResult add(){
return service.add();
}







