forked from kidgrow-microservices-platform

侯瑞军
2020-04-01 2402084fb8e2024525af447576c8e9ec632aa9f0
1.修改sql,支持一个账户可以加载多个平台的菜单。
1 files modified
53 ■■■■■ changed files
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-biz/src/main/resources/mapper/SysRoleMenuMapper.xml 53 ●●●●● patch | view | raw | blame | history
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-biz/src/main/resources/mapper/SysRoleMenuMapper.xml
@@ -30,22 +30,39 @@
        ORDER BY sort ASC
    </select>
    <select id="findMenusByRoleCodes" resultType="com.kidgrow.common.model.SysMenu">
        select distinct t.* from sys_menu t
        inner join sys_role_menu r on r.menu_id = t.id
        inner join sys_role rl on rl.id = r.role_id and rl.tenant_id=#{tenantId} and rl.enabled=1
        where
        rl.code in
        <foreach collection="roleCodes" index="index" item="roleCode"
                 open="(" separator="," close=")">
            #{roleCode}
        </foreach>
        <if test="type != null">
            and t.type = #{type}
        </if>
        and t.hidden = 0
        and t.tenant_id = #{tenantId}
        and t.enabled = 1
        ORDER BY sort ASC
    </select>
<!--    <select id="findMenusByRoleCodes" resultType="com.kidgrow.common.model.SysMenu">-->
<!--        select distinct t.* from sys_menu t-->
<!--        inner join sys_role_menu r on r.menu_id = t.id-->
<!--        inner join sys_role rl on rl.id = r.role_id and rl.tenant_id=#{tenantId} and rl.enabled=1-->
<!--        where-->
<!--        rl.code in-->
<!--        <foreach collection="roleCodes" index="index" item="roleCode"-->
<!--                 open="(" separator="," close=")">-->
<!--            #{roleCode}-->
<!--        </foreach>-->
<!--        <if test="type != null">-->
<!--            and t.type = #{type}-->
<!--        </if>-->
<!--        and t.hidden = 0-->
<!--        and t.tenant_id = #{tenantId}-->
<!--        and t.enabled = 1-->
<!--        ORDER BY sort ASC-->
<!--    </select>-->
        <select id="findMenusByRoleCodes" resultType="com.kidgrow.common.model.SysMenu">
            select distinct t.* from sys_menu t
            inner join sys_role_menu r on r.menu_id = t.id
            inner join sys_role rl on rl.id = r.role_id  and rl.enabled=1
            where
            rl.code in
            <foreach collection="roleCodes" index="index" item="roleCode"
                     open="(" separator="," close=")">
                #{roleCode}
            </foreach>
            <if test="type != null">
                and t.type = #{type}
            </if>
            and t.hidden = 0
            and t.enabled = 1
            ORDER BY sort ASC
        </select>
</mapper>