瀏覽代碼

监考端接口

wangliang 4 年之前
父節點
當前提交
2eada58472

+ 36 - 0
themis-backend/src/main/java/com/qmth/themis/backend/api/TIeInvigilateController.java

@@ -10,6 +10,7 @@ import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.base.BasePage;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
 import com.qmth.themis.business.bean.backend.InvigilateListDetailBean;
+import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
 import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
@@ -89,6 +90,9 @@ public class TIeInvigilateController {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }
+        if (Objects.isNull(roomCodes) || Objects.equals(roomCodes, "")) {
+            throw new BusinessException(ExceptionResultEnum.ROOMCODE_IS_NULL);
+        }
         IPage<InvigilateListBean> invigilateListBeanIPage = tOeExamRecordService.invigilatePageList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodes, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
         BasePage basePage = new BasePage(invigilateListBeanIPage.getRecords(), invigilateListBeanIPage.getCurrent(), invigilateListBeanIPage.getSize(), invigilateListBeanIPage.getTotal());
         Map map = new HashMap<>();
@@ -115,6 +119,9 @@ public class TIeInvigilateController {
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
         }
+        if (Objects.isNull(roomCodes) || Objects.equals(roomCodes, "")) {
+            throw new BusinessException(ExceptionResultEnum.ROOMCODE_IS_NULL);
+        }
         IPage<InvigilateListVideoBean> invigilateListVideoBeanIPage = tOeExamRecordService.invigilatePageListVideo(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodes, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
         BasePage basePage = new BasePage(invigilateListVideoBeanIPage.getRecords(), invigilateListVideoBeanIPage.getCurrent(), invigilateListVideoBeanIPage.getSize(), invigilateListVideoBeanIPage.getTotal());
         Map map = new HashMap<>();
@@ -223,6 +230,35 @@ public class TIeInvigilateController {
         return ResultUtil.ok(SystemConstant.SUCCESS);
     }
 
+    @ApiOperation(value = "在线巡考列表接口")
+    @RequestMapping(value = "/patrol/list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "监考监控信息", response = InvigilateListVideoBean.class)})
+    public Result patrolList(@ApiParam(value = "考试批次id") @RequestParam Long examId,
+                             @ApiParam(value = "考试场次id", required = false) @RequestParam(required = false) Long examActivityId,
+                             @ApiParam(value = "虚拟考场代码", required = true) @RequestParam Set<String> roomCodes,
+                             @ApiParam(value = "试题下载状态", required = false) @RequestParam(required = false) Integer paperDownload,
+                             @ApiParam(value = "考生状态", required = false) @RequestParam(required = false) String status,
+                             @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
+                             @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
+                             @ApiParam(value = "预警量min", required = false) @RequestParam(required = false) Integer minWarningCount,
+                             @ApiParam(value = "预警量max", required = false) @RequestParam(required = false) Integer maxWarningCount,
+                             @ApiParam(value = "客户端网络通信状态", required = false) @RequestParam(required = false) String clientWebsocketStatus,
+                             @ApiParam(value = "监控设备通信状态", required = false) @RequestParam(required = false) String monitorStatusSource,
+                             @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
+                             @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+        if (Objects.isNull(examId) || Objects.equals(examId, "")) {
+            throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
+        }
+        if (Objects.isNull(roomCodes) || Objects.equals(roomCodes, "")) {
+            throw new BusinessException(ExceptionResultEnum.ROOMCODE_IS_NULL);
+        }
+        IPage<InvigilateListPatrolBean> invigilateListPatrolBeanIPage = tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodes, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+        BasePage basePage = new BasePage(invigilateListPatrolBeanIPage.getRecords(), invigilateListPatrolBeanIPage.getCurrent(), invigilateListPatrolBeanIPage.getSize(), invigilateListPatrolBeanIPage.getTotal());
+        Map map = new HashMap<>();
+        map.put(SystemConstant.RECORDS, basePage);
+        return ResultUtil.ok(map);
+    }
+
     @ApiOperation(value = "违纪处理接口")
     @RequestMapping(value = "/breach", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})

+ 12 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListBean.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.util.Date;
 
 @ApiModel("实时监控台返回对象")
 public class InvigilateListBean implements Serializable {
@@ -65,6 +66,17 @@ public class InvigilateListBean implements Serializable {
     @ApiModelProperty(name = "是否违纪")
     private Integer breachStatus;
 
+    @ApiModelProperty(name = "更新时间")
+    private Date updateTime;
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 176 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListPatrolBean.java

@@ -0,0 +1,176 @@
+package com.qmth.themis.business.bean.backend;
+
+import com.qmth.themis.business.enums.ExamRecordStatusEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 实时监控台视频返回对象
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2020/8/22
+ */
+@ApiModel("在线巡考返回对象")
+public class InvigilateListPatrolBean implements Serializable {
+
+    @ApiModelProperty(name = "考试id")
+    private Long examId;
+
+    @ApiModelProperty(name = "场次id")
+    private Long examActivityId;
+
+    @ApiModelProperty(name = "考生id")
+    private Long examStudentId;
+
+    @ApiModelProperty(name = "考试记录id")
+    private Long examRecordId;
+
+    @ApiModelProperty(name = "证件号")
+    private String identity;
+
+    @ApiModelProperty(name = "虚拟考场代码")
+    private String roomCode;
+
+    @ApiModelProperty(name = "姓名")
+    private String name;
+
+    @ApiModelProperty(name = "考生状态")
+    private String status;
+
+    @ApiModelProperty(name = "考生状态值")
+    private ExamRecordStatusEnum statusCode;
+
+    @ApiModelProperty(name = "预警量")
+    private Integer warningCount;
+
+    @ApiModelProperty(name = "陌生人脸")
+    private Integer multipleFaceCount;
+
+    @ApiModelProperty(name = "异常处理")
+    private Integer exceptionCount;
+
+    @ApiModelProperty(name = "是否违纪")
+    private Integer breachStatus;
+
+    @ApiModelProperty(name = "更新时间")
+    private Date updateTime;
+
+    public Integer getMultipleFaceCount() {
+        return multipleFaceCount;
+    }
+
+    public void setMultipleFaceCount(Integer multipleFaceCount) {
+        this.multipleFaceCount = multipleFaceCount;
+    }
+
+    public Integer getExceptionCount() {
+        return exceptionCount;
+    }
+
+    public void setExceptionCount(Integer exceptionCount) {
+        this.exceptionCount = exceptionCount;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamActivityId() {
+        return examActivityId;
+    }
+
+    public void setExamActivityId(Long examActivityId) {
+        this.examActivityId = examActivityId;
+    }
+
+    public Long getExamStudentId() {
+        return examStudentId;
+    }
+
+    public void setExamStudentId(Long examStudentId) {
+        this.examStudentId = examStudentId;
+    }
+
+    public Long getExamRecordId() {
+        return examRecordId;
+    }
+
+    public void setExamRecordId(Long examRecordId) {
+        this.examRecordId = examRecordId;
+    }
+
+    public String getIdentity() {
+        return identity;
+    }
+
+    public void setIdentity(String identity) {
+        this.identity = identity;
+    }
+
+    public String getRoomCode() {
+        return roomCode;
+    }
+
+    public void setRoomCode(String roomCode) {
+        this.roomCode = roomCode;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getStatus() {
+        if (statusCode != null) {
+            return statusCode.getCode();
+        }
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public ExamRecordStatusEnum getStatusCode() {
+        return statusCode;
+    }
+
+    public void setStatusCode(ExamRecordStatusEnum statusCode) {
+        this.statusCode = statusCode;
+    }
+
+    public Integer getWarningCount() {
+        return warningCount;
+    }
+
+    public void setWarningCount(Integer warningCount) {
+        this.warningCount = warningCount;
+    }
+
+    public Integer getBreachStatus() {
+        return breachStatus;
+    }
+
+    public void setBreachStatus(Integer breachStatus) {
+        this.breachStatus = breachStatus;
+    }
+}

+ 12 - 0
themis-business/src/main/java/com/qmth/themis/business/bean/backend/InvigilateListVideoBean.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * @Description: 实时监控台视频返回对象
@@ -54,6 +55,17 @@ public class InvigilateListVideoBean implements Serializable {
     @ApiModelProperty(name = "监控观看地址")
     private String monitorLiveUrl;
 
+    @ApiModelProperty(name = "更新时间")
+    private Date updateTime;
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
     public String getMonitorLiveUrl() {
         return monitorLiveUrl;
     }

+ 41 - 11
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
+import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
 import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
 import com.qmth.themis.business.dto.response.TEExamUnFinishDto;
 import com.qmth.themis.business.entity.TOeExamRecord;
@@ -59,16 +60,16 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @return
      */
     public IPage<InvigilateListBean> invigilatePageList(IPage<Map> iPage, @Param("examId") Long examId,
-                                                         @Param("examActivityId") Long examActivityId,
-                                                         @Param("roomCodes") Set roomCodes,
-                                                         @Param("paperDownload") Integer paperDownload,
-                                                         @Param("status") String status,
-                                                         @Param("name") String name,
-                                                         @Param("identity") String identity,
-                                                         @Param("minWarningCount") Integer minWarningCount,
-                                                         @Param("maxWarningCount") Integer maxWarningCount,
-                                                         @Param("clientWebsocketStatus") String clientWebsocketStatus,
-                                                         @Param("monitorStatusSource") String monitorStatusSource);
+                                                        @Param("examActivityId") Long examActivityId,
+                                                        @Param("roomCodes") Set roomCodes,
+                                                        @Param("paperDownload") Integer paperDownload,
+                                                        @Param("status") String status,
+                                                        @Param("name") String name,
+                                                        @Param("identity") String identity,
+                                                        @Param("minWarningCount") Integer minWarningCount,
+                                                        @Param("maxWarningCount") Integer maxWarningCount,
+                                                        @Param("clientWebsocketStatus") String clientWebsocketStatus,
+                                                        @Param("monitorStatusSource") String monitorStatusSource);
 
     /**
      * 查询实时监控台视频列表
@@ -76,7 +77,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodes
      * @param paperDownload
      * @param status
      * @param name
@@ -98,4 +99,33 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                   @Param("maxWarningCount") Integer maxWarningCount,
                                                                   @Param("clientWebsocketStatus") String clientWebsocketStatus,
                                                                   @Param("monitorStatusSource") String monitorStatusSource);
+
+    /**
+     * 查询在线巡考列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @param paperDownload
+     * @param status
+     * @param name
+     * @param identity
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, @Param("examId") Long examId,
+                                                                    @Param("examActivityId") Long examActivityId,
+                                                                    @Param("roomCodes") Set<String> roomCodes,
+                                                                    @Param("paperDownload") Integer paperDownload,
+                                                                    @Param("status") String status,
+                                                                    @Param("name") String name,
+                                                                    @Param("identity") String identity,
+                                                                    @Param("minWarningCount") Integer minWarningCount,
+                                                                    @Param("maxWarningCount") Integer maxWarningCount,
+                                                                    @Param("clientWebsocketStatus") String clientWebsocketStatus,
+                                                                    @Param("monitorStatusSource") String monitorStatusSource);
 }

+ 30 - 0
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -3,6 +3,7 @@ package com.qmth.themis.business.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
+import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
 import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
 import com.qmth.themis.business.entity.TOeExamRecord;
 import com.qmth.themis.business.enums.ExamTypeEnum;
@@ -152,4 +153,33 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                   Integer maxWarningCount,
                                                                   String clientWebsocketStatus,
                                                                   String monitorStatusSource);
+
+    /**
+     * 查询在线巡考列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @param paperDownload
+     * @param status
+     * @param name
+     * @param identity
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, Long examId,
+                                                                    Long examActivityId,
+                                                                    Set<String> roomCodes,
+                                                                    Integer paperDownload,
+                                                                    String status,
+                                                                    String name,
+                                                                    String identity,
+                                                                    Integer minWarningCount,
+                                                                    Integer maxWarningCount,
+                                                                    String clientWebsocketStatus,
+                                                                    String monitorStatusSource);
 }

+ 23 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.themis.business.bean.backend.InvigilateListBean;
+import com.qmth.themis.business.bean.backend.InvigilateListPatrolBean;
 import com.qmth.themis.business.bean.backend.InvigilateListVideoBean;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
@@ -461,4 +462,26 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     public IPage<InvigilateListVideoBean> invigilatePageListVideo(IPage<Map> iPage, Long examId, Long examActivityId, Set<String> roomCodes, Integer paperDownload, String status, String name, String identity, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource) {
         return tOeExamRecordMapper.invigilatePageListVideo(iPage, examId, examActivityId, roomCodes, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
     }
+
+    /**
+     * 查询在线巡考列表
+     *
+     * @param iPage
+     * @param examId
+     * @param examActivityId
+     * @param roomCodes
+     * @param paperDownload
+     * @param status
+     * @param name
+     * @param identity
+     * @param minWarningCount
+     * @param maxWarningCount
+     * @param clientWebsocketStatus
+     * @param monitorStatusSource
+     * @return
+     */
+    @Override
+    public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, Long examId, Long examActivityId, Set<String> roomCodes, Integer paperDownload, String status, String name, String identity, Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String monitorStatusSource) {
+        return tOeExamRecordMapper.invigilatePagePatrolList(iPage, examId, examActivityId, roomCodes, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, monitorStatusSource);
+    }
 }

+ 22 - 0
themis-business/src/main/java/com/qmth/themis/business/service/impl/WarningServiceImpl.java

@@ -1,6 +1,7 @@
 package com.qmth.themis.business.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.dto.WarningDto;
 import com.qmth.themis.business.entity.TEConfig;
@@ -68,6 +69,7 @@ public class WarningServiceImpl implements WarningService {
             if (count >= teConfig.getMultipleFaceCountError()) {
                 TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getDesc(), warningEnum, photoUrl);
                 tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
+                this.setWarningCount(recordId);
             }
         } else if (faceCount <= 0) {//未检测到人脸
             Integer count = faceVerifyHistoryService.faceCountError(recordId, warningDto.getWarningEnum().name(), faceCount, false);
@@ -75,6 +77,7 @@ public class WarningServiceImpl implements WarningService {
             if (count >= teConfig.getNoFaceCountError()) {
                 TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getDesc(), warningEnum, photoUrl);
                 tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
+                this.setWarningCount(recordId);
             }
         }
     }
@@ -100,10 +103,12 @@ public class WarningServiceImpl implements WarningService {
         if (count >= teConfig.getMatchFaceCompareErrorCount()) {
             TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(0), WarningLevelEnum.valueOf(warningEnum.getLevel().get(0)).getDesc(), warningEnum, photoUrl);
             tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
+            this.setWarningCount(recordId);
         }
         if (count >= teConfig.getTotalFaceCompareErrorCount()) {
             TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, warningEnum.getLevel().get(1), WarningLevelEnum.valueOf(warningEnum.getLevel().get(1)).getDesc(), warningEnum, photoUrl);
             tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
+            this.setWarningCount(recordId);
         }
     }
 
