package com.xhkjedu.sclass.mapper.classroom;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sclass.model.classroom.TClassroom;
import com.xhkjedu.sclass.model.classroom.TClassroomFile;
import com.xhkjedu.sclass.vo.classroom.ObjectiveVo;
import com.xhkjedu.sclass.vo.classroom.ReportEQuestionVo;
import com.xhkjedu.sclass.vo.classroom.ReportExamVo;
import com.xhkjedu.sclass.vo.classroom.ReportRoomVo;
import com.xhkjedu.sclass.vo.classroom.RoomCorrectVo;
import com.xhkjedu.sclass.vo.classroom.SubjectiveVo;
import com.xhkjedu.sclass.vo.paper.CheckClassVo;
import com.xhkjedu.sclass.vo.room.DirectorVo;
import com.xhkjedu.vo.system.UserVo;
import org.apache.ibatis.annotations.Param;

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

public interface ClassroomMapper extends TkMapper<TClassroom> {
    /**
     * 保存课堂
     *
     * @return java.lang.Integer
     * @Param [r]
     * @Author ywx
     * @Date 2020/7/14 14:48
     **/
    Integer save(@Param("r") TClassroom room);

    /**
     * 获取班级学生id集合
     *
     * @return java.util.List<java.lang.Integer>
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/7/14 17:01
     **/
    List<Integer> listStudentId(@Param("roomid") Long roomid);

    /**
     * 获取批阅信息
     *
     * @return com.xhkjedu.sclass.vo.classroom.RoomCorrectVo
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/9/9 15:38
     **/
    RoomCorrectVo listCorrect(Long roomid);

    /**
     * 获取提问批改学生列表
     *
     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
     * @Param [asktid]
     * @Author ywx
     * @Date 2020/9/9 16:39
     **/
    CheckClassVo listStudentsByAskTid(Long asktid);

    /**
     * 获取考试批改学生列表
     *
     * @return com.xhkjedu.sclass.vo.paper.CheckClassVo
     * @Param [paperid]
     * @Author ywx
     * @Date 2020/9/9 17:12
     **/
    CheckClassVo listStudentsByPaperId(Long paperid);

    /**
     * 获取课堂提问客观题详情
     *
     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
     * @Param [asktid]
     * @Author ywx
     * @Date 2020/9/10 11:12
     **/
    ObjectiveVo callObjective(Long asktid, Integer realstunum);

    /**
     * 获取课堂考试客观题详情
     *
     * @return com.xhkjedu.sclass.vo.classroom.ObjectiveVo
     * @Param [pscaid]
     * @Author ywx
     * @Date 2020/9/10 11:21
     **/
    ObjectiveVo examObjective(Long pscaid, Integer realstunum);

    /**
     * 获取课堂提问主客观题详情
     *
     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
     * @Param [asktid]
     * @Author ywx
     * @Date 2020/9/10 14:01
     **/
    SubjectiveVo callSubjective(Long asktid, Integer realstunum);

    /**
     * 获取课堂考试主客观题详情
     *
     * @return com.xhkjedu.sclass.vo.classroom.SubjectiveVo
     * @Param [pscaid]
     * @Author ywx
     * @Date 2020/9/10 14:24
     **/
    SubjectiveVo examSubjective(Long pscaid, Integer realstunum);

    /**
     * 课堂提问批阅
     *
     * @return void
     * @Param [asksid, radiocorrect]
     * @Author ywx
     * @Date 2020/9/10 15:08
     **/
    void correctCall(Integer asksid, Integer radiocorrect);

    /**
     * 学生课堂回顾列表
     *
     * @return java.util.List<com.xhkjedu.sclass.vo.classroom.RoomVo>
     * @Param [room]
     * @Author ywx
     * @Date 2020/9/14 16:32
     **/
    List<Map> listStuClass(@Param("room") TClassroom room);

    /**
     * 学生课堂回顾详情
     *
     * @return com.xhkjedu.sclass.vo.classroom.ReportRoomStuVo
     * @Param [roomid, studentid]
     * @Author ywx
     * @Date 2020/9/14 16:57
     **/
    Map getReportStu(Long roomid, Integer studentid);

