package com.ym.mec.biz.dal.dao;

import com.ym.mec.biz.dal.dto.Mapper;
import com.ym.mec.biz.dal.dto.TeacherHomeworkListDto;
import com.ym.mec.biz.dal.dto.WebCourseHomeworkListDto;
import com.ym.mec.biz.dal.entity.CourseHomework;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CourseHomeworkDao extends BaseDAO<Long, CourseHomework> {

	/**
	 * @describe 根据班级和老师获取对应作业列表
	 * @author Joburgess
	 * @date 2019/10/20
	 * @param params: 参数
	 * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherHomeworkListDto>
	 */
	List<TeacherHomeworkListDto> findByClassGroupAndTeacher(Map<String, Object> params);

	int countByClassGroupAndTeacher(Map<String, Object> params);

	/**
	 * @describe 根据课程编号和教师编号查询记录
	 * @author Joburgess
	 * @date 2019/10/20
	 * @param courseHomeworkId: 课程作业编号
	 * @param userId: 用户编号
	 * @return com.ym.mec.biz.dal.entity.CourseHomework
	 */
	CourseHomework findByTeacherAndCourseHomewok(@Param("courseHomeworkId") Long courseHomeworkId, @Param("userId") Integer userId);

	/**
	 * @describe 根据课程编号和教师编号查询记录
	 * @author Joburgess
	 * @date 2019/10/20
	 * @param courseScheduleId: 课程作业编号
	 * @return com.ym.mec.biz.dal.entity.CourseHomework
	 */
	CourseHomework findByCourseSchedule(@Param("courseScheduleId") Long courseScheduleId);

	/**
	 * 查询老师未回复作业的数量
	 * @return
	 */
	List<Mapper> queryTeacerNoReplyNum();

	int delByCourseScheduleId(Long courseScheduleId);

	int batchDelByCourseScheduleId(@Param("courseScheduleIdList") List<Long> courseScheduleIdList);

	/**
	 * 后台作业列表
	 * @param params
	 * @return
	 */
    List<WebCourseHomeworkListDto> queryHomePage(Map<String, Object> params);

	/**
	 * 后台作业列表
	 * @param params
	 * @return
	 */
	int findHomeCount(Map<String, Object> params);
}
