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.LearnWrongBookMapper;
import com.ruoyi.learn.domain.LearnWrongBook;
import com.ruoyi.learn.service.ILearnWrongBookService;

/**
 * 学生错题本Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-25
 */
@Service
public class LearnWrongBookServiceImpl implements ILearnWrongBookService 
{
    @Autowired
    private LearnWrongBookMapper learnWrongBookMapper;

    /**
     * 查询学生错题本
     * 
     * @param wrongId 学生错题本主键
     * @return 学生错题本
     */
    @Override
    public LearnWrongBook selectLearnWrongBookByWrongId(Long wrongId)
    {
        return learnWrongBookMapper.selectLearnWrongBookByWrongId(wrongId);
    }

    /**
     * 查询学生错题本列表
     * 
     * @param learnWrongBook 学生错题本
     * @return 学生错题本
     */
    @Override
    public List<LearnWrongBook> selectLearnWrongBookList(LearnWrongBook learnWrongBook)
    {
        return learnWrongBookMapper.selectLearnWrongBookList(learnWrongBook);
    }

    /**
     * 新增学生错题本
     * 
     * @param learnWrongBook 学生错题本
     * @return 结果
     */
    @Override
    public int insertLearnWrongBook(LearnWrongBook learnWrongBook)
    {
        return learnWrongBookMapper.insertLearnWrongBook(learnWrongBook);
    }

    /**
     * 修改学生错题本
     * 
     * @param learnWrongBook 学生错题本
     * @return 结果
     */
    @Override
    public int updateLearnWrongBook(LearnWrongBook learnWrongBook)
    {
        return learnWrongBookMapper.updateLearnWrongBook(learnWrongBook);
    }

    /**
     * 批量删除学生错题本
     * 
     * @param wrongIds 需要删除的学生错题本主键
     * @return 结果
     */
    @Override
    public int deleteLearnWrongBookByWrongIds(Long[] wrongIds)
    {
        return learnWrongBookMapper.deleteLearnWrongBookByWrongIds(wrongIds);
    }

    /**
     * 删除学生错题本信息
     * 
     * @param wrongId 学生错题本主键
     * @return 结果
     */
    @Override
    public int deleteLearnWrongBookByWrongId(Long wrongId)
    {
        return learnWrongBookMapper.deleteLearnWrongBookByWrongId(wrongId);
    }
}
