Эх сурвалжийг харах

实时监控台加入场次信息

wangliang 2 жил өмнө
parent
commit
035f1c5134

+ 4 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/SysController.java

@@ -447,7 +447,10 @@ public class SysController {
                     map.put(SystemConstant.COURSE_NAME, s.getCourseName());
                     finalCourseSet.add(map);
                 });
-                teExamActivityList = teExamActivityService.listByIds(examActivityIdSet);
+                QueryWrapper<TEExamActivity> teExamActivityQueryWrapper = new QueryWrapper<>();
+                teExamActivityQueryWrapper.lambda().in(TEExamActivity::getId, examActivityIdSet);
+                teExamActivityQueryWrapper.lambda().last(" order by CAST(code AS UNSIGNED) ");
+                teExamActivityList = teExamActivityService.list(teExamActivityQueryWrapper);
             }
         }
         Map map = new HashMap();

+ 4 - 3
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -445,7 +445,8 @@ public class TEExamController {
     @ApiOperation(value = "考试属性统计接口")
     @RequestMapping(value = "/prop/count", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试属性信息", response = ExamPropCountDto.class)})
-    public Result propCount(@ApiParam(value = "考试id", required = true) @RequestParam Long examId) {
+    public Result propCount(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
+                            @ApiParam(value = "考试场次id") @RequestParam(required = false) Long examActivityId) {
 //        long start = System.currentTimeMillis();
         if (Objects.isNull(examId) || Objects.equals(examId, "")) {
             throw new BusinessException(ExceptionResultEnum.EXAM_ID_IS_NULL);
@@ -477,13 +478,13 @@ public class TEExamController {
         AtomicReference<ExamPropCountDto> examPropCountDto = new AtomicReference(new ExamPropCountDto(examId, 0, 0, 0, 0, 0, 0, 0, new BigDecimal(0)));
         if (Objects.nonNull(roomCodeSet) && roomCodeSet.size() > 0) {
             //根据roomCode获取当前老师所要监考的全部应考学生数
-            List<CountStopBean> countStopBeanList = tOeExamRecordService.findByStopInfo(examId, roomCodeSet);
+            List<CountStopBean> countStopBeanList = tOeExamRecordService.findByStopInfo(examId, roomCodeSet, examActivityId);
             if (Objects.nonNull(countStopBeanList) && countStopBeanList.size() > 0) {
                 examPropCountDto.get().setClientWebsocketStatusCount(countStopBeanList.get(0).getOffCount());
                 examPropCountDto.get().setMonitorStatusSourceCount(countStopBeanList.get(0).getStopCount());
                 examPropCountDto.get().setAllCount(countStopBeanList.get(0).getAllCount());
             }
-            List<Integer> list = tOeExamRecordService.findByOnlineInfo(examId, roomCodeSet);
+            List<Integer> list = tOeExamRecordService.findByOnlineInfo(examId, roomCodeSet, examActivityId);
             if (Objects.nonNull(list) && list.size() > 0) {
                 examPropCountDto.get().setPrepareCount(list.get(0));
                 examPropCountDto.get().setExamCount(list.get(1));

+ 5 - 3
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateController.java

@@ -473,6 +473,7 @@ public class TIeInvigilateController {
                                @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
                                @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
                                @ApiParam(value = "状态", required = false) @RequestParam(required = false) Integer status,
+                               @ApiParam(value = "违纪状态,0:违纪,1:正常", required = false) @RequestParam(required = false) Integer breachStatus,
                                @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) int pageNumber,
                                @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) int pageSize) {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
@@ -482,7 +483,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        return ResultUtil.ok(tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId()));
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId(), breachStatus));
     }
 
     @ApiOperation(value = "进度查询列表导出接口")
@@ -494,7 +495,8 @@ public class TIeInvigilateController {
                                    @ApiParam(value = "科目代码", required = false) @RequestParam(required = false) String courseCode,
                                    @ApiParam(value = "姓名", required = false) @RequestParam(required = false) String name,
                                    @ApiParam(value = "证件号", required = false) @RequestParam(required = false) String identity,
-                                   @ApiParam(value = "状态", required = false) @RequestParam(required = false) Integer status) throws Exception {
+                                   @ApiParam(value = "状态", required = false) @RequestParam(required = false) Integer status,
+                                   @ApiParam(value = "违纪状态,0:违纪,1:正常", required = false) @RequestParam(required = false) Integer breachStatus) throws Exception {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
@@ -502,7 +504,7 @@ public class TIeInvigilateController {
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
             userId = tbUser.getId();
         }
-        List<InvigilateListProgressExcelBean> invigilateListProgressExcelBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId());
+        List<InvigilateListProgressExcelBean> invigilateListProgressExcelBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId(), breachStatus);
         ExportUtils.exportEXCEL("进度信息", InvigilateListProgressExcelBean.class, invigilateListProgressExcelBeanList, ServletUtil.getResponse());
     }
 

+ 37 - 9
themis-business/src/main/java/com/qmth/themis/business/bean/admin/InvigilateListProgressBean.java

@@ -2,10 +2,12 @@ package com.qmth.themis.business.bean.admin;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.themis.business.excel.ExcelProperty;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 /**
  * @Description: 进度查询返回对象
@@ -54,8 +56,8 @@ public class InvigilateListProgressBean implements Serializable {
     @ApiModelProperty(name = "考生状态")
     private String status;
 
-    @ApiModelProperty(name = "联系电话")
-    private String mobileNumber;
+//    @ApiModelProperty(name = "联系电话")
+//    private String mobileNumber;
 
     @ApiModelProperty(name = "科目名称")
     private String courseName;
@@ -78,6 +80,32 @@ public class InvigilateListProgressBean implements Serializable {
     @ApiModelProperty(name = "非分段视频源")
     private String tencentVideoUrl;
 
+    @ApiModelProperty(name = "是否违纪")
+    private Integer breachStatus;
+
+    @ApiModelProperty(name = "是否违纪")
+    private String breachStatusStr;
+
+    public Integer getBreachStatus() {
+        return breachStatus;
+    }
+
+    public void setBreachStatus(Integer breachStatus) {
+        this.breachStatus = breachStatus;
+    }
+
+    public String getBreachStatusStr() {
+        if (Objects.nonNull(breachStatus)) {
+            return breachStatus.intValue() == 1 ? "正常" : "违纪";
+        } else {
+            return breachStatusStr;
+        }
+    }
+
+    public void setBreachStatusStr(String breachStatusStr) {
+        this.breachStatusStr = breachStatusStr;
+    }
+
     public Integer getVideoCount() {
         return videoCount;
     }
@@ -214,13 +242,13 @@ public class InvigilateListProgressBean implements Serializable {
         this.status = status;
     }
 
-    public String getMobileNumber() {
-        return mobileNumber;
-    }
-
-    public void setMobileNumber(String mobileNumber) {
-        this.mobileNumber = mobileNumber;
-    }
+//    public String getMobileNumber() {
+//        return mobileNumber;
+//    }
+//
+//    public void setMobileNumber(String mobileNumber) {
+//        this.mobileNumber = mobileNumber;
+//    }
 
     public Integer getLeftExamCount() {
         return leftExamCount;

+ 32 - 20
themis-business/src/main/java/com/qmth/themis/business/bean/admin/InvigilateListProgressExcelBean.java

@@ -23,34 +23,46 @@ public class InvigilateListProgressExcelBean implements Serializable {
     @ExcelProperty(name = "场次名称(代码)", width = 30, index = 2)
     private String examActivityCode;
 
-    @ApiModelProperty(name = "证件号")
-    @ExcelProperty(name = "证件号", width = 30, index = 4)
-    private String identity;
-
     @ApiModelProperty(name = "虚拟考场名称")
     @ExcelProperty(name = "考场名称(代码)", width = 30, index = 3)
     private String roomName;
 
+    @ApiModelProperty(name = "证件号")
+    @ExcelProperty(name = "证件号", width = 30, index = 4)
+    private String identity;
+
     @ApiModelProperty(name = "姓名")
     @ExcelProperty(name = "姓名", width = 30, index = 5)
     private String name;
 
-    @ApiModelProperty(name = "考生状态")
-    @ExcelProperty(name = "完成状态", width = 30, index = 9)
-    private String status;
-
-    @ApiModelProperty(name = "联系电话")
-    @ExcelProperty(name = "联系电话", width = 30, index = 6)
-    private String mobileNumber;
+//    @ApiModelProperty(name = "联系电话")
+//    @ExcelProperty(name = "联系电话", width = 30, index = 6)
+//    private String mobileNumber;
 
     @ApiModelProperty(name = "科目名称")
-    @ExcelProperty(name = "科目(代码)", width = 30, index = 7)
+    @ExcelProperty(name = "科目(代码)", width = 30, index = 6)
     private String courseName;
 
     @ApiModelProperty(value = "剩余考试次数")
-    @ExcelProperty(name = "剩余考试次数", width = 30, index = 8)
+    @ExcelProperty(name = "剩余考试次数", width = 30, index = 7)
     private Integer leftExamCount;
 
+    @ApiModelProperty(name = "考生状态")
+    @ExcelProperty(name = "完成状态", width = 30, index = 8)
+    private String status;
+
+    @ApiModelProperty(name = "违纪状态")
+    @ExcelProperty(name = "违纪状态", width = 30, index = 9)
+    private String breachStatus;
+
+    public String getBreachStatus() {
+        return breachStatus;
+    }
+
+    public void setBreachStatus(String breachStatus) {
+        this.breachStatus = breachStatus;
+    }
+
     public String getRoomName() {
         return roomName;
     }
@@ -107,13 +119,13 @@ public class InvigilateListProgressExcelBean implements Serializable {
         this.status = status;
     }
 
-    public String getMobileNumber() {
-        return mobileNumber;
-    }
-
-    public void setMobileNumber(String mobileNumber) {
-        this.mobileNumber = mobileNumber;
-    }
+//    public String getMobileNumber() {
+//        return mobileNumber;
+//    }
+//
+//    public void setMobileNumber(String mobileNumber) {
+//        this.mobileNumber = mobileNumber;
+//    }
 
     public Integer getLeftExamCount() {
         return leftExamCount;

+ 10 - 5
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -193,6 +193,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param status
      * @param userId
      * @param orgId
+     * @param breachStatus
      * @return
      */
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, @Param("examId") Long examId,
@@ -203,7 +204,8 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                         @Param("identity") String identity,
                                                                         @Param("status") Integer status,
                                                                         @Param("userId") Long userId,
-                                                                        @Param("orgId") Long orgId);
+                                                                        @Param("orgId") Long orgId,
+                                                                        @Param("breachStatus") Integer breachStatus);
 
     /**
      * 进度查询列表导出
@@ -217,6 +219,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param status
      * @param userId
      * @param orgId
+     * @param breachStatus
      * @return
      */
     public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(@Param("examId") Long examId,
@@ -227,7 +230,8 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                                   @Param("identity") String identity,
                                                                                   @Param("status") Integer status,
                                                                                   @Param("userId") Long userId,
-                                                                                  @Param("orgId") Long orgId);
+                                                                                  @Param("orgId") Long orgId,
+                                                                                  @Param("breachStatus") Integer breachStatus);
 
     /**
      * 监考明细管理列表
@@ -429,16 +433,17 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param roomCodeSet
      * @return
      */
