package com.ruoyi.learn.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.learn.mapper.LearnKnowledgeTreeMapper;
import com.ruoyi.learn.domain.LearnKnowledgeTree;
import com.ruoyi.learn.domain.LearnKnowledgeTree2;
import com.ruoyi.learn.service.ILearnKnowledgeTreeService;

/**
 * 知识点树Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-25
 */
@Service
public class LearnKnowledgeTreeServiceImpl implements ILearnKnowledgeTreeService 
{
    @Autowired
    private LearnKnowledgeTreeMapper learnKnowledgeTreeMapper;

    /**
     * 查询知识点树
     * 
     * @param id 知识点树主键
     * @return 知识点树
     */
    @Override
    public LearnKnowledgeTree selectLearnKnowledgeTreeById(Long id)
    {
        return learnKnowledgeTreeMapper.selectLearnKnowledgeTreeById(id);
    }

    /**
     * 批量查询知识点树
     * 
     * @param ids 知识点树主键列表
     * @return 知识点树集合
     */
    @Override
    public List<LearnKnowledgeTree> selectLearnKnowledgeTreeByIds(List<Long> ids)
    {
        return learnKnowledgeTreeMapper.selectLearnKnowledgeTreeByIds(ids);
    }

    /**
     * 查询知识点树列表
     * 
     * @param learnKnowledgeTree 知识点树
     * @return 知识点树
     */
    @Override
    public List<LearnKnowledgeTree> selectLearnKnowledgeTreeList(LearnKnowledgeTree learnKnowledgeTree)
    {
        return learnKnowledgeTreeMapper.selectLearnKnowledgeTreeList(learnKnowledgeTree);
    }

    /**
     * 新增知识点树
     * 
     * @param learnKnowledgeTree 知识点树
     * @return 结果
     */
    @Override
    public int insertLearnKnowledgeTree(LearnKnowledgeTree learnKnowledgeTree)
    {
        return learnKnowledgeTreeMapper.insertLearnKnowledgeTree(learnKnowledgeTree);
    }

    /**
     * 修改知识点树
     * 
     * @param learnKnowledgeTree 知识点树
     * @return 结果
     */
    @Override
    public int updateLearnKnowledgeTree(LearnKnowledgeTree learnKnowledgeTree)
    {
        return learnKnowledgeTreeMapper.updateLearnKnowledgeTree(learnKnowledgeTree);
    }

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

    /**
     * 删除知识点树信息
     * 
     * @param id 知识点树主键
     * @return 结果
     */
    @Override
    public int deleteLearnKnowledgeTreeById(Long id)
    {
        return learnKnowledgeTreeMapper.deleteLearnKnowledgeTreeById(id);
    }

    /**
     * 根据题目ID列表查询知识点树
     * 
     * @param questionIds 题目ID列表
     * @return 知识点树集合（包含题目ID）
     */
    @Override
    public List<LearnKnowledgeTree2> selectLearnKnowledgeByQuestionIds(List<Long> questionIds)
    {
        return learnKnowledgeTreeMapper.selectLearnKnowledgeByQuestionIds(questionIds);
    }

    /**
     * 根据知识点ID列表查询知识点树
     * 
     * @param knowledgeIds 知识点ID列表
     * @return 知识点树集合（包含题目ID）
     */
    @Override
    public List<LearnKnowledgeTree2> selectLearnKnowledgeByKnowledgeIds(List<Long> knowledgeIds)
    {
        return learnKnowledgeTreeMapper.selectLearnKnowledgeByKnowledgeIds(knowledgeIds);
    }
}
