更新工单人员的查询

This commit is contained in:
panshuling321 2022-06-21 16:39:44 +08:00
parent 4b99a3d834
commit 372b44cb66
2 changed files with 15 additions and 4 deletions

View File

@ -17,7 +17,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -58,9 +62,16 @@ public class WorkUserServiceImpl implements WorkUserService {
public List<Map<String, Object>> getDeptAndUserByMap(Map<String, Object> params){
List<Map<String, Object>> deptDomains = deptMapper.selectMapListByParams(params);
for(Map<String, Object> deptMap: deptDomains){
List<Map<String, Object>> users = workUserMapper.selectMapListByDeptId(deptMap.get("id").toString());
String deptId = deptMap.get("id") + "";
if(StringUtils.isNotEmpty(deptId)){
deptId = deptId.replaceAll("d_", "");
}
List<Map<String, Object>> users = workUserMapper.selectMapListByDeptId(deptId);
if(users.size() > 0){
deptMap.put("users", users);
}
}
return deptDomains;
}

View File

@ -49,7 +49,7 @@
<select id="selectMapListByParams" resultType="map">
select
work_dept_id as 'id',
concat('d_',work_dept_id) as 'id',
dept_name as 'name'
from xhpc_work_dept
where del_flag = 0 and status = 1