private PrivMapper privMapper;
@Override
public Pagination findPagination(Map<String, Object> queryMap, int currentPage, int pageSize)
{
RoleCriteria roleCriteria = new RoleCriteria();
Criteria criteria = roleCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("roleName"))
{
criteria.andRoleNameLike("%" + (String) queryMap.get("roleName") + "%");
}
if (queryMap.containsKey("description"))
{
criteria.andDescriptionLike((String) queryMap .get("description"));
}
}
// 设置分页参数
roleCriteria.setPageSize(pageSize);
roleCriteria.setStartIndex((currentPage - 1) * pageSize);
List<Role> items = roleMapper.selectByCriteria(roleCriteria);
int totalCount = (int) roleMapper.selectCountByCriteria(roleCriteria);
return new Pagination(pageSize, currentPage, totalCount, items);