<?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.huimv.admin.system.mapper.ScreenMenuMapper">


    <select id="getMyMenuApp" resultType="com.huimv.admin.system.entity.ScreenSysMenu">
        SELECT * FROM screen_sys_menu
        WHERE id IN
        (SELECT DISTINCT(menu_id) FROM screen_sys_group_menu WHERE group_id IN
        (SELECT group_id FROM screen_sys_account_group WHERE
        account_id=#{accountName} ))
        ORDER BY sort ASC
    </select>


    <select id="getMyButton" resultType="string">
        SELECT permission FROM screen_sys_menu
        WHERE id IN
        (SELECT DISTINCT(menu_id) FROM screen_sys_group_menu WHERE group_id IN
        (SELECT group_id FROM screen_sys_account_group WHERE
        account_id=#{userId})) and weight =1
        ORDER BY sort ASC
    </select>
</mapper>
