package com.ruoyi.model.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.model.mapper.ShortAnswerQuestionsMapper;
import com.ruoyi.model.domain.ShortAnswerQuestions;
import com.ruoyi.model.service.IShortAnswerQuestionsService;

/**
 * 简答题考试记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-05
 */
@Service
public class ShortAnswerQuestionsServiceImpl implements IShortAnswerQuestionsService 
{
    @Autowired
    private ShortAnswerQuestionsMapper shortAnswerQuestionsMapper;

    /**
     * 查询简答题考试记录
     * 
     * @param shortAnswerQuestionsId 简答题考试记录主键
     * @return 简答题考试记录
     */
    @Override
    public ShortAnswerQuestions selectShortAnswerQuestionsByShortAnswerQuestionsId(Long shortAnswerQuestionsId)
    {
        return shortAnswerQuestionsMapper.selectShortAnswerQuestionsByShortAnswerQuestionsId(shortAnswerQuestionsId);
    }

    /**
     * 查询简答题考试记录列表
     * 
     * @param shortAnswerQuestions 简答题考试记录
     * @return 简答题考试记录
     */
    @Override
    public List<ShortAnswerQuestions> selectShortAnswerQuestionsList(ShortAnswerQuestions shortAnswerQuestions)
    {
        return shortAnswerQuestionsMapper.selectShortAnswerQuestionsList(shortAnswerQuestions);
    }

    /**
     * 新增简答题考试记录
     * 
     * @param shortAnswerQuestions 简答题考试记录
     * @return 结果
     */
    @Override
    public int insertShortAnswerQuestions(ShortAnswerQuestions shortAnswerQuestions)
    {
        shortAnswerQuestions.setCreateTime(DateUtils.getNowDate());
        return shortAnswerQuestionsMapper.insertShortAnswerQuestions(shortAnswerQuestions);
    }

    /**
     * 修改简答题考试记录
     * 
     * @param shortAnswerQuestions 简答题考试记录
     * @return 结果
     */
    @Override
    public int updateShortAnswerQuestions(ShortAnswerQuestions shortAnswerQuestions)
    {
        shortAnswerQuestions.setUpdateTime(DateUtils.getNowDate());
        return shortAnswerQuestionsMapper.updateShortAnswerQuestions(shortAnswerQuestions);
    }

    /**
     * 批量删除简答题考试记录
     * 
     * @param shortAnswerQuestionsIds 需要删除的简答题考试记录主键
     * @return 结果
     */
    @Override
    public int deleteShortAnswerQuestionsByShortAnswerQuestionsIds(Long[] shortAnswerQuestionsIds)
    {
        return shortAnswerQuestionsMapper.deleteShortAnswerQuestionsByShortAnswerQuestionsIds(shortAnswerQuestionsIds);
    }

    /**
     * 删除简答题考试记录信息
     * 
     * @param shortAnswerQuestionsId 简答题考试记录主键
     * @return 结果
     */
    @Override
    public int deleteShortAnswerQuestionsByShortAnswerQuestionsId(Long shortAnswerQuestionsId)
    {
        return shortAnswerQuestionsMapper.deleteShortAnswerQuestionsByShortAnswerQuestionsId(shortAnswerQuestionsId);
    }

    @Override
    public List<ShortAnswerQuestions> getShortAnswerQuestionsList() {
        return shortAnswerQuestionsMapper.getShortAnswerQuestionsList();
    }
}
