@Override
public Pagination findPagination(Map<String, Object> queryMap,
int currentPage, int pageSize)
{
AdvertPositionCriteria advertPositionCriteria = new AdvertPositionCriteria();
Criteria criteria = advertPositionCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("name"))
{
criteria.andPositionNameLike("%" + (String) queryMap.get("name") + "%");
}
}
// 设置分页参数
advertPositionCriteria.setPageSize(pageSize);
advertPositionCriteria.setStartIndex((currentPage - 1) * pageSize);
List<AdvertPosition> items = advertPositionMapper.selectByExampleWithBLOBs(advertPositionCriteria);
int totalCount = (int) advertPositionMapper.selectCountByCriteria(advertPositionCriteria);
return new Pagination(pageSize, currentPage, totalCount, items);
}