<?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.web.stock.mapper.RoleOrgMapper">

    <select id="selectOrgIdByUserId" parameterType="Long" resultType="String">
        select sro.org_id
        from sys_user_role sur
                 inner join sys_role_org sro on sur.role_id = sro.role_id
        where sur.user_id = #{userId}
        order by sro.id asc
        limit 1
    </select>
</mapper>
