package com.yonge.cooleshow.biz.dal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonge.cooleshow.biz.dal.dto.search.HomeworkAdminSearch;
import com.yonge.cooleshow.biz.dal.dto.search.HomeworkSearch;
import com.yonge.cooleshow.biz.dal.entity.CourseHomework;
import com.yonge.cooleshow.biz.dal.vo.CourseHomeworkDetailVo;
import com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface CourseHomeworkDao extends BaseMapper<CourseHomework> {
	/**
	 * 查询详情
	 *
	 * @author liweifan
	 * @date 2022-03-30 13:53:51
	 * @return: com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo
	 */
	CourseHomeworkVo detail(@Param("id") Long id);

	/**
	 * 分页查询
	 *
	 * @author liweifan
	 * @date 2022-03-30 13:53:51
	 * @return: com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo
	 */
	List<CourseHomeworkVo> selectPage(@Param("page") IPage<CourseHomeworkVo> page, @Param("param") HomeworkSearch query);

	/**
	 * 课程详情 课后作业信息
	 *
	 * @param courseId 课程id
	 * @return 课后作业信息
	 */
	CourseHomeworkDetailVo selectCourseHomeworkDetailByCourseId(@Param("courseId") Long courseId);

	/**
	 * 获取课程购买的用户信息
	 *
	 * @param courseGroupId    课程组id
	 * @param courseScheduleId 课程id
	 * @return 购买用户信息
	 */
	CourseHomeworkDetailVo selectPaymentStudentInfo(@Param("courseScheduleId") Long courseScheduleId);

	/**
	 * 获取课程购买的用户信息
	 *
	 * @param records 课程id集合
	 * @return
	 */
	List<CourseHomeworkVo> selectStudentInfo(@Param("records") List<CourseHomeworkVo> records);

	/**
	 * 查询课程组声部信息 和老师信息
	 *
	 * @param courseGroupId 课程组id
	 * @return
	 */
	CourseHomeworkDetailVo selectSubjectAndTeacherInfo(@Param("courseGroupId") Long courseGroupId);

	/**
	 * 查询课程组声部信息
	 *
	 * @param records 课程组id集合
	 * @return
	 */
	List<CourseHomeworkVo> selectSubjectInfoList(@Param("records") List<CourseHomeworkVo> records);

	/**
	 * 查询课程老师信息和学生旷课信息
	 *
	 * @param records 课程id集合
	 * @return
	 */
	List<CourseHomeworkVo> selectTeacherInfo(@Param("records") List<CourseHomeworkVo> records);

	/**
	 * 管理平台查询
	 *
	 * @param page
	 * @param query
	 * @return
	 */
	List<CourseHomeworkVo> selectAdminPage(@Param("page") IPage<CourseHomeworkVo> page,
										   @Param("param") HomeworkAdminSearch query);

	/**
	 * 查询课程提交时间
	 *
	 * @param courseIdList 课程id集合
	 * @return
	 */
	List<CourseHomeworkVo> selectSubmitTime(@Param("courseIdList") List<Long> courseIdList);
}