package com.xhkjedu.sclass.mapper.classroom;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sclass.model.classroom.TClassroom;
import com.xhkjedu.sclass.model.classroom.TClassroomActivestudent;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ClassroomActivestudentMapper extends TkMapper<TClassroomActivestudent> {
    /**
     * 更新活跃值排名
     * @Param [roomid]
     * @Author ywx
     * @Date 2020/6/15 9:02
     * @return java.lang.Integer
     **/
    Integer updateActiveRank(@Param("roomid") Long roomid);

    /**
     * 更新学生活跃值
     * @Param [roomid, studentid]
     * @Author ywx
     * @Date 2020/6/15 9:05
     * @return java.lang.Integer
     **/
    Integer updateActiveNum(@Param("roomid") Long roomid, @Param("studentid") Integer studentid);

    /**
     * 添加学生课堂活跃度表信息
     *
     * @return java.lang.Integer
     * @Param [roomid, classid, schoolid]
     * @Author ywx
     * @Date 2020/6/15 9:49
     **/
    Integer saveStuActive(@Param("roomid") Long roomid, @Param("classid") Integer classid
            , @Param("schoolid") Integer schoolid, @Param("createtime") Integer createtime);

    //批量添加学生课堂活跃度
    void batchSaveStuActive(@Param("rooms") List<TClassroom> rooms);

    //批量更新学生活跃值
    void batchUpdateActiveNum(@Param("students") List<TClassroomActivestudent> students);

    //批量更新活跃值排名
    void updateBatchActiveRank(@Param("roomids") List<Long> roomids);

    //根据课堂id获取互动ids
    String getAsktidsByRoomId(@Param("roomid") Long roomid);

    //课堂学生
    List<TClassroomActivestudent> listRoomStu(@Param("roomid") Long roomid, @Param("classid") Integer classid
            ,@Param("asktids") String asktids);
}