-    List<CountStopBean> findByStopInfo(@Param("examId") Long examId, @Param("roomCodeSet") Set<String> roomCodeSet);
+    List<CountStopBean> findByStopInfo(@Param("examId") Long examId, @Param("roomCodeSet") Set<String> roomCodeSet, @Param("examActivityId") Long examActivityId);
 
     /**
      * 查找在线消息
      *
      * @param examId
      * @param roomCodeSet
+     * @param examActivityId
      * @return
      */
-    List<Integer> findByOnlineInfo(@Param("examId") Long examId, @Param("roomCodeSet") Set<String> roomCodeSet);
+    List<Integer> findByOnlineInfo(@Param("examId") Long examId, @Param("roomCodeSet") Set<String> roomCodeSet, @Param("examActivityId") Long examActivityId);
 
     /**
      * 管理员报表
@@ -540,7 +545,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param examStudentBreachPush
      * @return
      */
-    public List<TOeExamRecord> findExamRecordNeedMarkAll(@Param("examId") Long examId, @Param("examPaperIdSet") Set<Long> examPaperIdSet, @Param("many") Boolean many,@Param("examStudentBreachPush") Boolean examStudentBreachPush);
+    public List<TOeExamRecord> findExamRecordNeedMarkAll(@Param("examId") Long examId, @Param("examPaperIdSet") Set<Long> examPaperIdSet, @Param("many") Boolean many, @Param("examStudentBreachPush") Boolean examStudentBreachPush);
 
     /**
      * 修正作答记录缓存到数据库

+ 10 - 4
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -237,6 +237,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param status
      * @param userId
      * @param orgId
+     * @param breachStatus
      * @return
      */
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, Long examId,
@@ -247,7 +248,8 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                         String identity,
                                                                         Integer status,
                                                                         Long userId,
