zhangnaisong
2024-08-02 470b596ddce65dcbb8087e78f0a096d8ba1a429e
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -379,4 +379,15 @@
        </foreach>
        and su.status = '0'
    </select>
    <select id="selectUserIdByCarId" resultType="java.lang.String">
        select user_id from sys_user where dept_id in (
        with recursive rsd as (
            select * from sys_dept sd where sd.dept_id = (
                select dept_id from ard_sy_car where car_id = #{carId})
            union
            select psd.* from sys_dept psd inner join rsd on rsd.parent_id = psd.dept_id
        )
        select rsd.dept_id from rsd)
    </select>
</mapper>