吴羡
23 小时以前 2f07589b54d56085af77b50d580890cd4130b444
ruoyi-system/src/main/resources/mapper/system/UserMapper.xml
@@ -83,6 +83,29 @@
        group by u1.id
    </select>
    <!-- 获取检测员角色人员信息 -->
    <select id="selectInspectorUserList" resultType="com.ruoyi.common.core.domain.entity.User">
        select u1.id,
               u1.account,
               u1.name,
               u1.name_en,
               u1.email,
               u1.phone,
               u1.company,
               u1.is_custom,
               u1.signature_url,
               u1.picture_url,
               u1.depart_lims_id
        from user u1
                 left join sys_user_role sur on sur.user_id = u1.id
                 left join sys_role r on r.role_id = sur.role_id and r.role_name = '检测员'
        where r.role_id is not null
          and u1.status = '0'
          and u1.del_flag = '0'
          and u1.id != 1
        group by u1.id
    </select>
    <!-- 获取当前登录用户部门下的所有用户 -->
    <select id="selectDepartmentLimsUserList" resultType="com.ruoyi.common.core.domain.entity.User">
        select id,
@@ -91,11 +114,24 @@
               name_en,
               status
        from user u
        where depart_lims_id is not null
          and depart_lims_id != ''
          and depart_lims_id = (select u2.depart_lims_id
                                from user u2
                                where u2.id = #{userId})
        where (
            (depart_lims_id is not null
             and depart_lims_id != ''
             and depart_lims_id = (select u2.depart_lims_id
                                   from user u2
                                   where u2.id = #{userId}))
            or
            (
                ((select u3.depart_lims_id
                  from user u3
                  where u3.id = #{userId}) is null
                 or (select u3.depart_lims_id
                     from user u3
                     where u3.id = #{userId}) = '')
                and u.status = '0'
                and u.del_flag = '0'
            )
        )
    </select>
</mapper>