Commit dabe6591 by huangjinxin

修改参数

1 parent aa14dc31
...@@ -667,7 +667,7 @@ public class UserService { ...@@ -667,7 +667,7 @@ public class UserService {
entityManager.clear(); entityManager.clear();
PageResult<UserInfoSearch> pageResult = new PageResult<>(); PageResult<UserInfoSearch> pageResult = new PageResult<>();
String count = "select count(*) "; String count = "select count(*) ";
String select = "SELECT * "; String select = "SELECT UserInfoSearch ";
String limit = " ORDER BY su.createdTime DESC limit " + (search.getPage() - 1) * search.getSize() + "," + search.getSize(); String limit = " ORDER BY su.createdTime DESC limit " + (search.getPage() - 1) * search.getSize() + "," + search.getSize();
StringBuffer querySql = new StringBuffer("from UserEntity su left join UserRoleEntity sur on su.id =sur.userId left JOIN RoleEntity sr on sr.id =sur.roleId where 1=1 "); StringBuffer querySql = new StringBuffer("from UserEntity su left join UserRoleEntity sur on su.id =sur.userId left JOIN RoleEntity sr on sr.id =sur.roleId where 1=1 ");
if (StringUtils.isNotBlank(search.getRoleId())) { if (StringUtils.isNotBlank(search.getRoleId())) {
...@@ -683,7 +683,7 @@ public class UserService { ...@@ -683,7 +683,7 @@ public class UserService {
if (countNum.intValue() == 0) { if (countNum.intValue() == 0) {
return pageResult; return pageResult;
} }
List<Map<String, Object>> resultList = entityManager.createQuery(select + querySql.toString() + limit).getResultList(); List<Map<String, Object>> resultList = entityManager.createNativeQuery(select + querySql.toString() + limit).getResultList();
List<UserInfoSearch> list = resultList.stream().map(a -> mapConvertToObject(a, UserInfoSearch.class)).collect(Collectors.toList()); List<UserInfoSearch> list = resultList.stream().map(a -> mapConvertToObject(a, UserInfoSearch.class)).collect(Collectors.toList());
Integer pageInt = countNum.intValue() / search.getSize(); Integer pageInt = countNum.intValue() / search.getSize();
pageResult.setDataList(list); pageResult.setDataList(list);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!