package com.ruoyi.hezhi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hezhi.mapper.TbExamBatchMapper;
import com.ruoyi.hezhi.domain.TbExamBatch;
import com.ruoyi.hezhi.service.ITbExamBatchService;

/**
 * 考试批次Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-21
 */
@Service
public class TbExamBatchServiceImpl implements ITbExamBatchService
{
    @Autowired
    private TbExamBatchMapper tbExamBatchMapper;

    /**
     * 查询考试批次
     *
     * @param examBatchId 考试批次主键
     * @return 考试批次
     */
    @Override
    public TbExamBatch selectTbExamBatchByExamBatchId(Long examBatchId)
    {
        return tbExamBatchMapper.selectTbExamBatchByExamBatchId(examBatchId);
    }

    /**
     * 查询考试批次列表
     *
     * @param tbExamBatch 考试批次
     * @return 考试批次
     */
    @Override
    public List<TbExamBatch> selectTbExamBatchList(TbExamBatch tbExamBatch)
    {
        return tbExamBatchMapper.selectTbExamBatchList(tbExamBatch);
    }

    /**
     * 新增考试批次
     *
     * @param tbExamBatch 考试批次
     * @return 结果
     */
    @Override
    public int insertTbExamBatch(TbExamBatch tbExamBatch)
    {
        return tbExamBatchMapper.insertTbExamBatch(tbExamBatch);
    }

    /**
     * 修改考试批次
     *
     * @param tbExamBatch 考试批次
     * @return 结果
     */
    @Override
    public int updateTbExamBatch(TbExamBatch tbExamBatch)
    {
        return tbExamBatchMapper.updateTbExamBatch(tbExamBatch);
    }

    /**
     * 批量删除考试批次
     *
     * @param examBatchIds 需要删除的考试批次主键
     * @return 结果
     */
    @Override
    public int deleteTbExamBatchByExamBatchIds(Long[] examBatchIds)
    {
        return tbExamBatchMapper.deleteTbExamBatchByExamBatchIds(examBatchIds);
    }

    /**
     * 删除考试批次信息
     *
     * @param examBatchId 考试批次主键
     * @return 结果
     */
    @Override
    public int deleteTbExamBatchByExamBatchId(Long examBatchId)
    {
        return tbExamBatchMapper.deleteTbExamBatchByExamBatchId(examBatchId);
    }

    /**
     * 查询考试批次
     * @param examId 考试ID
     * @param batchIndex 批次序号
     * @return 结果
     */
    @Override
    public TbExamBatch getByExamIdBatchIndex(Long examId, Integer batchIndex){
        return tbExamBatchMapper.getByExamIdBatchIndex(examId, batchIndex);
    }
}
