package org.wcs.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.wcs.model.po.app.AppBaseMenu;

import java.util.List;

@Mapper
public interface AppBaseMenuMapper extends BaseMapper<AppBaseMenu> {

    @Select("SELECT * FROM t_app_base_menu m LEFT JOIN t_app_base_group_permission p ON m.menu_id = p.menu_id WHERE (m.menu_status = 1 AND p.user_group = #{userGroup}) OR m.menu_level = 1 ORDER BY m.menu_id ASC")
    List<AppBaseMenu> queryPermission(String userGroup);


}
