分頁工具類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、使用工具類

  該工具類是用於返回的是分頁效果。需要返回PageResult類型。

@RequestMapper("..")
public PageResult add(){
  return service.add();          
}

 

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM