@Override
public Pagination findPagination(Map<String, Object> queryMap,
int currentPage, int pageSize)
{
CommunityRestaurantCriteria communityRestaurantCriteria = new CommunityRestaurantCriteria();
// Criteria criteria = communityRestaurantCriteria.createCriteria();
// 设置搜索条件参数
// if(queryMap != null){
// if(queryMap.containsKey("username")){
// criteria.andUserNameLike("%"+(String)queryMap.get("username")+"%");
// }
// if(queryMap.containsKey("email")){
// criteria.andEmailLike((String)queryMap.get("email"));
// }
// }
// 设置分页参数
communityRestaurantCriteria.setPageSize(pageSize);
communityRestaurantCriteria.setStartIndex((currentPage - 1) * pageSize);
List<CommunityRestaurant> items = communityRestaurantMapper.selectByCriteria(communityRestaurantCriteria);
int totalCount = (int) communityRestaurantMapper.selectCountByCriteria(communityRestaurantCriteria);
return new Pagination(pageSize, currentPage, totalCount, items);
}