package com.zcxk.dao;

import com.zcxk.entity.MenuEntity;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
 *
 * uims_menuDAO接口
 * @author: WYY
 * @date 2020-10-26 16:15
 */
@Mapper
public interface MenuMapper extends BaseMapper<MenuEntity> {

    /**
     * 自定义分页查询
     *
     * @param page
     * @param menuEntity 实体类
     */
    Page<MenuEntity> findPage(IPage<MenuEntity> page, @Param("menu") MenuEntity menuEntity);

    MenuEntity findMenuById(Serializable id);

    List<MenuEntity> findList(MenuEntity menuEntity);

    List<MenuEntity> findTenantList(MenuEntity menuEntity);

    List<MenuEntity> findUserList(@Param("name") String name,@Param("tenantId") String tenantId,@Param(value = "userId")Integer userId);

    List<MenuEntity> findMenuByParentIds(@Param("Ids") List<Long> Ids);

    List<MenuEntity> findTenantMenuByParentIds(@Param("tenantId") String tenantId,@Param("Ids") List<Long> Ids);

    List<MenuEntity> findUserFirstMenu(@Param("tenantId") String tenantId,@Param("userId") Integer userId);

    List<MenuEntity> findAllFirstMenu();

    MenuEntity findTenantByMenuId(@Param("tenantId") String tenantId,@Param("id") Long Id);

    Boolean  updateState(@Param("Id") Long Id);

    List<MenuEntity> findTenantFirstMenu(@Param("tenantId") String tenantId);

    List<MenuEntity> findUserMenu(@Param("tenantId") String tenantId,@Param("userId") Integer userId, @Param("appId") String appId);

    List<MenuEntity> findSystemUserMenu(@Param("appId") String appId);

    List<MenuEntity> findTenantUserMenu(@Param("tenantId") String tenantId, @Param("appId") String appId);

    MenuEntity findUserMenuById(@Param("tenantId") String tenantId,@Param("id")  Long id);
    /**删除相关方法  使用mybatis-plus集成的 **/

    List<MenuEntity> findSystemTenantMenu();
}
