package com.ssj.dao.kmt.correctsys;


import com.ssj.service.kmt.correctsys.dto.HomeworkCheckDto;
import com.ssj.service.kmt.correctsys.dto.HomeworkCheckKnowDetailDto;
import com.ssj.service.kmt.correctsys.dto.HomeworkExerciseQuestionsDto;
import com.ssj.service.kmt.correctsys.request.ErrorWarningRequest;
import com.ssj.service.kmt.dto.ExerciseQuestionDto;
import com.ssj.service.kmt.dto.TeacherSalaryDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;


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

/**
 * @author Mount Liu
 * @date 2019/5/20
 */
public interface CorrectSysQueryDao {
    /**
     * 查看老师列表(弃用)
     *
     * @param params
     * @param pageable
     * @param type (区分在线老师8和匹配知识点老师13)
     * @return
     */
    //Page<Map<String, Object>> findTeacherByPage(Map<String, Object> params, Pageable pageable, int type);



    /**
     * 查看老师列表(根据科目区分)
     *
     * @param params
     * @param pageable
     * @param type
     * @return
     */
    //Page<Map<String, Object>> findTeacherBySubjectAndPage(Map<String, Object> params, Pageable pageable, int type);

    /**
     * 查询学生作业列表
     *
     * @param params
     * @param pageable
     * @param type (区分在线老师8和匹配知识点老师13)
     * @return
     */
    Page<Map<String, Object>> findStudentHomeworkByPage(Map<String, Object> params, Pageable pageable,int type);

    /**
     * 查询可分配老师列表
     *
     * @param params
     * @param pageable
     * @param type
     * @return
     */
    //Page<Map<String, Object>> findTeacherAllotByPage(Map<String, Object> params, Pageable pageable, int type);

    /**
     * 查看学生详情
     */
    Map<String, Object> findStudentByVipId(String vipId);

    /**
     * 查询未分配作业列表
     */
    //Page<Map<String, Object>> findUnallotHomeworkByPage(Map<String, Object> params, Pageable pageable);

    /**
     * 查询2点以后的作业列表
     */
    //Page<Map<String,Object>> findUnallotHomeworkByNowPage(Map<String, Object> params, Pageable pageable);

    /**
     * 查看校区管理员列表
     *
     * @param params
     * @param pageable
     * @return
     */
    Page<Map<String, Object>> findManagerByPage(Map<String, Object> params, Pageable pageable);


    /**
     *查看老师详情
     */
    //Map<String,Object> findTeacherDetailByTeacherId(String teacherId, int type);

    /**
     * 查询mycat下各种计算
     */
    Map<String,Object>findTheCount(String teacherId,int type);

    /**
     *报错警告
     */
    Page<Map<String,Object>> getErrorWarning(Map map,Pageable pageable);


    /**
     *报错总数
     */
   Map<String,Object> getErrorCount(Map map);
    /**
     * 未批改作业列表(2点前)
     *
     * @param params
     * @param pageable
     * @param type (区分在线老师8和匹配知识点老师13)
     * @return
     */
    Page<Map<String, Object>> findUncorrectHomeworkListByPage(Map<String, Object> params, Pageable pageable, int type);

    /**
     * 统计管理员数据
     *
     * @param searchParams
     * @param managerId
     * @param isTimely 是否实时计算
     * @return
     */
    Map<String, Object> countByManagerId(Map<String, Object> searchParams, String managerId, Boolean isTimely);

    /**
     * 查询质检作业列表
     * @param teacherId 老师id
     * @param beginTime 开始时间，yyyy-MM-dd HH:mm:ss
     * @param endTime 结束时间，yyyy-MM-dd HH:mm:ss
     * @return
     */
    List<HomeworkCheckDto> findHomeworkCheckList (String teacherId, String beginTime, String endTime);

    /**
     * 查询已批改的作业的对错题
     * @param homeworkId 作业id
     * @return
     */
    List<HomeworkExerciseQuestionsDto> findHomeworkCorrectedQuestions (String homeworkId);

    /**
     * 查询已批改作业的作业勾选知识点
     * @param homeworkId
     * @return
     */
    List<HomeworkCheckKnowDetailDto> findHomeworkCorrectedKnowledge(String homeworkId);

    /**
     * 查询已批改作业的作业勾选知识点
     * @param homeworkId
     * @return
     */
    //List<HomeworkCheckKnowDetailDto> findHomeworkCorrectedKnowledgeV1(String homeworkId);

    /**
     * 查询已批改作业图片的作业勾选知识点
     * @param homeworkPictureId
     * @return
     */
    List<HomeworkCheckKnowDetailDto> findHomeworkCorrectedKnowledgeByPictureId(String homeworkPictureId);

