private Map<String, Priv> allPrivs;
@Override
public Pagination findPagination(Map<String, Object> queryMap, int currentPage, int pageSize)
{
PrivCriteria privCriteria = new PrivCriteria();
Criteria criteria = privCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("privName"))
{
criteria.andPrivNameLike("%" + (String) queryMap.get("privName") + "%");
}
if (queryMap.containsKey("menuName"))
{
criteria.andMeueNameLike("%" + (String) queryMap.get("menuName") + "%");
}
if (queryMap.containsKey("actionCmd"))
{
criteria.andActionLike("%" + (String) queryMap.get("actionCmd") + "%");
}
if (queryMap.containsKey("pidisnull"))
{
criteria.andPIdIsNull();
}
}
// 设置分页参数
privCriteria.setPageSize(pageSize);
privCriteria.setStartIndex((currentPage - 1) * pageSize);
List<Priv> items = privMapper.selectByCriteria(privCriteria);
int totalCount = (int) privMapper.selectCountByCriteria(privCriteria);
return new Pagination(pageSize, currentPage, totalCount, items);