<?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.fuyuanshen.app.mapper.AppMenuMapper">

    <select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
        select distinct m.perms
        from app_menu m
        left join app_role_menu rm on m.menu_id = rm.menu_id and m.status = '0'
        left join app_role r on r.role_id = rm.role_id and r.status = '0'
        where r.role_id in (select role_id from app_user_role where user_id = #{userId})
    </select>
</mapper>
