package com.fs.course.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.course.mapper.FsCourseQuestionCategoryMapper;
import com.fs.course.domain.FsCourseQuestionCategory;
import com.fs.course.service.IFsCourseQuestionCategoryService;

/**
 * 题目分类Service业务层处理
 *
 * @author fs
 * @date 2025-04-17
 */
@Service
public class FsCourseQuestionCategoryServiceImpl extends ServiceImpl<FsCourseQuestionCategoryMapper, FsCourseQuestionCategory> implements IFsCourseQuestionCategoryService {

    /**
     * 查询题目分类
     *
     * @param cateId 题目分类主键
     * @return 题目分类
     */
    @Override
    public FsCourseQuestionCategory selectFsCourseQuestionCategoryByCateId(Long cateId)
    {
        return baseMapper.selectFsCourseQuestionCategoryByCateId(cateId);
    }

    /**
     * 查询题目分类列表
     *
     * @param fsCourseQuestionCategory 题目分类
     * @return 题目分类
     */
    @Override
    public List<FsCourseQuestionCategory> selectFsCourseQuestionCategoryList(FsCourseQuestionCategory fsCourseQuestionCategory)
    {
        return baseMapper.selectFsCourseQuestionCategoryList(fsCourseQuestionCategory);
    }

    /**
     * 新增题目分类
     *
     * @param fsCourseQuestionCategory 题目分类
     * @return 结果
     */
    @Override
    public int insertFsCourseQuestionCategory(FsCourseQuestionCategory fsCourseQuestionCategory)
    {
        fsCourseQuestionCategory.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertFsCourseQuestionCategory(fsCourseQuestionCategory);
    }

    /**
     * 修改题目分类
     *
     * @param fsCourseQuestionCategory 题目分类
     * @return 结果
     */
    @Override
    public int updateFsCourseQuestionCategory(FsCourseQuestionCategory fsCourseQuestionCategory)
    {
        fsCourseQuestionCategory.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateFsCourseQuestionCategory(fsCourseQuestionCategory);
    }

    /**
     * 批量删除题目分类
     *
     * @param cateIds 需要删除的题目分类主键
     * @return 结果
     */
    @Override
    public int deleteFsCourseQuestionCategoryByCateIds(Long[] cateIds)
    {
        return baseMapper.deleteFsCourseQuestionCategoryByCateIds(cateIds);
    }

    /**
     * 删除题目分类信息
     *
     * @param cateId 题目分类主键
     * @return 结果
     */
    @Override
    public int deleteFsCourseQuestionCategoryByCateId(Long cateId)
    {
        return baseMapper.deleteFsCourseQuestionCategoryByCateId(cateId);
    }
}
