<?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.zsc.edu.gateway.modules.system.repo.MenuRepository">

    <select id="selectByRoleId" resultType="Menu">
        select m.* from sys_menu m,sys_role_menu rm where m.id=rm.menu_id and rm.role_id=#{roleId}
    </select>
    <select id="selectByUserId" resultType="Menu">
        select m.* from sys_menu m,sys_role_menu rm, sys_user u
        where m.id=rm.menu_id and rm.role_id=u.role_id and u.id=#{userId} and m.type=#{type}
    </select>
    <select id="selectAll" resultType="com.zsc.edu.gateway.modules.system.entity.Menu">
        select m.*
        from sys_menu m
    </select>
</mapper>
