package com.ssj.dao.sys.homework.dao;

import com.ssj.service.conch.conch.vo.HomeworkVO;
import com.ssj.service.conch.student.dto.AppWrongTopicBookDto;
import com.ssj.service.conch.student.dto.WrongTopicBookDto;
import com.ssj.service.conch.teacher.dto.HomeworkDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

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

/**
 * @author chchen
 */
public interface HomeworkQueryDao {
    /**
     * 分页查询作业列表
     * @param searchParam
     * @param pageable
     * @return
     */
    Page<Map<String, Object>> findHomeworkByPage(Map<String, Object> searchParam, Pageable pageable);

    /**
     * 查询一段时间内每天的学习时长轨迹
     * @param vipId 学员
     * @param beginTime 开始时间
     * @param endTime 结束时间
     * @return
     */
    List<Map<String, Object>> findDatesLearningTime (String vipId, String beginTime, String endTime);

    /**
     * 根据学生id分页查询作业的日期（按创建时间倒排）
     * @param vipId 学生id
     */
    Page<Map<String, Object>> getDatePageByVipId(String vipId, String maxCreateTime, Pageable pageable);

    Page<AppWrongTopicBookDto> findAppWrongTopicBook(String vipId, String subject, boolean isCorrected, Pageable pageable);

    List<HomeworkVO> findThreeDayList(String derver, String beginDateStr, String endDateStr);

    Page<Map<String, Object>> findHomeworkPageByVipId(String vipId, String maxCreateTime, Pageable pageable);

    Page<WrongTopicBookDto> findWrongTopicBook(String vipId, String subject, boolean isCorrected, Pageable pageable);

    /**
     * 根据老师id查询作业列表
     * @param type 0未批改完成   1批改完成
     * @param beginDateTimeStr
     * @param endDateTimeStr
     * @param pageable
     * @param libIdList
     */
    Page<HomeworkDTO> findByTeacherIdAndType(String teacherId, Integer type, String beginDateTimeStr, String endDateTimeStr, Pageable pageable, List<String> libIdList);

    /**
     * 查询学生作业的信息（年级、科目、版本）
     */
    Map<String, Object> findHomeworkInfoById(String homeworkId);

    /**
     * 根据作业id查询关联的知识点（模块、别名）
     */
    List<Map<String, Object>> findDetailsByHomeworkId(String homeworkId);

    /**
     * 统计老师前一天批改的作业图片数量和总用时
     * @param teacherId 老师id
     * @param beginTimeStr
     * @param endTimeStr
     * @return
     */
    List<Map<String, Object>> countCorrectedHomeworkPictureSumAndUsedTime(String teacherId, String beginTimeStr, String endTimeStr);

    /**
     * 查询指定学生当天存在纸面作业且未上传图片的计时记录的id
     */
    List<String> findIdPictureNotUpload(String vipId);
}
