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.LearnPaperQuestionMapper;
import com.ruoyi.learn.domain.LearnPaperQuestion;
import com.ruoyi.learn.service.ILearnPaperQuestionService;

/**
 * 试卷题关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-18
 */
@Service
public class LearnPaperQuestionServiceImpl implements ILearnPaperQuestionService 
{
    @Autowired
    private LearnPaperQuestionMapper learnPaperQuestionMapper;

    /**
     * 查询试卷题关系
     * 
     * @param id 试卷题关系主键
     * @return 试卷题关系
     */
    @Override
    public LearnPaperQuestion selectLearnPaperQuestionById(Long id)
    {
        return learnPaperQuestionMapper.selectLearnPaperQuestionById(id);
    }

    /**
     * 查询试卷题关系列表
     * 
     * @param learnPaperQuestion 试卷题关系
     * @return 试卷题关系
     */
    @Override
    public List<LearnPaperQuestion> selectLearnPaperQuestionList(LearnPaperQuestion learnPaperQuestion)
    {
        return learnPaperQuestionMapper.selectLearnPaperQuestionList(learnPaperQuestion);
    }

    /**
     * 新增试卷题关系
     * 
     * @param learnPaperQuestion 试卷题关系
     * @return 结果
     */
    @Override
    public int insertLearnPaperQuestion(LearnPaperQuestion learnPaperQuestion)
    {
        learnPaperQuestion.setCreateTime(DateUtils.getNowDate());
        return learnPaperQuestionMapper.insertLearnPaperQuestion(learnPaperQuestion);
    }

    /**
     * 修改试卷题关系
     * 
     * @param learnPaperQuestion 试卷题关系
     * @return 结果
     */
    @Override
    public int updateLearnPaperQuestion(LearnPaperQuestion learnPaperQuestion)
    {
        return learnPaperQuestionMapper.updateLearnPaperQuestion(learnPaperQuestion);
    }

    /**
     * 批量删除试卷题关系
     * 
     * @param ids 需要删除的试卷题关系主键
     * @return 结果
     */
    @Override
    public int deleteLearnPaperQuestionByIds(Long[] ids)
    {
        return learnPaperQuestionMapper.deleteLearnPaperQuestionByIds(ids);
    }

    /**
     * 删除试卷题关系信息
     * 
     * @param id 试卷题关系主键
     * @return 结果
     */
    @Override
    public int deleteLearnPaperQuestionById(Long id)
    {
        return learnPaperQuestionMapper.deleteLearnPaperQuestionById(id);
    }
}
