package com.ruoyi.learn.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.learn.mapper.LearnTestMapper;
import com.ruoyi.learn.domain.LearnTest;
import com.ruoyi.learn.service.ILearnTestService;

/**
 * 试卷批次Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-18
 */
@Service
public class LearnTestServiceImpl implements ILearnTestService 
{
    @Autowired
    private LearnTestMapper learnTestMapper;

    /**
     * 查询试卷批次
     * 
     * @param batchId 试卷批次主键
     * @return 试卷批次
     */
    @Override
    public LearnTest selectLearnTestByBatchId(Integer batchId)
    {
        return learnTestMapper.selectLearnTestByBatchId(batchId);
    }

    /**
     * 查询试卷批次列表
     * 
     * @param learnTest 试卷批次
     * @return 试卷批次
     */
    @Override
    public List<LearnTest> selectLearnTestList(LearnTest learnTest)
    {
        return learnTestMapper.selectLearnTestList(learnTest);
    }

    /**
     * 新增试卷批次
     * 
     * @param learnTest 试卷批次
     * @return 结果
     */
    @Override
    public int insertLearnTest(LearnTest learnTest)
    {
        learnTest.setCreateTime(DateUtils.getNowDate());
        return learnTestMapper.insertLearnTest(learnTest);
    }

    /**
     * 修改试卷批次
     * 
     * @param learnTest 试卷批次
     * @return 结果
     */
    @Override
    public int updateLearnTest(LearnTest learnTest)
    {
        return learnTestMapper.updateLearnTest(learnTest);
    }

    /**
     * 批量删除试卷批次
     * 
     * @param batchIds 需要删除的试卷批次主键
     * @return 结果
     */
    @Override
    public int deleteLearnTestByBatchIds(Integer[] batchIds)
    {
        return learnTestMapper.deleteLearnTestByBatchIds(batchIds);
    }

    /**
     * 删除试卷批次信息
     * 
     * @param batchId 试卷批次主键
     * @return 结果
     */
    @Override
    public int deleteLearnTestByBatchId(Integer batchId)
    {
        return learnTestMapper.deleteLearnTestByBatchId(batchId);
    }
}
