zss
2025-02-19 8a9eb937345d499a90e69df764d9dac677ede35f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ruoyi.system.mapper.UserMapper">
 
    <!--根据条件获取用户列表-->
    <select id="selectUserCondition" resultType="com.ruoyi.common.core.domain.entity.User">
        select * from (select id,
        dept_id,
        account,
        name,
        name_en,
        user_type,
        email,
        phone,
        sex,
        age,
        signature_url,
        picture_url,
        status,
        del_flag,
        login_ip,
        login_date,
        depart_lims_id,
        company,
        is_custom
        from user
        where del_flag = '0') a
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
 
    <!-- 获取用户部门 -->
    <select id="selectUserDepartmentLimsName" resultType="java.lang.String">
        select dl.name
        from user u
                 left join department_lims dl on find_in_set(dl.id, u.depart_lims_id) and dl.id != 1
        where u.id = #{userId}
        limit 1
    </select>
 
    <!-- 查询用户和部门 -->
    <select id="selectNameAnddepartment" resultType="java.util.Map">
        select u.name  userName,
               dl.name department
        from user u
                 left join department_lims dl on find_in_set(dl.id, u.depart_lims_id) and dl.id != 1
        where find_in_set(u.id, #{participant})
    </select>
</mapper>