package cn.com.ty.lift.ud.appmenu.mapper;

import cn.com.ty.lift.ud.appmenu.mapper.entity.Appmenu;

import java.util.List;

import cn.com.ty.lift.ud.appmenu.mapper.entity.AppmenuTree;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * app权限-Repository
 * 
 * @author Xson
 * @date 2020-06-04
 */
public interface AppmenuMapper extends BaseMapper<Appmenu> {

    @Select("SELECT * FROM appmenu where router = #{router}")
    Appmenu findByRouter(@Param("router") String router);

    @Select("SELECT * FROM appmenu")
    List<Appmenu> queryAll();

    /**
     * 查询所有菜单-树形结构
     * 
     * @return
     */
    @Select("SELECT * FROM appmenu")
    List<AppmenuTree> queryAllTree();

    /**
     * 查询所有父级菜单
     * 
     * @return
     */
    @Select("SELECT * FROM appmenu where parent_id = 1")
    List<Appmenu> queryAllParent();
}
