package com.sckw.system.dao;

import com.sckw.system.model.KwsMenuRights;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色功能权限
 * @author zk
 * @date 2023-05-31
 */
@Mapper
public interface KwsMenuRightsDao {

    /**
     * 新增
     * @param record
     * @return
     */
    int insert(KwsMenuRights record);

    /**
     * 更新
     * @param record
     * @return
     */
    int update(KwsMenuRights record);

    /**
     * 详情查询
     * @param id
     * @return
     */
    KwsMenuRights selectByKey(Long id);

    /**
     * @param list 角色ID集合
     * @return KwsMenuRights
     * @desc: 根据角色id批量查
     * @author: czh
     * @date: 2023/6/25
     */
    List<KwsMenuRights> selectByRoleIds(List<Long> list);

    /**
     * @param list 菜单ID集合
     * @return KwsMenuRights
     * @desc: 根据菜单id批量查
     * @author: czh
     * @date: 2023/6/25
     */
    List<KwsMenuRights> selectByMenuIds(List<Long> list);

    /**
     * @param  list
     * @return int
     * @desc:  批量保存
     * @author: czh
     * @date: 2023/6/13
     */
    int saveBatch(@Param(value = "list") List<KwsMenuRights> list);

    List<KwsMenuRights> selectEntMenus(Long id);

    int deleteByIds(@Param(value = "list") List<Long> list);
}