-                                                                        Long orgId);
+                                                                        Long orgId,
+                                                                        Integer breachStatus);
 
     /**
      * 进度查询列表导出
@@ -261,6 +263,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param status
      * @param userId
      * @param orgId
+     * @param breachStatus
      * @return
      */
     public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(Long examId,
@@ -271,7 +274,8 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                                   String identity,
                                                                                   Integer status,
                                                                                   Long userId,
-                                                                                  Long orgId);
+                                                                                  Long orgId,
+                                                                                  Integer breachStatus);
 
     /**
      * 监考明细管理列表
@@ -430,18 +434,20 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      *
      * @param examId
      * @param roomCodeSet
+     * @param examActivityId
      * @return
      */
-    List<CountStopBean> findByStopInfo(Long examId, Set<String> roomCodeSet);
+    List<CountStopBean> findByStopInfo(Long examId, Set<String> roomCodeSet, Long examActivityId);
 
     /**
      * 查找在线消息
      *
      * @param examId
      * @param roomCodeSet
+     * @param examActivityId \
      * @return
      */
-    List<Integer> findByOnlineInfo(Long examId, Set<String> roomCodeSet);
+    List<Integer> findByOnlineInfo(Long examId, Set<String> roomCodeSet, Long examActivityId);
 
     /**
      * 管理员报表

+ 12 - 8
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -723,6 +723,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param status
      * @param userId
      * @param orgId
+     * @param breachStatus
      * @return
      */
     @SuppressWarnings("rawtypes")
