package com.qmth.themis.business.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.themis.business.bean.admin.WarningNotifyBean;
import com.qmth.themis.business.dto.response.TEExamQueryDto;
import com.qmth.themis.business.dto.response.TIeWarningNotifyDto;
import com.qmth.themis.business.entity.TIeInvigilateWarnInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 监考预警信息 Mapper 接口
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/6/25
 */
@Mapper
public interface TIeInvigilateWarnInfoMapper extends BaseMapper<TIeInvigilateWarnInfo> {

    /**
     * 预警提醒
     *
     * @param examId
     * @param examActivityId
     * @param roomCode
     * @param userId
     * @param orgId
     * @return
     */
    public Integer warningCount(@Param("examId") Long examId,
                                @Param("examActivityId") Long examActivityId,
                                @Param("roomCode") String roomCode,
                                @Param("userId") Long userId,
                                @Param("orgId") Long orgId);

    /**
     * 预警提醒
     *
     * @param examIdList
     * @param userId
     * @param orgId
     * @return
     */
    public List<TEExamQueryDto> warningCountByList(@Param("examIdList") List<Long> examIdList, @Param("userId") Long userId, @Param("orgId") Long orgId);

    /**
     * 预警通知
     *
     * @param examId
     * @param userId
     * @param orgId
     * @return
     */
    public List<TIeWarningNotifyDto> warningMessage(@Param("examId") Long examId, @Param("userId") Long userId, @Param("orgId") Long orgId);

    public List<WarningNotifyBean> findLastMsg(@Param("count") Integer count, @Param("orgId") Long orgId);

    /**
     * 查找预警和异常信息
     *
     * @param examRecordId
     * @param type
     * @param level
     * @return
     */
    public List<Integer> findWarnAndExceptionInfo(@Param("examRecordId") Long examRecordId, @Param("type") String type, @Param("level") String level);
}