    //获取学生参与课堂次数
    Integer getRoomStudentSigin(Long roomid, Integer studentid);

    /**
     * 结束课堂
     *
     * @return java.lang.Integer
     * @Param [room]
     * @Author ywx
     * @Date 2020/6/15 9:07
     **/
    Integer endClass(@Param("room") TClassroom room);

    /**
     * 获取教师指定章节下上过的课堂历史
     *
     * @return java.util.List<com.xhkjedu.vo.classroom.RoomVo>
     * @Param [room]
     * @Author ywx
     * @Date 2020/6/15 9:18
     **/
    List<Map> listClassByDirectorId(@Param("room") TClassroom room,@Param("userVo") UserVo userVo);

    /**
     * 功能描述  批量更新班级实际签到学生数量
     *
     * @param * @param roomidlist
     * @return void
     * @author WN
     * @date 2020/8/14
     */
    void updateBatchRoomRealStunum(List<Long> roomidlist);

    /**
     * 根据班级id获取学生数量
     *
     * @return java.lang.Integer
     * @Param [classid]
     * @Author ywx
     * @Date 2020/6/15 9:08
     **/
    Integer getStudentNumById(@Param("classid") Integer classid);

    /**
     * 课堂回顾详情
     *
     * @return com.xhkjedu.vo.classroom.ReportRoomVo
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/6/26 9:36
     **/
    ReportRoomVo getReport(Long roomid);

    /**
     * 课堂提问列表
     *
     * @return java.util.List<com.xhkjedu.vo.classroom.ReportQuestionVo>
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/6/26 9:53
     **/
    List<Map> listQuestionReport(Long roomid);

    /**
     * 课堂点名列表
     *
     * @return java.util.List<com.xhkjedu.vo.classroom.ReportStudentVo>
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/6/26 10:06
     **/
    List<Map> listCallReport(Long roomid);

    /**
     * 课堂抢答列表
     *
     * @return java.util.List<com.xhkjedu.vo.classroom.ReportStudentVo>
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/6/26 10:16
     **/
    List<Map> listAskReport(Long roomid);

    /**
     * 课堂截图列表
     *
     * @return java.util.List<com.xhkjedu.model.classroom.TClassroomFile>
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/6/26 10:24
     **/
    List<TClassroomFile> listFileReport(Long roomid);

    /**
     * 课堂考试列表
     *
     * @return java.util.List<com.xhkjedu.vo.classroom.ReportEQuestionVo>
     * @Param [paperid, classid]
     * @Author ywx
     * @Date 2020/6/26 10:34
     **/
    List<ReportEQuestionVo> listExamReport(@Param("paperids") List<Long> paperids, Integer classid);

    /**
     * 功能描述  批量结束之前班级的课堂状态
     *
     * @param * @param classidlist
     * @return void
     * @author WN
     * @date 2020/8/14
     */
    void updateBatchRoomState(List<Integer> classidlist);

    /**
     * 获取课堂考试列表
     *
     * @return java.util.List<com.xhkjedu.vo.classroom.ReportExamVo>
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/9/10 9:35
     **/
    List<ReportExamVo> listPaper(Long roomid);

    //班级学生列表
    List<Map> listStudent(Integer classid, String lsbid);

    //批量保存课堂
    void batchSave(@Param("rooms") List<TClassroom> rooms);

    //批量结束课堂
    void batchEndClass(@Param("rooms") List<TClassroom> rooms);

    //根据班级ids获取学生数量
    List<TClassroom> listStudentNumByClassIds(@Param("classids") List<Integer> classids);

    //根据课堂id获取课堂名称
    String getNameById(@Param("roomid") Long roomid);

    //获得当前年份
    Integer getSchoolYearBySchoolid(@Param("schoolid") Integer schoolid);

    //获取章节信息
    DirectorVo getDirectorById(@Param("directorid") String directorid);
}