@@ -148,6 +153,23 @@ public class WarningServiceImpl implements WarningService {
         if (count > teConfig.getRealnessCount()) {
             TIeInvigilateWarnInfo tIeInvigilateWarnInfo = new TIeInvigilateWarnInfo(examId, examActivityId, recordId, examStudentId, WarningLevelEnum.D15.name(), WarningLevelEnum.D15.getDesc(), warningEnum);
             tIeInvigilateWarnInfoService.saveOrUpdate(tIeInvigilateWarnInfo);
+            this.setWarningCount(recordId);
+        }
+    }
+
+    /**
+     * 设置预警数
+     *
+     * @param recordId
+     */
+    public void setWarningCount(Long recordId) {
+        Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(recordId));
+        if (Objects.nonNull(objectMap.get("warningCount"))) {
+            Integer warningCount = ExamRecordCacheUtil.getWarningCount(recordId);
+            warningCount++;
+            ExamRecordCacheUtil.setWarningCount(recordId, warningCount);
+        } else {
+            ExamRecordCacheUtil.setWarningCount(recordId, 1);
         }
     }
 }

+ 14 - 2
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -101,9 +101,12 @@
             t.monitor_status_source as monitorStatusSource
     </sql>
 
-    <sql id="invigilatePageFoot">
+    <sql id="invigilatePageMiddle">
         from t_oe_exam_record t
         left join t_e_exam_student s on t.exam_student_id = s.id
