@Override
public Pagination findPagination(Map<String, Object> queryMap,
int currentPage, int pageSize)
{
ServiceInformationCriteria serviceInformationCriteria = new ServiceInformationCriteria();
Criteria criteria = serviceInformationCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("mobile"))
{
criteria.andServeMobileLike("%"+ (String) queryMap.get("mobile") + "%");
}
if (queryMap.containsKey("tel"))
{
criteria.andServeTelLike("%"+ (String) queryMap.get("tel") + "%");
}
if (queryMap.containsKey("qq"))
{
criteria.andServeQqLike("%"+ (String) queryMap.get("qq") + "%");
}
if (queryMap.containsKey("email"))
{
criteria.andServeEmailLike("%"+ (String) queryMap.get("email") + "%");
}
}
// 设置分页参数
serviceInformationCriteria.setPageSize(pageSize);
serviceInformationCriteria.setStartIndex((currentPage - 1) * pageSize);
List<ServiceInformation> items = serviceInformationMapper.selectByCriteria(serviceInformationCriteria);
int totalCount = (int) serviceInformationMapper.selectCountByCriteria(serviceInformationCriteria);
return new Pagination(pageSize, currentPage, totalCount, items);
}