@@ -730,8 +731,8 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, Long examId,
                                                                         Long examActivityId, String roomCode, String courseCode, String name, String identity,
                                                                         Integer status, Long userId,
-                                                                        Long orgId) {
-        IPage<InvigilateListProgressBean> invigilateListProgressBeanIPage = tOeExamRecordMapper.invigilatePageProgressList(iPage, examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId);
+                                                                        Long orgId, Integer breachStatus) {
+        IPage<InvigilateListProgressBean> invigilateListProgressBeanIPage = tOeExamRecordMapper.invigilatePageProgressList(iPage, examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId, breachStatus);
         for (InvigilateListProgressBean t : invigilateListProgressBeanIPage.getRecords()) {
             if (Objects.nonNull(t.getTencentVideoUrl()) && !Objects.equals(t.getTencentVideoUrl().trim(), "")) {
                 List<TEStudentMonitorRecordDto> monitorRecordList = GsonUtil.fromJson(t.getTencentVideoUrl(), new TypeToken<List<TEStudentMonitorRecordDto>>() {
@@ -765,13 +766,14 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param status
      * @param userId
      * @param orgId
+     * @param breachStatus
      * @return
      */
     @Override
     public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(Long examId, Long examActivityId,
                                                                                   String roomCode, String courseCode, String name, String identity,
-                                                                                  Integer status, Long userId, Long orgId) {
-        return tOeExamRecordMapper.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId);
+                                                                                  Integer status, Long userId, Long orgId, Integer breachStatus) {
+        return tOeExamRecordMapper.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId, breachStatus);
     }
 
     /**
@@ -1230,11 +1232,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      *
      * @param examId
      * @param roomCodeSet
+     * @param examActivityId
      * @return
      */
     @Override
-    public List<CountStopBean> findByStopInfo(Long examId, Set<String> roomCodeSet) {
-        return tOeExamRecordMapper.findByStopInfo(examId, roomCodeSet);
+    public List<CountStopBean> findByStopInfo(Long examId, Set<String> roomCodeSet, Long examActivityId) {
+        return tOeExamRecordMapper.findByStopInfo(examId, roomCodeSet, examActivityId);
     }
 
     /**
@@ -1242,11 +1245,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      *
      * @param examId
      * @param roomCodeSet
+     * @param examActivityId
      * @return
      */
     @Override
-    public List<Integer> findByOnlineInfo(Long examId, Set<String> roomCodeSet) {
-        return tOeExamRecordMapper.findByOnlineInfo(examId, roomCodeSet);
+    public List<Integer> findByOnlineInfo(Long examId, Set<String> roomCodeSet, Long examActivityId) {
+        return tOeExamRecordMapper.findByOnlineInfo(examId, roomCodeSet, examActivityId);
     }
 
     /**

+ 58 - 12
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -588,7 +588,7 @@
         (select count(1) from t_oe_exam_record toer where toer.exam_student_id =
         tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') and toer.first_start_time is not null) as
         statusTemp,
-        tes.mobile_number as mobileNumber,
+        <!--tes.mobile_number as mobileNumber,-->
         t.id as examRecordId,
         IFNULL(IF(t.tencent_video_url is not null, 1, null),(
         select
@@ -599,7 +599,8 @@
         tmtvm.exam_record_id = t.id)) as videoCount,
         t.monitor_record as monitorRecord,
         (select GROUP_CONCAT(tmtvm.video_source) from t_m_tencent_video_message tmtvm where tmtvm.exam_record_id = t.id) as videoSource,
-        t.tencent_video_url as tencentVideoUrl
+        t.tencent_video_url as tencentVideoUrl,
+        IFNULL(t.breach_status,1) as breachStatus
         from
         t_e_exam_student tees
         left join t_e_exam tee on
@@ -648,6 +649,14 @@
                     </otherwise>
                 </choose>
             </if>
+            <if test="breachStatus != null and breachStatus != '' or breachStatus == 0">
+                <if test="breachStatus == 0">
+                    and t.breachStatus = #{breachStatus}
+                </if>
+                <if test="breachStatus == 1">
+                    and (t.breachStatus = #{breachStatus} or t.breachStatus is null)
+                </if>
+            </if>
         </where>
         order by t.roomCode
     </select>
@@ -658,7 +667,10 @@
         *,
         if(t.statusTemp > 0,
         '已完成',
-        '未完成') as status
+        '未完成') as status,
+        if(t.breachStatusTemp = 0,
+        '违纪',
+        '正常') as breachStatus
         from
         (select
         distinct tee.id as examId,
@@ -675,7 +687,8 @@
         (select count(1) from t_oe_exam_record toer where toer.exam_student_id =
         tees.id and (toer.status = 'FINISHED' or toer.status = 'PERSISTED') and toer.first_start_time is not null) as
         statusTemp,
-        tes.mobile_number as mobileNumber
+        <!--tes.mobile_number as mobileNumber,-->
+        t.breach_status as breachStatusTemp
         from
         t_e_exam_student tees
         left join t_e_exam tee on
@@ -683,6 +696,7 @@
         left join t_e_exam_activity teea on
         teea.id = tees.exam_activity_id
         left join t_e_student tes on tees.student_id = tes.id
+        left join t_oe_exam_record t on t.exam_id = tees.exam_id and t.exam_activity_id = tees.exam_activity_id and t.exam_student_id = tees.id
         <where>1 = 1
             <if test="examId != null and examId != ''">
                 and tees.exam_id = #{examId}
@@ -713,7 +727,7 @@
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
         group by
-        tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number)
+        tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number,t.breach_status)
         t
         <where>
             <if test="status != null and status != '' or status == 0">
@@ -726,6 +740,14 @@
                     </otherwise>
                 </choose>
             </if>
+            <if test="breachStatus != null and breachStatus != '' or breachStatus == 0">
+                <if test="breachStatus == 0">
+                    and t.breachStatus = #{breachStatus}
+                </if>
+                <if test="breachStatus == 1">
+                    and (t.breachStatus = #{breachStatus} or t.breachStatus is null)
+                </if>
+            </if>
         </where>
         order by t.roomCode
     </select>
@@ -1304,16 +1326,20 @@
         t_oe_exam_record t
         left join t_e_exam_student s on
         t.exam_student_id = s.id
-        where
+        <where>
         t.exam_id = #{examId}
         and s.room_code in
         <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
             #{roomCode}
         </foreach>
+        <if test="examActivityId != null and examActivityId != ''">
+            and t.exam_activity_id = #{examActivityId}
+        </if>
         and (t.STATUS = 'FIRST_PREPARE'
         or t.STATUS = 'ANSWERING'
         or t.STATUS = 'BREAK_OFF'
         or t.STATUS = 'RESUME_PREPARE')
+        </where>
         group by
         t.client_websocket_status,
         t.camera_monitor_status,
@@ -1331,12 +1357,16 @@
         count(1) as allCount
         from
         t_e_exam_student t
-        where
+        <where>
         t.exam_id = #{examId}
         and t.room_code in
         <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
             #{roomCode}
-        </foreach>) t
+        </foreach>
+        <if test="examActivityId != null and examActivityId != ''">
+            and t.exam_activity_id = #{examActivityId}
+        </if>
+        </where>) t
     </select>
 
     <select id="findByOnlineInfo" resultType="java.lang.Integer">
@@ -1346,13 +1376,17 @@
         t_oe_exam_record t
         left join t_e_exam_student s on
         t.exam_student_id = s.id
-        where
+        <where>
         t.exam_id = #{examId}
         and s.room_code in
         <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
             #{roomCode}
         </foreach>
+        <if test="examActivityId != null and examActivityId != ''">
+            and t.exam_activity_id = #{examActivityId}
+        </if>
         and t.STATUS = 'FIRST_PREPARE'
+        </where>
         union all
         select
         count(1) as c
@@ -1360,15 +1394,19 @@
         t_oe_exam_record t
         left join t_e_exam_student s on
         t.exam_student_id = s.id
-        where
+        <where>
         t.exam_id = #{examId}
         and s.room_code in
         <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
             #{roomCode}
         </foreach>
+        <if test="examActivityId != null and examActivityId != ''">
+            and t.exam_activity_id = #{examActivityId}
+        </if>
         and ((t.STATUS = 'ANSWERING' and t.client_websocket_status = 'ON_LINE')
         or t.STATUS = 'RESUME_PREPARE'
         or t.STATUS = 'BREAK_OFF')
+        </where>
         union all
         select
         count(distinct t.exam_student_id) as c
@@ -1376,14 +1414,18 @@
         t_oe_exam_record t
         left join t_e_exam_student s on
         t.exam_student_id = s.id
-        where
+        <where>
         t.exam_id = #{examId}
         and s.room_code in
         <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
             #{roomCode}
         </foreach>
+        <if test="examActivityId != null and examActivityId != ''">
+            and t.exam_activity_id = #{examActivityId}
+        </if>
         and (t.STATUS = 'FINISHED'
         or t.STATUS = 'PERSISTED') and t.first_start_time is not null
+        </where>
         union all
         select
         count(distinct t.id) as c
@@ -1399,13 +1441,17 @@
         toer.exam_student_id
         from
         t_oe_exam_record toer
-        where
+        <where>
         t.id = toer.exam_student_id)
         and t.exam_id = #{examId}
         and t.room_code in
         <foreach collection="roomCodeSet" item="roomCode" index="index" open="(" close=")" separator=",">
             #{roomCode}
         </foreach>
+        <if test="examActivityId != null and examActivityId != ''">
+            and t.exam_activity_id = #{examActivityId}
+        </if>
+        </where>
     </select>
 
     <select id="findByViewAdmin" resultType="java.lang.Integer">