分頁工具類PageResult

一、工具類

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類型。app

@RequestMapper("..")
public PageResult add(){
  return service.add();          
}
相關文章
相關標籤/搜索