分页查询分析设计
第一 步 抽取出PageBean对象:
![](https://images2015.cnblogs.com/blog/603812/201510/603812-20151008212834049-446408966.png)
第二步: 分析成员变量的数据来源
[用户]:curPage pageSize
[数据库]:List<Employee> data 、 totalCount
[计算]:
prePage : (1) curPage-1 (2) prePage = curPage(首页)
nextPage: curPage+1 (2)nextPage = curPage(尾页)
firstPage: 1
totalPage:(1) totalCount%pageSize =0 => totalPage=totalCount/pageSize
(2) totalCount%pageSize =0 =>
totalPage=totalCount/pageSize+1
![](https://images2015.cnblogs.com/blog/603812/201510/603812-20151008212842768-1058447651.png)
第三步:实现
![](https://images2015.cnblogs.com/blog/603812/201510/603812-20151008212846549-919044790.png)
总结感悟:
![](https://images2015.cnblogs.com/blog/603812/201510/603812-20151008212849909-982626239.png)