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.LearnKnowledgeQuestionMapper;
import com.ruoyi.learn.domain.LearnKnowledgeQuestion;
import com.ruoyi.learn.service.ILearnKnowledgeQuestionService;

/**
 * 知识点题关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-25
 */
@Service
public class LearnKnowledgeQuestionServiceImpl implements ILearnKnowledgeQuestionService 
{
    @Autowired
    private LearnKnowledgeQuestionMapper learnKnowledgeQuestionMapper;

    /**
     * 查询知识点题关系
     * 
     * @param id 知识点题关系主键
     * @return 知识点题关系
     */
    @Override
    public LearnKnowledgeQuestion selectLearnKnowledgeQuestionById(Long id)
    {
        return learnKnowledgeQuestionMapper.selectLearnKnowledgeQuestionById(id);
    }

    /**
     * 查询知识点题关系列表
     * 
     * @param learnKnowledgeQuestion 知识点题关系
     * @return 知识点题关系
     */
    @Override
    public List<LearnKnowledgeQuestion> selectLearnKnowledgeQuestionList(LearnKnowledgeQuestion learnKnowledgeQuestion)
    {
        return learnKnowledgeQuestionMapper.selectLearnKnowledgeQuestionList(learnKnowledgeQuestion);
    }

    /**
     * 新增知识点题关系
     * 
     * @param learnKnowledgeQuestion 知识点题关系
     * @return 结果
     */
    @Override
    public int insertLearnKnowledgeQuestion(LearnKnowledgeQuestion learnKnowledgeQuestion)
    {
        learnKnowledgeQuestion.setCreateTime(DateUtils.getNowDate());
        return learnKnowledgeQuestionMapper.insertLearnKnowledgeQuestion(learnKnowledgeQuestion);
    }

    /**
     * 修改知识点题关系
     * 
     * @param learnKnowledgeQuestion 知识点题关系
     * @return 结果
     */
    @Override
    public int updateLearnKnowledgeQuestion(LearnKnowledgeQuestion learnKnowledgeQuestion)
    {
        return learnKnowledgeQuestionMapper.updateLearnKnowledgeQuestion(learnKnowledgeQuestion);
    }

    /**
     * 批量删除知识点题关系
     * 
     * @param ids 需要删除的知识点题关系主键
     * @return 结果
     */
    @Override
    public int deleteLearnKnowledgeQuestionByIds(Long[] ids)
    {
        return learnKnowledgeQuestionMapper.deleteLearnKnowledgeQuestionByIds(ids);
    }

    /**
     * 删除知识点题关系信息
     * 
     * @param id 知识点题关系主键
     * @return 结果
     */
    @Override
    public int deleteLearnKnowledgeQuestionById(Long id)
    {
        return learnKnowledgeQuestionMapper.deleteLearnKnowledgeQuestionById(id);
    }

    /**
     * 根据题目ID列表查询知识点题关系
     * 
     * @param questionIds 题目ID列表
     * @return 知识点题关系集合
     */
    @Override
    public List<LearnKnowledgeQuestion> selectByQuestionIds(List<Long> questionIds)
    {
        return learnKnowledgeQuestionMapper.selectByQuestionIds(questionIds);
    }
}
