package com.sckw.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.system.model.KwsUserDept;
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 KwsUserDeptDao {
    /**
     * 新增
     * @param record
     * @return
     */
    int insert(KwsUserDept record);

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

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

    /**
     * 根据用户ID查关联关系
     * @param userId
     * @return KwsUserDept
     */
    List<KwsUserDept> findAllByUserId(Long userId);

    /**
     * 批量插入
     * @param kwsUserDeptList
     * @return
     */
    int saveBatch(@Param(value = "list") List<KwsUserDept> kwsUserDeptList);
}
