龚焕茏
2024-07-03 3ec909b27b3eba956aa9d00cc7a94c179bd04bbf
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
<?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.mindskip.xzs.repository.UserConditionExamineMapper">
 
    <select id="pageInfo" resultType="com.mindskip.xzs.domain.vo.UserConditionExamineVO">
        SELECT
            a.* ,
            b1.real_name as userName,
            b2.real_name as createUserName
        FROM
            t_user_condition_examine a
            LEFT JOIN t_user b1 ON a.user_id = b1.id
            LEFT JOIN t_user b2 ON a.create_user = b2.id
            iNNER JOIN t_user_department c ON a.user_id = c.user_id
            <if test="deptIds != null and deptIds.size() > 0">
                AND c.department_id IN
                <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
                    #{deptId}
                </foreach>
            </if>
        WHERE
            a.deleted = 0
            <if test="userName != null">
                AND b1.real_name LIKE concat('%', #{userName}, '%')
            </if>
        GROUP BY a.id, a.create_time
        ORDER BY a.create_time
    </select>
</mapper>