package com.fs.course.mapper;

import java.util.List;
import com.fs.course.domain.FsUserCourseCategory;
import com.fs.his.vo.OptionsVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 课堂分类Mapper接口
 *
 * @author fs
 * @date 2024-05-15
 */
public interface FsUserCourseCategoryMapper
{
    /**
     * 查询课堂分类
     *
     * @param cateId 课堂分类主键
     * @return 课堂分类
     */
    public FsUserCourseCategory selectFsUserCourseCategoryByCateId(Long cateId);

    /**
     * 查询课堂分类列表
     *
     * @param fsUserCourseCategory 课堂分类
     * @return 课堂分类集合
     */
    public List<FsUserCourseCategory> selectFsUserCourseCategoryList(FsUserCourseCategory fsUserCourseCategory);

    /**
     * 新增课堂分类
     *
     * @param fsUserCourseCategory 课堂分类
     * @return 结果
     */
    public int insertFsUserCourseCategory(FsUserCourseCategory fsUserCourseCategory);

    /**
     * 修改课堂分类
     *
     * @param fsUserCourseCategory 课堂分类
     * @return 结果
     */
    public int updateFsUserCourseCategory(FsUserCourseCategory fsUserCourseCategory);

    /**
     * 删除课堂分类
     *
     * @param cateId 课堂分类主键
     * @return 结果
     */
    public int deleteFsUserCourseCategoryByCateId(Long cateId);

    /**
     * 批量删除课堂分类
     *
     * @param cateIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFsUserCourseCategoryByCateIds(Long[] cateIds);

    @Select("select cate_id dict_value, cate_name dict_label,is_del status from fs_store_product_category WHERE pid = 0 and is_del=0 ")
    List<OptionsVO> selectFsUserCoursePidList();

    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid = 0 and is_del=0 ")
    List<OptionsVO> selectFsUserCourseCategoryPidList();

    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid =#{pid} and is_del=0 ")
    List<OptionsVO> selectCateListByPid(Long pid);

    /**
     * 根据名称查询分类
     * @param name  名称
     * @return  FsUserCourseCategory
     */
    @Select("select * from fs_user_course_category where cate_name = #{name} limit 1")
    FsUserCourseCategory selectFsUserCourseCategoryByName(@Param("name")String name);
}
