1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
HashMap<String,Object> map = new HashMap<String,Object>(); PageBean<Article> pageBean = new PageBean<Article>();
pageBean.setCurrPage(currentPage);
int pageSize = 5; pageBean.setPageSize(pageSize);
int totalCount = webIndexDao.getCount(article); pageBean.setTotalCount(totalCount);
double tc = totalCount; Double num = Math.ceil(tc/pageSize); pageBean.setTotalPage(num.intValue());
map.put("start",(currentPage-1)*pageSize); map.put("size",pageBean.getPageSize()); map.put("type",article.getType()); List<Article> articleList = webIndexDao.getByPageType(map); pageBean.setLists(articleList);
return pageBean;
|
近期评论