package com.fs.company.mapper;

import com.fs.company.domain.CompanyMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 菜单权限Mapper接口
 *
 * @author fs
 * @date 2021-05-25
 */
public interface CompanyMenuMapper
{
    /**
     * 查询菜单权限
     *
     * @param menuId 菜单权限ID
     * @return 菜单权限
     */
    public CompanyMenu selectCompanyMenuById(Long menuId);

    /**
     * 查询菜单权限列表
     *
     * @param companyMenu 菜单权限
     * @return 菜单权限集合
     */
    public List<CompanyMenu> selectCompanyMenuList(CompanyMenu companyMenu);

    /**
     * 新增菜单权限
     *
     * @param companyMenu 菜单权限
     * @return 结果
     */
    public int insertCompanyMenu(CompanyMenu companyMenu);

    /**
     * 修改菜单权限
     *
     * @param companyMenu 菜单权限
     * @return 结果
     */
    public int updateCompanyMenu(CompanyMenu companyMenu);

    /**
     * 删除菜单权限
     *
     * @param menuId 菜单权限ID
     * @return 结果
     */
    public int deleteCompanyMenuById(Long menuId);

    /**
     * 批量删除菜单权限
     *
     * @param menuIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteCompanyMenuByIds(Long[] menuIds);

    List<String> selectMenuPermsByUserId(Long userId);

    List<CompanyMenu> selectMenuTreeAll();

    List<CompanyMenu> selectMenuTreeByUserId(Long userId);

    List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId,@Param("menuCheckStrictly") boolean menuCheckStrictly);

    int hasChildByMenuId(Long menuId);

    List<CompanyMenu> selectMenuTreeAllByCompany();

    List<CompanyMenu> selectMenuTreeByCompanyUserId(Long userId);

    List<CompanyMenu> selectCompanyMenuListByCompany(CompanyMenu menu);
}
