package com.ssj.service.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ssj.bean.conch.curator.dto.CuratorTeacherListDto;
import com.ssj.bean.conch.curator.dto.TeacherDetailClassListDto;
import com.ssj.service.conch.curator.dto.CuratorDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface CuratorMapper {

    CuratorDTO findMyInfo(@Param("curatorUserId") String curatorUserId);

    CuratorDTO findApplyInfo(@Param("curatorUserId") String curatorUserId);

    /**
     * 查询老师列表  tb_class_teacher  tb_lib_manager  tb_user
     * @param libId
     * @param types
     * @return
     */
    List<CuratorTeacherListDto> findCuratorTeacherList(@Param("libId") String libId, @Param("types") List<Integer> types, @Param("searchKey") String searchKey);


    /**
     * 查询老师所在的班级列表 tb_class_teacher tb_class
     * @param teacherId
     * @return
     */
    List<TeacherDetailClassListDto> findTeacherDetailClassList (@Param("teacherId") String teacherId);

    /**
     * 查询老师所在的班级列表 tb_class_teacher tb_class
     * @param teacherId
     * @return
     */
    List<TeacherDetailClassListDto> findTeacherDetailClassListV1 (@Param("teacherId") String teacherId,@Param("libId") String libId);

    /**
     * 查询老师所在的班级列表 tb_class_teacher tb_class
     * @param classIds
     * @return
     */
    List<TeacherDetailClassListDto> findClassStudentCount (@Param("classIds") List<String> classIds);

    /**
     * 查询老师所在的班级列表 tb_class_teacher tb_class
     * @param classIds
     * @return
     */
    List<TeacherDetailClassListDto> findClassTeacherCount (@Param("classIds") List<String> classIds);

    /**
     * 查询老师不在的班级列表
     * @param teacherId
     * @param libId
     * @return
     */
    List<TeacherDetailClassListDto> findTeacherNotInClassList (@Param("teacherId") String teacherId, @Param("libId") String libId);

    /**
     * 查询老师详情信息
     * @param teacherId
     * @param types
     * @return
     */
    CuratorTeacherListDto findCuratorTeacherDetailData (@Param("teacherId") String teacherId, @Param("types") List<Integer> types);

    /**
     * 查询老师详情信息
     * @param teacherId
     * @param types
     * @return
     */
    CuratorTeacherListDto findCuratorTeacherDetailDataV1 (@Param("teacherId") String teacherId, @Param("libId") String libId,@Param("types") List<Integer> types);

    /**
     * 查询该班级里的学生信息(班级id不为空)
     */
    List<Map<String,Object>> findClassStudentDetail(Page page, @Param("classId") String classId,@Param("name") String name);

    /**
     * 查询该班级里的学生信息(班级id为空)
     */
    List<Map<String,Object>> findClassStudentDetailByLibId(Page page,@Param("libId")String libId, @Param("name") String name);


    /**
     * 查询其他班级里的学生信息
     */
    List<Map<String,Object>> findOtherClassStudentDetail(Page page,@Param("classId") String classId,  @Param("libId") String libId,@Param("name") String name);


    /**
     * 查询班级列表优化
     */
   List<Map<String,Object>> findClassList(@Param("libId") String libId);

    /**
     * 查询班级列表优化
     * 加分页
     * @param page
     * @param libId
     * @return
     */
    List<Map<String,Object>> findClassListBySys(Page page,@Param("libId") String libId,@Param("searchValue") String searchValue,@Param("teacherId") String teacherId);

    /**
     * 查询学生不在的班级列表
     * @param classId
     * @param libId
     * @return
     */
    List<Map<String,Object>> findStudentNotInClass (@Param("libId") String libId, @Param("classId") String classId);

    Map<String,Object> getTodayStudentHomeworkSum(@Param("vipId") String vipId);

    int getUploadHomeworkSumByClassId(@Param("classId") String classId);

    int getNoCorrectSumByClassId(@Param("classId") String classId);

    int getStudentSumByClassId(@Param("classId") String classId);

    /**
     * 续费学生列表
     * @param page
     * @param params
     * @return
     */
    List<Map<String, Object>> renewStudentList(Page page, @Param("map") Map<String, Object> params);

    /**
     * 查询该校区下面今日有上传多少份作业
     * @param libId
     * @return
     */
    int getUploadHomeworkSumByLibId(@Param("libId") String libId);

    /**
     * 作业列表
     * @param page
     * @param libId
     * @param queryDate
     * @param searchValue
     * @return
     */
    List<Map<String, Object>> homeworkIndex(Page page,@Param("libId") String libId,@Param("queryDate") String queryDate,@Param("searchValue") String searchValue,@Param("queryEndDate") String queryEndDate);

    /**
     * 查询学生列表
     * 查出服务生效以及无效的所有数据
     * 根据endTime 过滤
     * @param page
     * @param params
     * @return
     */
    List<Map<String, Object>> findPageStudentList(Page page, @Param("map") Map<String, Object> params);

    List<Map<String, Object>> findServiceListByVipId(@Param("map") Map<String, Object> params);

    /**
     * 查询老师列表  tb_class_teacher  tb_lib_manager  tb_user
     * @param page 分页
     * @param libId
     * @param types
     * @return
     */
    List<CuratorTeacherListDto> findCuratorTeacherListBySys(Page page,@Param("libId") String libId, @Param("types") List<Integer> types, @Param("searchKey") String searchKey,@Param("classId") String classId);

    /**
     *
     * @param queryDate
     * @return
     */
    Map<String, Object> allLibIndex(@Param("queryDate") String queryDate);

    List<Map<String, Object>> searchHomeworkAllTop(Page page,@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("subject")String subject);

    List<Map<String, Object>> searchActiveTop(@Param("startDate")String startDate, @Param("endDate")String endDate);

    long selectCountByLibId(@Param("libId") String libId);
}