+    </sql>
+
+    <sql id="invigilatePageFoot">
         <where>
              s.room_code in
             <foreach collection="roomCodes" item="roomCode" index="index" open="(" close=")" separator=",">
@@ -139,18 +142,27 @@
             <if test="monitorStatusSource != null and monitorStatusSource != ''">
                 and t.monitor_status_source = #{monitorStatusSource}
             </if>
-            and t.status = 'ANSWERING'
         </where>
     </sql>
 
     <select id="invigilatePageList" resultType="com.qmth.themis.business.bean.backend.InvigilateListBean">
         <include refid="invigilatePageHead" />
+        <include refid="invigilatePageMiddle" />
         <include refid="invigilatePageFoot" />
     </select>
 
     <select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.backend.InvigilateListVideoBean">
         <include refid="invigilatePageHead" />
         ,t.monitor_live_url as monitorLiveUrl
+        <include refid="invigilatePageMiddle" />
+        <include refid="invigilatePageFoot" />
+    </select>
+
+    <select id="invigilatePagePatrolList" resultType="com.qmth.themis.business.bean.backend.InvigilateListPatrolBean">
+        <include refid="invigilatePageHead" />
+        ,(select count(1) from t_ie_invigilate_exception_info tiiei where tiiei.exam_record_id = t.id) as exceptionCount
+        ,(select count(1) from t_ie_invigilate_warn_info tiiwi where tiiwi.exam_record_id = t.id and tiiwi.`type` = 'FACE_COUNT_ERROR' and tiiwi.`level` = 'D8') as multipleFaceCount
+        <include refid="invigilatePageMiddle" />
         <include refid="invigilatePageFoot" />
     </select>
 </mapper>