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