package com.fs.course.mapper;

import com.fs.course.domain.FsCourseQuestionBank;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 题库Mapper接口
 *
 * @author fs
 * @date 2024-09-07
 */
public interface FsCourseQuestionBankMapper
{
    /**
     * 查询题库
     *
     * @param id 题库主键
     * @return 题库
     */
    public FsCourseQuestionBank selectFsCourseQuestionBankById(Long id);

    /**
     * 查询题库列表
     *
     * @param fsCourseQuestionBank 题库
     * @return 题库集合
     */
    public List<FsCourseQuestionBank> selectFsCourseQuestionBankList(FsCourseQuestionBank fsCourseQuestionBank);

    /**
     * 新增题库
     *
     * @param fsCourseQuestionBank 题库
     * @return 结果
     */
    public int insertFsCourseQuestionBank(FsCourseQuestionBank fsCourseQuestionBank);

    /**
     * 修改题库
     *
     * @param fsCourseQuestionBank 题库
     * @return 结果
     */
    public int updateFsCourseQuestionBank(FsCourseQuestionBank fsCourseQuestionBank);

    /**
     * 删除题库
     *
     * @param id 题库主键
     * @return 结果
     */
    public int deleteFsCourseQuestionBankById(Long id);

    /**
     * 批量删除题库
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFsCourseQuestionBankByIds(Long[] ids);

    List<FsCourseQuestionBank> selectFsCourseQuestionBankByIds(@Param("list") List<Long> ids);

    @Select("<script> " +
            "SELECT * FROM fs_course_question_bank WHERE id IN " +
            "<foreach item=\"id\" collection=\"list\" open=\"(\" separator=\",\" close=\")\">" +
            "#{id}" +
            "</foreach>" +
            "</script>")
    public List<FsCourseQuestionBank> selectFsCourseQuestionBankByIdVO(@Param("list") String[] questionBankId);


}
