forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-05 716f57dacce347ba154f3b6a994f4e383e3a97a4
dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/dao/mapper/xml/CtUserMapper.xml
@@ -407,4 +407,20 @@
        </if>
        limit #{page.offset}, #{page.size}
    </select>
    <!--  根据部门和角色查询  -->
    <select id="listUserByDeptRoleList" resultMap="dataResult">
        SELECT t1.id, t1.true_name, t1.dept_id
        FROM dyh_ct_user t1 LEFT JOIN dyh_ct_userole t2 ON t1.id = t2.user_id
        WHERE
        t1.delete_status = '0'
        AND t2.role_code = #{roleCode}
        AND t1.status = '1'
        <if test="deptIdList != null and deptIdList != ''">
            and t1.dept_id in
            <foreach collection="deptIdList" item="deptIdList" index="index" open="(" separator="," close=")">
                #{deptIdList}
            </foreach>
        </if>
    </select>
</mapper>