    /**
     * 查询已批改作业图片的勾选知识点
     * @param homeworkPictureId
     * @return
     */
    //List<HomeworkCheckKnowDetailDto> findHomeworkPictureCorrectedKnowledge(String homeworkPictureId);

    /**
     * 查询作业用时
     *
     * @param teacherId
     * @param beginTime
     * @param type 8:批改老师，13：匹配知识点老师
     * @return
     */
    Map<String, Object> findHomeworkTimeByTeacherId(String teacherId, String beginTime, int type,int timeType);

    /**
     * 查询老师薪酬列表
     */

    Map<String,Object>  findLowTeacherSalaryList(Map<String,Object> params,String teacherId);


    /**
     * 查看所有老师
     */
    //Page<Map<String,Object>>  findAllTeacherDetail(Map<String,Object> params,Pageable pageable);

    /**
     * 查询单个作业所用时间
     *
     * @param teacherId
     * @param params
     * @param type
     * @return
     */
    Map<String, Object> findHomeworkTimeByTeacherIdAndSubject(String teacherId, Map params, int type);

    /**
     * 通过老师id查询家长评分
     */
     //Map<String,Object> findJudgeLevelByTeacherId(String teacherId,Map params);

    /**
     * 查询某个具体老师评分
     */
    List<Map<String,Object>> findTeacherJudgeLevelByTeacherId(String teacherId);

    /**
     * 查询注册老师数
     */
    Map<String,Object> findRegisterTeacher();
    /**
     * 查询活跃老师数
     */
    //Map<String,Object> findActiveTeacher(String beforeTime);

    /**
     *查询注册用户数
     */
    //Map<String,Object> findRegisterUser();

    /**
     * 查询活跃用户数
     */
    //Map<String,Object> findActiveUser(String beginTime);

    /**
     * 上周新增用户数
     */
   Map<String,Object> findLastWeekUser(Map params);

    /**
     * 作业回收站的作业
     * @param params
     * @param pageable
     * @return
     */
    Page<Map<String, Object>> findHomeworkRecoveryByPage(Map<String, Object> params, Pageable pageable);

    /**
     * 统计作业回收站数量
     * @param gteCreateTime
     * @return
     */
    long countHomeworkRecovery(String gteCreateTime);

    /**
     * 计算未批改作业
     * @param params
     * @param type 角色类型
     * @return
     */
    Map<String, Object> countUncorrectHomework(Map<String, Object> params, int type);

    /**
     * 批改总份数等计算
     * @param params
     * @param type
     * @return
     */
    Map<String, Object> getTotalCount(Map<String, Object> params, int type);

    /**
     * 按天计算总张数
     *
     * @param params
     * @param type
     * @return
     */
    Map<String, Object> getDayCount(Map<String, Object> params, int type);

    //Map<String,Object> findJudgeLevelByParentId(Map params);

    /**
     * 查询所有校区管理员（含超级）
     */
    //List<Map<String,Object>> findAllManagerTeacher();

    /**
     * 查询所有在线批改老师的teacher_id
     */
    List<Map<String,Object>> queryAllOnlineTeacherId();

    /**
     * 查询最长等待时长
     *
     * @param teacherId
     * @param beginTime
     * @param type 8:批改老师，13：匹配知识点老师
     * @return
     */
    Map<String, Object> findMaxWaitTime(String teacherId, String beginTime, int type,int timeType);

    /**
     * 查询所有响应时间
     */
    //Map<String,Object> findAllRespeed(String beginTime);

    /**
     * 查询所有的批改老师
     */
    //Page<Map<String,Object>> findAllKnowlederTeacher(Map<String,Object> params,Pageable pageable);

    /**
     * 查询匹配知识点老师薪酬
     */
    //Map<String,Object> findKnowTeacherSalary(Map params);

    /**
     * 查询知识点老师匹配质检列表
     * @param teacherId
     * @param beginTime
     * @param endTime
     * @return
     */
    List<HomeworkCheckDto> findKnowHomeworkCheckList(String teacherId, String beginTime, String endTime);

    /**
     * 查询在线，离线人数
     */
    Map<String,Object> countOnLine(Map params);


    Map<String,Object> getManagerDetail(Map map);

    Page<Map<String,Object>> findTeacherAllHomework(Map map,Pageable pageable );

    Page<Map<String,Object>>findAllTeacherSalary(Map map,Pageable pageable);


    /**
     * 查询老师等待作业数
     */
    //Map<String,Object> queryWaitHomeworkCount(Map map);



    /**
     * 查询老师在岗率
     */
    List<String> findGuardanceRate(Map map);
}
