@Override
public Pagination findPagination(Map<String, Object> queryMap,
int currentPage, int pageSize)
{
UserCriteria userCriteria = new UserCriteria();
Criteria criteria = userCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("userName"))
{
criteria.andUserNameLike("%" + queryMap.get("userName") + "%");
}
if (queryMap.containsKey("email"))
{
criteria.andEmailLike("%" + queryMap.get("email") + "%");
}
if (queryMap.containsKey("type"))
{
criteria.andTypeEqualTo(Short.parseShort((String) queryMap.get("type")));
}
if (queryMap.containsKey("roleId"))
{
criteria.andRoleIdEqualTo(Long.parseLong((String) queryMap.get("roleId")));
}
if (queryMap.containsKey("merchantId"))
{
criteria.andMerchantIdEqualTo(Long.parseLong((String) queryMap.get("merchantId")));
}
}
// 设置分页参数
userCriteria.setPageSize(pageSize);
userCriteria.setStartIndex((currentPage - 1) * pageSize);
List<User> items = userMapper.selectByCriteria(userCriteria);
List<Role> roles = roleMapper.selectByCriteria(null);
List<Merchant> merchants = merchantMapper.selectByCriteria(null);
for(User user : items)