package com.fs.course.service.impl;

import com.fs.common.utils.DateUtils;
import com.fs.course.domain.FsUserCourseCategory;
import com.fs.course.mapper.FsUserCourseCategoryMapper;
import com.fs.course.service.IFsUserCourseCategoryService;
import com.fs.his.vo.OptionsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 课堂分类Service业务层处理
 *
 * @author fs
 * @date 2024-05-15
 */
@Service
public class FsUserCourseCategoryServiceImpl implements IFsUserCourseCategoryService
{
    @Autowired
    private FsUserCourseCategoryMapper fsUserCourseCategoryMapper;

    /**
     * 查询课堂分类
     *
     * @param cateId 课堂分类主键
     * @return 课堂分类
     */
    @Override
    public FsUserCourseCategory selectFsUserCourseCategoryByCateId(Long cateId)
    {
        return fsUserCourseCategoryMapper.selectFsUserCourseCategoryByCateId(cateId);
    }

    /**
     * 查询课堂分类列表
     *
     * @param fsUserCourseCategory 课堂分类
     * @return 课堂分类
     */
    @Override
    public List<FsUserCourseCategory> selectFsUserCourseCategoryList(FsUserCourseCategory fsUserCourseCategory)
    {
        return fsUserCourseCategoryMapper.selectFsUserCourseCategoryList(fsUserCourseCategory);
    }

    /**
     * 新增课堂分类
     *
     * @param fsUserCourseCategory 课堂分类
     * @return 结果
     */
    @Override
    public int insertFsUserCourseCategory(FsUserCourseCategory fsUserCourseCategory)
    {
        fsUserCourseCategory.setCreateTime(DateUtils.getNowDate());
        return fsUserCourseCategoryMapper.insertFsUserCourseCategory(fsUserCourseCategory);
    }

    /**
     * 修改课堂分类
     *
     * @param fsUserCourseCategory 课堂分类
     * @return 结果
     */
    @Override
    public int updateFsUserCourseCategory(FsUserCourseCategory fsUserCourseCategory)
    {
        fsUserCourseCategory.setUpdateTime(DateUtils.getNowDate());
        return fsUserCourseCategoryMapper.updateFsUserCourseCategory(fsUserCourseCategory);
    }

    /**
     * 批量删除课堂分类
     *
     * @param cateIds 需要删除的课堂分类主键
     * @return 结果
     */
    @Override
    public int deleteFsUserCourseCategoryByCateIds(Long[] cateIds)
    {
        return fsUserCourseCategoryMapper.deleteFsUserCourseCategoryByCateIds(cateIds);
    }

    /**
     * 删除课堂分类信息
     *
     * @param cateId 课堂分类主键
     * @return 结果
     */
    @Override
    public int deleteFsUserCourseCategoryByCateId(Long cateId)
    {
        return fsUserCourseCategoryMapper.deleteFsUserCourseCategoryByCateId(cateId);
    }

    @Override
    public List<OptionsVO> selectFsUserCoursePidList() {
        return fsUserCourseCategoryMapper.selectFsUserCoursePidList();
    }

    @Override
    public List<OptionsVO> selectFsUserCourseCategoryPidList() {
        return fsUserCourseCategoryMapper.selectFsUserCourseCategoryPidList();
    }


    @Override
    public List<OptionsVO> selectCateListByPid(Long pid) {
        return fsUserCourseCategoryMapper.selectCateListByPid(pid);
    }
}
