package com.yida.data.school.secondClass.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yida.data.common.core.entity.school.secondClass.EduSecondClassCourse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yida.data.school.dto.secondClass.ListCourseDTO;
import com.yida.data.school.vo.secondClass.CourseH5DetailVO;
import com.yida.data.school.vo.secondClass.CourseVO;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * Mapper
 *
 * @author zhanghaijun
 * @date 2022-04-11 11:09:15
 */
public interface EduSecondClassCourseMapper extends BaseMapper<EduSecondClassCourse> {

    List<CourseVO> listCourse(Page page, @Param("dto") ListCourseDTO dto);

    /**
     * 查询详情
     *
     * @param id
     * @return
     */
    CourseVO getInfo(@Param("id") Long id);

    /**
     * 查询课程详情
     *
     * @param id
     * @return
     */
    CourseH5DetailVO getCourseDetail(@Param("id") Long id);

    /**
     * 播放量加一
     *
     * @param id
     */
    void incrVisitNum(@Param("id") Long id);

    /**
     * 按热度排序查找课程列表
     * @param page
     * @param subjectId
     * @return
     */
    IPage<CourseVO> listCoursePageBySubject(Page page, @Param("subjectId") Long subjectId,@Param("deptId")Long deptId);
}
