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.LearnQuestionCorrectMapper;
import com.ruoyi.learn.domain.LearnQuestionCorrect;
import com.ruoyi.learn.service.ILearnQuestionCorrectService;

/**
 * 题纠错Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-25
 */
@Service
public class LearnQuestionCorrectServiceImpl implements ILearnQuestionCorrectService 
{
    @Autowired
    private LearnQuestionCorrectMapper learnQuestionCorrectMapper;

    /**
     * 查询题纠错
     * 
     * @param id 题纠错主键
     * @return 题纠错
     */
    @Override
    public LearnQuestionCorrect selectLearnQuestionCorrectById(Long id)
    {
        return learnQuestionCorrectMapper.selectLearnQuestionCorrectById(id);
    }

    /**
     * 查询题纠错列表
     * 
     * @param learnQuestionCorrect 题纠错
     * @return 题纠错
     */
    @Override
    public List<LearnQuestionCorrect> selectLearnQuestionCorrectList(LearnQuestionCorrect learnQuestionCorrect)
    {
        return learnQuestionCorrectMapper.selectLearnQuestionCorrectList(learnQuestionCorrect);
    }

    /**
     * 新增题纠错
     * 
     * @param learnQuestionCorrect 题纠错
     * @return 结果
     */
    @Override
    public int insertLearnQuestionCorrect(LearnQuestionCorrect learnQuestionCorrect)
    {
        learnQuestionCorrect.setCreateTime(DateUtils.getNowDate());
        return learnQuestionCorrectMapper.insertLearnQuestionCorrect(learnQuestionCorrect);
    }

    /**
     * 修改题纠错
     * 
     * @param learnQuestionCorrect 题纠错
     * @return 结果
     */
    @Override
    public int updateLearnQuestionCorrect(LearnQuestionCorrect learnQuestionCorrect)
    {
        learnQuestionCorrect.setUpdateTime(DateUtils.getNowDate());
        return learnQuestionCorrectMapper.updateLearnQuestionCorrect(learnQuestionCorrect);
    }

    /**
     * 批量删除题纠错
     * 
     * @param ids 需要删除的题纠错主键
     * @return 结果
     */
    @Override
    public int deleteLearnQuestionCorrectByIds(Long[] ids)
    {
        return learnQuestionCorrectMapper.deleteLearnQuestionCorrectByIds(ids);
    }

    /**
     * 删除题纠错信息
     * 
     * @param id 题纠错主键
     * @return 结果
     */
    @Override
    public int deleteLearnQuestionCorrectById(Long id)
    {
        return learnQuestionCorrectMapper.deleteLearnQuestionCorrectById(id);
    }
}
