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

import com.ym.mec.biz.dal.dto.PracticeGroupsDto;
import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleEvaluate> {

    CourseScheduleEvaluate findByClassGroupId(@Param("classGroupId") Integer classGroupId);

    List<CourseScheduleEvaluate> findByClassGroupIds(@Param("classGroupIds") List<Integer> classGroupIds);

    List<PracticeGroupsDto> getPracticeGroupsFree();

    List<PracticeGroupsDto> getPracticeGroupsBuy();

    List<PracticeGroupsDto> getHasReportNums();

    List<PracticeGroupsDto> getOrganPracticeGroups();

    List<PracticeGroupsDto> getOrganMoney();

    /**
     * @param expiredDate:
     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleEvaluate>
     * @describe 推送指定时间及之前的未推送的报告
     * @author Joburgess
     * @date 2020/2/28
     */
    List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate") Date expiredDate);

    /**
     * 根据课程组id获取报告列表
     *
     * @param groupId
     * @return
     */
    List<CourseScheduleEvaluate> findByGroupId(@Param("groupId") Integer groupId);

    /**
     * 根据id获取报告
     *
     * @return
     */
    CourseScheduleEvaluate findById(@Param("id") Integer id);

    /**
     * 获取当前课程教师的评价列表
     *
     * @param teacherId
     * @param courseScheduleId
     * @return
     */
    List<CourseScheduleEvaluate> findByCourseAndTeacher(@Param("teacherId") Integer teacherId, @Param("courseScheduleId") Long courseScheduleId);

    /**
     * 获取要提交的报告
     *
     * @param teacherId
     * @return
     */
    List<CourseScheduleEvaluate> getNeedPostReports(@Param("teacherId") Integer teacherId);

    /**
     * 批量插入报告
     * @param list
     * @return
     */
    int batchAdd(@Param("list") List<CourseScheduleEvaluate> list);
}
