package com.qmth.themis.business.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.themis.business.entity.TEExamSummary;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 考试信息统计表 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2023-10-27
 */
public interface TEExamSummaryMapper extends BaseMapper<TEExamSummary> {

    /**
     * 统计考试信息
     *
     * @param examId
     * @param examActivityId
     * @param roomCode
     * @return
     */
    TEExamSummary examSummary(@Param("examId") Long examId, @Param("examActivityId") Long examActivityId, @Param("roomCode") String roomCode);

    /**
     * 更新考试完成数
     *
     * @param examId
     * @param examActivityId
     * @param roomCode
     */
    void updateExamSummaryFinishCount(@Param("examId") Long examId, @Param("examActivityId") Long examActivityId, @Param("roomCode") String roomCode);

    /**
     * 更新预警未读数
     *
     * @param examId
     * @param examActivityId
     * @param roomCode
     */
    void updateExamSummaryWarningUnread(@Param("examId") Long examId, @Param("examActivityId") Long examActivityId, @Param("roomCode") String roomCode);

    /**
     * 保存统计考试信息
     *
     * @param fieldName
     * @param fieldValue
     * @return
     */
    Boolean saveExamSummary(@Param("fieldName") String fieldName, @Param("fieldValue") String fieldValue);

    /**
     * 更新统计考试信息
     *
     * @param examId
     * @param examActivityId
     * @param roomCode
     * @param fieldValue
     * @return
     */
    Boolean updateExamSummary(@Param("examId") Long examId, @Param("examActivityId") Long examActivityId, @Param("roomCode") String roomCode, @Param("fieldValue") String fieldValue);

    /**
     * 查询统计考试信息count
     *
     * @param examId
     * @param examActivityId
     * @param roomCode
     * @return
     */
    int selectExamSummaryCount(@Param("examId") Long examId, @Param("examActivityId") Long examActivityId, @Param("roomCode") String roomCode);
}
