首页>代码>spring+spring jdbc+spring mvc整合easyui搭建的SQL查询器>/remotesql/src/main/java/org/virtus/study/remotesql/app/base/data/Pager.java
001package org.virtus.study.remotesql.app.base.data;
002 
003import java.util.ArrayList;
004import java.util.List;
005 
006@SuppressWarnings("rawtypes")
007public class Pager
008{
009    private int pageCount;
010    private int pageNow=1;
011    private int pageSize=50;
012    private int recordCount=0;
013    private int pages;
014    private int total;
015     
016    private List rows=new ArrayList();
017    private MapEx extraData=new MapEx();
018     
019    private List footer=new ArrayList();
020     
021    public Pager(){}
022    public Pager(List rows)
023    {
024        this.rows=rows;
025    }
026    public Pager(int pageNow,int pageSize)
027    {
028        if(pageNow<=0)pageNow=1;
029        this.pageNow=pageNow;
030        this.pageSize=pageSize;
031    }
032     
033    public static Pager empty()
034    {
035        return new Pager();
036    }
037     
038    public int getPageNow()
039    {
040        return pageNow;
041    }
042    public void setPageNow(int pageNow)
043    {
044        if(pageNow<=0)pageNow=1;
045        this.pageNow = pageNow;
046    }
047    public int getPageSize()
048    {
049        return pageSize;
050    }
051    public void setPageSize(int pageSize)
052    {
053        this.pageSize = pageSize;
054    }
055    public int getRecordCount()
056    {
057        return recordCount;
058    }
059    public void setRecordCount(int recordCount)
060    {
061        this.total=recordCount;
062        this.recordCount = recordCount;
063    }
064     
065    public List getRows()
066    {
067        return rows;
068    }
069     
070    public Pager setRows(List rows)
071    {
072        this.rows = rows;
073        return this;
074    }
075     
076    public int getFirstResult()
077    {
078        return (this.pageNow-1)*this.pageSize;
079    }
080         
081    public int getPages()
082    {
083        return this.pages;
084    }
085     
086    public int getTotal()
087    {
088        return total;
089    }
090    public int getRowCount()
091    {
092        return this.rows.size();
093    }
094    public void setPageCount(int pageCount)
095    {
096        this.pages=pageCount;
097        this.pageCount=pageCount;
098    }
099    public int getPageCount()
100    {
101        return this.pageCount;
102    }
103    public MapEx getExtraData()
104    {
105        return extraData;
106    }
107    public void setExtraData(MapEx extraData)
108    {
109        this.extraData = extraData;
110    }
111     
112    public Pager addExtraData(String key,Object data)
113    {
114        this.extraData.set(key,data);
115        return this;
116    }
117    public void setFooter(List footer)
118    {
119        this.footer = footer;
120    }
121    public List getFooter()
122    {
123        return footer;
124    }
125}
最近下载更多
vicgong  LV4 2022年5月23日
423256321  LV4 2021年1月7日
爱自己的修罗  LV7 2020年9月29日
cs1994814814  LV8 2020年4月21日
17600446733  LV21 2019年12月23日
花开为君顾  LV6 2019年11月18日
1106547553  LV10 2019年5月5日
zhangxu1111  LV11 2019年1月18日
但愿一生只爱一人  LV7 2018年11月27日
ReynLi  LV8 2018年7月31日
最近浏览更多
JIJI994  LV1 2024年5月21日
chen影 2023年10月27日
暂无贡献等级
huangjie123456  LV5 2023年8月7日
sunhao111111  LV2 2023年7月27日
Dominick  LV14 2023年6月20日
akbar2020  LV9 2022年8月27日
vicgong  LV4 2022年5月23日
wyg1414530637 2022年4月1日
暂无贡献等级
刘亦菲9527  LV15 2022年2月12日
缘------  LV9 2021年8月31日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友