Browse Source

查询运维人员

wangyangyang 3 years ago
parent
commit
98cae4a73c

+ 13 - 0
user_center/src/main/java/com/huaxu/controller/UserController.java

@@ -267,6 +267,19 @@ public class UserController {
         List<UserEntity> result = userService.findUserIdsByOrgId(list);
         return new AjaxMessage<>(ResultStatus.OK,result);
     }
+
+    /**
+     * 查询运维人员
+     * @param ids
+     * @return
+     */
+    @RequestMapping(value = "/findUserIdsByOrgIdAndType", method = RequestMethod.GET)
+    public AjaxMessage<List<UserEntity>> findUserIdsByOrgIdAndType(String ids) {
+        List list = JSONObject.parseObject(ids, List.class);
+        List<UserEntity> result = userService.findUserIdsByOrgIdAndType(list);
+        return new AjaxMessage<>(ResultStatus.OK,result);
+    }
+
     @RequestMapping(value = "/findUserList", method = RequestMethod.GET)
     public AjaxMessage<List<UserListDto>> findUserList(Integer type) {
         List<UserListDto> userList = userService.findUserList(type);

+ 2 - 0
user_center/src/main/java/com/huaxu/dao/UserMapper.java

@@ -36,6 +36,8 @@ public interface UserMapper extends BaseMapper<UserEntity> {
 
     List<UserEntity> findUserIdsByOrgId(List<Integer> orgIds);
 
+    List<UserEntity> findUserIdsByOrgIdAndType(List<Integer> orgIds);
+
     List<UserEntity> findUserList(@Param("user")UserEntity userEntity);
 
     List<UserEntity> findUserListByType(@Param("user")UserEntity userEntity);

+ 8 - 0
user_center/src/main/java/com/huaxu/service/UserService.java

@@ -308,6 +308,14 @@ public class UserService extends ServiceImpl<UserMapper,UserEntity> {
 		}
 		return userEntities;
 	}
+	public List<UserEntity> findUserIdsByOrgIdAndType(List<Integer> orgIds)
+	{
+		List<UserEntity> userEntities = new ArrayList<>();
+		if(orgIds.size()>0){
+			userEntities=userMapper.findUserIdsByOrgIdAndType(orgIds);
+		}
+		return userEntities;
+	}
 	public List<UserListDto> findUserList(Integer type)
 	{
 		List<UserListDto> userListDtos = new ArrayList<>();

+ 18 - 0
user_center/src/main/resources/mapper/UserMapper.xml

@@ -159,6 +159,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
         )
     </select>
+    <select id="findUserIdsByOrgIdAndType"  resultType="com.huaxu.entity.UserEntity">
+        SELECT
+        <include refid="userColumns"/>
+        FROM uims_user a
+        <include refid="sysAreaJoins"/>
+        where a.status=1 and (
+        a.DEPT_ORG_ID in
+        <foreach collection="list" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        or
+        a.COMPANY_ORG_ID in
+        <foreach collection="list" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        )
+        and a.user_type=3
+    </select>
     <select id="findUserList" resultType="com.huaxu.entity.UserEntity">
         select a.id,a.DEPT_ORG_ID,a.COMPANY_ORG_ID,
                a.USERNAME,company.ORG_NAME