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

监考老师逻辑代码和sql优化

wangliang 1 жил өмнө
parent
commit
2ccf14f1b3

+ 67 - 21
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateController.java

@@ -40,6 +40,7 @@ import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import java.io.File;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 监考信息 前端控制器
@@ -124,11 +125,18 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
+        }
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
         }
-        IPage<InvigilateListVideoBean> invigilateListVideoBeanIPage = tOeExamRecordService.invigilatePageListVideo(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, cameraMonitorStatus, screenMonitorStatus, mobileFirstMonitorStatus, mobileSecondMonitorStatus, userId, tbUser.getOrgId());
+        IPage<InvigilateListVideoBean> invigilateListVideoBeanIPage = tOeExamRecordService.invigilatePageListVideo(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodeList, paperDownload, status, name, identity, minWarningCount, maxWarningCount, clientWebsocketStatus, cameraMonitorStatus, screenMonitorStatus, mobileFirstMonitorStatus, mobileSecondMonitorStatus, tbUser.getOrgId());
         if (Objects.nonNull(invigilateListVideoBeanIPage)) {
             List<InvigilateListVideoBean> invigilateListVideoBeanList = invigilateListVideoBeanIPage.getRecords();
             ExamCacheBean examCacheBean = null;
@@ -200,11 +208,14 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
         }
-        List<InvigilateListVideoBean> invigilateListVideoBeanList = tOeExamRecordService.invigilatePageListVideoRandom(examId, userId, randomNum, tbUser.getOrgId());
+        List<InvigilateListVideoBean> invigilateListVideoBeanList = tOeExamRecordService.invigilatePageListVideoRandom(examId, roomCodeList, randomNum, tbUser.getOrgId());
         if (Objects.nonNull(invigilateListVideoBeanList) && invigilateListVideoBeanList.size() > 0) {
             invigilateListVideoBeanList.forEach(s -> {
                 ExamCacheBean examCacheBean = teExamService.getExamCacheBean(s.getExamId());
@@ -260,11 +271,18 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
         }
-        return ResultUtil.ok(tOeExamRecordService.invigilatePageListHistory(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId, tbUser.getOrgId()));
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
+        }
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageListHistory(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodeList, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, tbUser.getOrgId()));
     }
 
     @ApiOperation(value = "监考明细管理列表导出接口")
@@ -288,11 +306,18 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
+        }
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
         }
-        List<InvigilateListHistoryBean> invigilateListHistoryBeanList = tOeExamRecordService.invigilatePageListHistoryExport(examId, examActivityId, roomCode, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId, tbUser.getOrgId());
+        List<InvigilateListHistoryBean> invigilateListHistoryBeanList = tOeExamRecordService.invigilatePageListHistoryExport(examId, examActivityId, roomCodeList, courseCode, status, breachStatus, finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, tbUser.getOrgId());
         ExportUtils.exportEXCEL("监考明细", InvigilateListHistoryBean.class, invigilateListHistoryBeanList, ServletUtil.getResponse());
     }
 
@@ -467,11 +492,18 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
+        }
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
         }
-        IPage<InvigilateListPatrolBean> invigilateListPatrolBeanIPage = tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, userId, tbUser.getOrgId());
+        IPage<InvigilateListPatrolBean> invigilateListPatrolBeanIPage = tOeExamRecordService.invigilatePagePatrolList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodeList, status, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, clientWebsocketStatus, tbUser.getOrgId());
         if (Objects.nonNull(invigilateListPatrolBeanIPage)) {
             List<InvigilateListPatrolBean> invigilateListPatrolBeanList = invigilateListPatrolBeanIPage.getRecords();
             if (Objects.nonNull(invigilateListPatrolBeanList) && invigilateListPatrolBeanList.size() > 0) {
@@ -511,11 +543,18 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
         }
-        return ResultUtil.ok(tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId(), breachStatus));
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
+        }
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageProgressList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodeList, courseCode, name, identity, status, tbUser.getOrgId(), breachStatus));
     }
 
     @ApiOperation(value = "进度查询列表导出接口")
@@ -532,11 +571,18 @@ public class TIeInvigilateController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
+        }
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
         }
-        List<InvigilateListProgressExcelBean> invigilateListProgressExcelBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, tbUser.getOrgId(), breachStatus);
+        List<InvigilateListProgressExcelBean> invigilateListProgressExcelBeanList = tOeExamRecordService.invigilatePageProgressListExport(examId, examActivityId, roomCodeList, courseCode, name, identity, status, tbUser.getOrgId(), breachStatus);
         if (!CollectionUtils.isEmpty(invigilateListProgressExcelBeanList)) {
             for (InvigilateListProgressExcelBean i : invigilateListProgressExcelBeanList) {
                 i.setCourseName(i.getCourseName() + "(" + i.getCourseCode() + ")");

+ 21 - 7
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateWarnInfoController.java

@@ -129,11 +129,18 @@ public class TIeInvigilateWarnInfoController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
+        }
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
         }
-        return ResultUtil.ok(tOeExamRecordService.invigilatePageWarningList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId, tbUser.getOrgId()));
+        return ResultUtil.ok(tOeExamRecordService.invigilatePageWarningList(new Page<>(pageNumber, pageSize), examId, examActivityId, roomCodeList, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, tbUser.getOrgId()));
     }
 
     @ApiOperation(value = "预警消息接口")
@@ -197,13 +204,20 @@ public class TIeInvigilateWarnInfoController {
         TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
         AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
         //如果有监考员角色,只能查看自己所监考的考场,巡考员和管理员则可以查看全部考场
-        Long userId = null;
+        List<String> roomCodeList = new ArrayList<>();
         if (authDto.getRoleCodes().toString().contains(RoleEnum.INVIGILATE.name())) {
-            userId = tbUser.getId();
+            List<TBExamInvigilateUser> tbExamInvigilateUserList = tbExamInvigilateUserService.list(new QueryWrapper<TBExamInvigilateUser>().lambda().eq(TBExamInvigilateUser::getUserId, tbUser.getId()).eq(TBExamInvigilateUser::getExamId, examId));
+            if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
+                roomCodeList = tbExamInvigilateUserList.stream().map(s -> s.getRoomCode()).collect(Collectors.toList());
+            }
+        }
+        if (Objects.nonNull(roomCode)) {
+            roomCodeList.clear();
+            roomCodeList.add(roomCode);
         }
         //2020/11/24新增管理员不清除预警状态
         if (!authDto.getRoleCodes().toString().contains(RoleEnum.ADMIN.name())) {
-            List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.findExamRecordByWarning(examId, examActivityId, roomCode, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId, tbUser.getOrgId());
+            List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.findExamRecordByWarning(examId, examActivityId, roomCodeList, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, tbUser.getOrgId());
             for (TOeExamRecord t : tOeExamRecordList) {
                 tOeExamRecordService.updateWarningUnreadCache(t.getId(), 0, true);
             }
@@ -227,7 +241,7 @@ public class TIeInvigilateWarnInfoController {
                     themisCacheService.updateExamSummaryCache(examId, examActivityId);
                 }
             }
-            tOeExamRecordService.approveStatusListUpdate(examId, examActivityId, roomCode, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId, tbUser.getOrgId());
+            tOeExamRecordService.approveStatusListUpdate(examId, examActivityId, roomCodeList, approveStatus, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, tbUser.getOrgId());
         }
         return ResultUtil.ok(true);
     }

+ 35 - 53
themis-business/src/main/java/com/qmth/themis/business/dao/TOeExamRecordMapper.java

@@ -30,7 +30,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param paperDownload
      * @param status
      * @param name
@@ -42,13 +42,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param screenMonitorStatus
      * @param mobileFirstMonitorStatus
      * @param mobileSecondMonitorStatus
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListVideoBean> invigilatePageListVideo(IPage<Map> iPage, @Param("examId") Long examId,
                                                                   @Param("examActivityId") Long examActivityId,
-                                                                  @Param("roomCode") String roomCode,
+                                                                  @Param("roomCodeList") List<String> roomCodeList,
                                                                   @Param("paperDownload") Integer paperDownload,
                                                                   @Param("status") String status,
                                                                   @Param("name") String name,
@@ -60,19 +59,18 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                   @Param("screenMonitorStatus") String screenMonitorStatus,
                                                                   @Param("mobileFirstMonitorStatus") String mobileFirstMonitorStatus,
                                                                   @Param("mobileSecondMonitorStatus") String mobileSecondMonitorStatus,
-                                                                  @Param("userId") Long userId,
                                                                   @Param("orgId") Long orgId);
 
     /**
      * 实时监控台视频随机列表
      *
      * @param examId
-     * @param userId
+     * @param roomCodeList
      * @param randomNum
      * @param orgId
      * @return
      */
-    public List<InvigilateListVideoBean> invigilatePageListVideoRandom(@Param("examId") Long examId, @Param("userId") Long userId, @Param("randomNum") Integer randomNum, @Param("orgId") Long orgId);
+    public List<InvigilateListVideoBean> invigilatePageListVideoRandom(@Param("examId") Long examId, @Param("roomCodeList") List<String> roomCodeList, @Param("randomNum") Integer randomNum, @Param("orgId") Long orgId);
 
     /**
      * 查询在线巡考列表
@@ -80,7 +78,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param status
      * @param name
      * @param identity
@@ -91,13 +89,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param minWarningCount
      * @param maxWarningCount
      * @param clientWebsocketStatus
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, @Param("examId") Long examId,
                                                                     @Param("examActivityId") Long examActivityId,
-                                                                    @Param("roomCode") String roomCode,
+                                                                    @Param("roomCodeList") List<String> roomCodeList,
                                                                     @Param("status") String status,
                                                                     @Param("name") String name,
                                                                     @Param("identity") String identity,
@@ -108,7 +105,6 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                     @Param("minWarningCount") Integer minWarningCount,
                                                                     @Param("maxWarningCount") Integer maxWarningCount,
                                                                     @Param("clientWebsocketStatus") String clientWebsocketStatus,
-                                                                    @Param("userId") Long userId,
                                                                     @Param("orgId") Long orgId);
 
     /**
@@ -117,7 +113,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param approveStatus
      * @param name
      * @param identity
@@ -127,13 +123,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, @Param("examId") Long examId,
                                                                       @Param("examActivityId") Long examActivityId,
-                                                                      @Param("roomCode") String roomCode,
+                                                                      @Param("roomCodeList") List<String> roomCodeList,
                                                                       @Param("approveStatus") Integer approveStatus,
                                                                       @Param("name") String name,
                                                                       @Param("identity") String identity,
@@ -143,7 +138,6 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                       @Param("maxExceptionCount") Integer maxExceptionCount,
                                                                       @Param("minWarningCount") Integer minWarningCount,
                                                                       @Param("maxWarningCount") Integer maxWarningCount,
-                                                                      @Param("userId") Long userId,
                                                                       @Param("orgId") Long orgId);
 
     /**
@@ -151,7 +145,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param approveStatus
      * @param name
      * @param identity
@@ -161,13 +155,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     public Integer approveStatusListUpdate(@Param("examId") Long examId,
                                            @Param("examActivityId") Long examActivityId,
-                                           @Param("roomCode") String roomCode,
+                                           @Param("roomCodeList") List<String> roomCodeList,
                                            @Param("approveStatus") Integer approveStatus,
                                            @Param("name") String name,
                                            @Param("identity") String identity,
@@ -177,7 +170,6 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                            @Param("maxExceptionCount") Integer maxExceptionCount,
                                            @Param("minWarningCount") Integer minWarningCount,
                                            @Param("maxWarningCount") Integer maxWarningCount,
-                                           @Param("userId") Long userId,
                                            @Param("orgId") Long orgId);
 
     /**
@@ -186,24 +178,22 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param name
      * @param identity
      * @param status
-     * @param userId
      * @param orgId
      * @param breachStatus
      * @return
      */
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, @Param("examId") Long examId,
                                                                         @Param("examActivityId") Long examActivityId,
-                                                                        @Param("roomCode") String roomCode,
+                                                                        @Param("roomCodeList") List<String> roomCodeList,
                                                                         @Param("courseCode") String courseCode,
                                                                         @Param("name") String name,
                                                                         @Param("identity") String identity,
                                                                         @Param("status") Integer status,
-                                                                        @Param("userId") Long userId,
                                                                         @Param("orgId") Long orgId,
                                                                         @Param("breachStatus") Integer breachStatus);
 
@@ -212,24 +202,22 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param name
      * @param identity
      * @param status
-     * @param userId
      * @param orgId
      * @param breachStatus
      * @return
      */
     public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(@Param("examId") Long examId,
                                                                                   @Param("examActivityId") Long examActivityId,
-                                                                                  @Param("roomCode") String roomCode,
+                                                                                  @Param("roomCode") List<String> roomCodeList,
                                                                                   @Param("courseCode") String courseCode,
                                                                                   @Param("name") String name,
                                                                                   @Param("identity") String identity,
                                                                                   @Param("status") Integer status,
-                                                                                  @Param("userId") Long userId,
                                                                                   @Param("orgId") Long orgId,
                                                                                   @Param("breachStatus") Integer breachStatus);
 
@@ -239,7 +227,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param status
      * @param breachStatus
@@ -252,13 +240,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListHistoryBean> invigilatePageListHistory(IPage<Map> iPage, @Param("examId") Long examId,
                                                                       @Param("examActivityId") Long examActivityId,
-                                                                      @Param("roomCode") String roomCode,
+                                                                      @Param("roomCodeList") List<String> roomCodeList,
                                                                       @Param("courseCode") String courseCode,
                                                                       @Param("status") String status,
                                                                       @Param("breachStatus") Integer breachStatus,
@@ -271,7 +258,6 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                                       @Param("maxExceptionCount") Integer maxExceptionCount,
                                                                       @Param("minWarningCount") Integer minWarningCount,
                                                                       @Param("maxWarningCount") Integer maxWarningCount,
-                                                                      @Param("userId") Long userId,
                                                                       @Param("orgId") Long orgId);
 
     /**
@@ -279,7 +265,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param status
      * @param breachStatus
@@ -292,27 +278,25 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
-    public List<InvigilateListHistoryBean> invigilatePageListHistoryExport(Long examId,
-                                                                           Long examActivityId,
-                                                                           String roomCode,
-                                                                           String courseCode,
-                                                                           String status,
-                                                                           Integer breachStatus,
-                                                                           String finishType,
-                                                                           String name,
-                                                                           String identity,
-                                                                           Integer minMultipleFaceCount,
-                                                                           Integer maxMultipleFaceCount,
-                                                                           Integer minExceptionCount,
-                                                                           Integer maxExceptionCount,
-                                                                           Integer minWarningCount,
-                                                                           Integer maxWarningCount,
-                                                                           Long userId,
-                                                                           Long orgId);
+    public List<InvigilateListHistoryBean> invigilatePageListHistoryExport(@Param("examId") Long examId,
+                                                                           @Param("examActivityId") Long examActivityId,
+                                                                           @Param("roomCodeList") List<String> roomCodeList,
+                                                                           @Param("courseCode") String courseCode,
+                                                                           @Param("status") String status,
+                                                                           @Param("breachStatus") Integer breachStatus,
+                                                                           @Param("finishType") String finishType,
+                                                                           @Param("name") String name,
+                                                                           @Param("identity") String identity,
+                                                                           @Param("minMultipleFaceCount") Integer minMultipleFaceCount,
+                                                                           @Param("maxMultipleFaceCount") Integer maxMultipleFaceCount,
+                                                                           @Param("minExceptionCount") Integer minExceptionCount,
+                                                                           @Param("maxExceptionCount") Integer maxExceptionCount,
+                                                                           @Param("minWarningCount") Integer minWarningCount,
+                                                                           @Param("maxWarningCount") Integer maxWarningCount,
+                                                                           @Param("orgId") Long orgId);
 
     @SuppressWarnings("MybatisXMapperMethodInspection")
     public List<Map<String, Object>> getDoneCountByDay(@Param("orgId") Long orgId, @Param("examId") Long examId, @Param("activityId") Long activityId,
@@ -607,7 +591,7 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param name
      * @param identity
      * @param minMultipleFaceCount
@@ -616,13 +600,12 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     List<TOeExamRecord> findExamRecordByWarning(@Param("examId") Long examId,
                                                 @Param("examActivityId") Long examActivityId,
-                                                @Param("roomCode") String roomCode,
+                                                @Param("roomCodeList") List<String> roomCodeList,
                                                 @Param("name") String name,
                                                 @Param("identity") String identity,
                                                 @Param("minMultipleFaceCount") Integer minMultipleFaceCount,
@@ -631,7 +614,6 @@ public interface TOeExamRecordMapper extends BaseMapper<TOeExamRecord> {
                                                 @Param("maxExceptionCount") Integer maxExceptionCount,
                                                 @Param("minWarningCount") Integer minWarningCount,
                                                 @Param("maxWarningCount") Integer maxWarningCount,
-                                                @Param("userId") Long userId,
                                                 @Param("orgId") Long orgId);
 
     /**

+ 20 - 38
themis-business/src/main/java/com/qmth/themis/business/service/TOeExamRecordService.java

@@ -90,7 +90,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param paperDownload
      * @param status
      * @param name
@@ -102,13 +102,12 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param screenMonitorStatus
      * @param mobileFirstMonitorStatus
      * @param mobileSecondMonitorStatus
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListVideoBean> invigilatePageListVideo(IPage<Map> iPage, Long examId,
                                                                   Long examActivityId,
-                                                                  String roomCode,
+                                                                  List<String> roomCodeList,
                                                                   Integer paperDownload,
                                                                   String status,
                                                                   String name,
@@ -120,19 +119,18 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                   String screenMonitorStatus,
                                                                   String mobileFirstMonitorStatus,
                                                                   String mobileSecondMonitorStatus,
-                                                                  Long userId,
                                                                   Long orgId);
 
     /**
      * 实时监控台视频随机列表
      *
      * @param examId
-     * @param userId
+     * @param roomCodeList
      * @param randomNum
      * @param orgId
      * @return
      */
-    public List<InvigilateListVideoBean> invigilatePageListVideoRandom(Long examId, Long userId, Integer randomNum, Long orgId);
+    public List<InvigilateListVideoBean> invigilatePageListVideoRandom(Long examId, List<String> roomCodeList, Integer randomNum, Long orgId);
 
     /**
      * 查询在线巡考列表
@@ -140,7 +138,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param status
      * @param name
      * @param identity
@@ -151,13 +149,12 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param minWarningCount
      * @param maxWarningCount
      * @param clientWebsocketStatus
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, Long examId,
                                                                     Long examActivityId,
-                                                                    String roomCode,
+                                                                    List<String> roomCodeList,
                                                                     String status,
                                                                     String name,
                                                                     String identity,
@@ -168,7 +165,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                     Integer minWarningCount,
                                                                     Integer maxWarningCount,
                                                                     String clientWebsocketStatus,
-                                                                    Long userId,
                                                                     Long orgId);
 
     /**
@@ -177,7 +173,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param approveStatus
      * @param name
      * @param identity
@@ -187,13 +183,12 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, Long examId,
                                                                       Long examActivityId,
-                                                                      String roomCode,
+                                                                      List<String> roomCodeList,
                                                                       Integer approveStatus,
                                                                       String name,
                                                                       String identity,
@@ -203,7 +198,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                       Integer maxExceptionCount,
                                                                       Integer minWarningCount,
                                                                       Integer maxWarningCount,
-                                                                      Long userId,
                                                                       Long orgId);
 
     /**
@@ -211,7 +205,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param approveStatus
      * @param name
      * @param identity
@@ -221,13 +215,12 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     public Integer approveStatusListUpdate(Long examId,
                                            Long examActivityId,
-                                           String roomCode,
+                                           List<String> roomCodeList,
                                            Integer approveStatus,
                                            String name,
                                            String identity,
@@ -237,7 +230,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                            Integer maxExceptionCount,
                                            Integer minWarningCount,
                                            Integer maxWarningCount,
-                                           Long userId,
                                            Long orgId);
 
     /**
@@ -246,24 +238,22 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param name
      * @param identity
      * @param status
-     * @param userId
      * @param orgId
      * @param breachStatus
      * @return
      */
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, Long examId,
                                                                         Long examActivityId,
-                                                                        String roomCode,
+                                                                        List<String> roomCodeList,
                                                                         String courseCode,
                                                                         String name,
                                                                         String identity,
                                                                         Integer status,
-                                                                        Long userId,
                                                                         Long orgId,
                                                                         Integer breachStatus);
 
@@ -272,24 +262,22 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param name
      * @param identity
      * @param status
-     * @param userId
      * @param orgId
      * @param breachStatus
      * @return
      */
     public List<InvigilateListProgressExcelBean> invigilatePageProgressListExport(Long examId,
                                                                                   Long examActivityId,
-                                                                                  String roomCode,
+                                                                                  List<String> roomCodeList,
                                                                                   String courseCode,
                                                                                   String name,
                                                                                   String identity,
                                                                                   Integer status,
-                                                                                  Long userId,
                                                                                   Long orgId,
                                                                                   Integer breachStatus);
 
@@ -299,7 +287,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param status
      * @param breachStatus
@@ -312,13 +300,12 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     public IPage<InvigilateListHistoryBean> invigilatePageListHistory(IPage<Map> iPage, Long examId,
                                                                       Long examActivityId,
-                                                                      String roomCode,
+                                                                      List<String> roomCodeList,
                                                                       String courseCode,
                                                                       String status,
                                                                       Integer breachStatus,
@@ -331,7 +318,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                       Integer maxExceptionCount,
                                                                       Integer minWarningCount,
                                                                       Integer maxWarningCount,
-                                                                      Long userId,
                                                                       Long orgId);
 
     /**
@@ -339,7 +325,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param status
      * @param breachStatus
@@ -352,13 +338,12 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     public List<InvigilateListHistoryBean> invigilatePageListHistoryExport(Long examId,
                                                                            Long examActivityId,
-                                                                           String roomCode,
+                                                                           List<String> roomCodeList,
                                                                            String courseCode,
                                                                            String status,
                                                                            Integer breachStatus,
@@ -371,7 +356,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                                            Integer maxExceptionCount,
                                                                            Integer minWarningCount,
                                                                            Integer maxWarningCount,
-                                                                           Long userId,
                                                                            Long orgId);
 
 
@@ -678,7 +662,7 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param name
      * @param identity
      * @param minMultipleFaceCount
@@ -687,13 +671,12 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     List<TOeExamRecord> findExamRecordByWarning(Long examId,
                                                 Long examActivityId,
-                                                String roomCode,
+                                                List<String> roomCodeList,
                                                 String name,
                                                 String identity,
                                                 Integer minMultipleFaceCount,
@@ -702,7 +685,6 @@ public interface TOeExamRecordService extends IService<TOeExamRecord> {
                                                 Integer maxExceptionCount,
                                                 Integer minWarningCount,
                                                 Integer maxWarningCount,
-                                                Long userId,
                                                 Long orgId);
 
     /**

+ 43 - 53
themis-business/src/main/java/com/qmth/themis/business/service/impl/TOeExamRecordServiceImpl.java

@@ -651,7 +651,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param name
      * @param identity
      * @param minMultipleFaceCount
@@ -660,13 +660,12 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     @Override
-    public List<TOeExamRecord> findExamRecordByWarning(Long examId, Long examActivityId, String roomCode, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, Long userId, Long orgId) {
-        return this.baseMapper.findExamRecordByWarning(examId, examActivityId, roomCode, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, userId, orgId);
+    public List<TOeExamRecord> findExamRecordByWarning(Long examId, Long examActivityId, List<String> roomCodeList, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, Long orgId) {
+        return this.baseMapper.findExamRecordByWarning(examId, examActivityId, roomCodeList, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount, minWarningCount, maxWarningCount, orgId);
     }
 
     /**
@@ -791,7 +790,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param paperDownload
      * @param status
      * @param name
@@ -803,36 +802,35 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param screenMonitorStatus
      * @param mobileFirstMonitorStatus
      * @param mobileSecondMonitorStatus
-     * @param userId
      * @param orgId
      * @return
      */
     @SuppressWarnings("rawtypes")
     @Override
     public IPage<InvigilateListVideoBean> invigilatePageListVideo(IPage<Map> iPage, Long examId, Long examActivityId,
-                                                                  String roomCode, Integer paperDownload, String status, String name, String identity,
+                                                                  List<String> roomCodeList, Integer paperDownload, String status, String name, String identity,
                                                                   Integer minWarningCount, Integer maxWarningCount, String clientWebsocketStatus, String cameraMonitorStatus,
                                                                   String screenMonitorStatus,
                                                                   String mobileFirstMonitorStatus,
-                                                                  String mobileSecondMonitorStatus, Long userId, Long orgId) {
+                                                                  String mobileSecondMonitorStatus, Long orgId) {
         return tOeExamRecordMapper
-                .invigilatePageListVideo(iPage, examId, examActivityId, roomCode, paperDownload, status, name, identity,
-                        minWarningCount, maxWarningCount, clientWebsocketStatus, cameraMonitorStatus, screenMonitorStatus, mobileFirstMonitorStatus, mobileSecondMonitorStatus, userId, orgId);
+                .invigilatePageListVideo(iPage, examId, examActivityId, roomCodeList, paperDownload, status, name, identity,
+                        minWarningCount, maxWarningCount, clientWebsocketStatus, cameraMonitorStatus, screenMonitorStatus, mobileFirstMonitorStatus, mobileSecondMonitorStatus, orgId);
     }
 
     /**
      * 实时监控台视频随机列表
      *
      * @param examId
-     * @param userId
+     * @param roomCodeList
      * @param randomNum
      * @param orgId
      * @return
      */
     @Override
-    public List<InvigilateListVideoBean> invigilatePageListVideoRandom(Long examId, Long userId, Integer randomNum,
+    public List<InvigilateListVideoBean> invigilatePageListVideoRandom(Long examId, List<String> roomCodeList, Integer randomNum,
                                                                        Long orgId) {
-        return tOeExamRecordMapper.invigilatePageListVideoRandom(examId, userId, randomNum, orgId);
+        return tOeExamRecordMapper.invigilatePageListVideoRandom(examId, roomCodeList, randomNum, orgId);
     }
 
     /**
@@ -841,7 +839,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param status
      * @param name
      * @param identity
@@ -852,20 +850,19 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param minWarningCount
      * @param maxWarningCount
      * @param clientWebsocketStatus
-     * @param userId
      * @param orgId
      * @return
      */
     @SuppressWarnings("rawtypes")
     @Override
     public IPage<InvigilateListPatrolBean> invigilatePagePatrolList(IPage<Map> iPage, Long examId, Long examActivityId,
-                                                                    String roomCode, String status, String name, String identity, Integer minMultipleFaceCount,
+                                                                    List<String> roomCodeList, String status, String name, String identity, Integer minMultipleFaceCount,
                                                                     Integer maxMultipleFaceCount, Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount,
-                                                                    Integer maxWarningCount, String clientWebsocketStatus, Long userId, Long orgId) {
+                                                                    Integer maxWarningCount, String clientWebsocketStatus, Long orgId) {
         return tOeExamRecordMapper
-                .invigilatePagePatrolList(iPage, examId, examActivityId, roomCode, status, name, identity,
+                .invigilatePagePatrolList(iPage, examId, examActivityId, roomCodeList, status, name, identity,
                         minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount,
-                        minWarningCount, maxWarningCount, clientWebsocketStatus, userId, orgId);
+                        minWarningCount, maxWarningCount, clientWebsocketStatus, orgId);
     }
 
     /**
@@ -874,7 +871,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param approveStatus
      * @param name
      * @param identity
@@ -884,20 +881,19 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     @SuppressWarnings("rawtypes")
     @Override
     public IPage<InvigilateListWarningBean> invigilatePageWarningList(IPage<Map> iPage, Long examId,
-                                                                      Long examActivityId, String roomCode, Integer approveStatus, String name, String identity,
+                                                                      Long examActivityId, List<String> roomCodeList, Integer approveStatus, String name, String identity,
                                                                       Integer minMultipleFaceCount, Integer maxMultipleFaceCount, Integer minExceptionCount,
-                                                                      Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, Long userId, Long orgId) {
+                                                                      Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount, Long orgId) {
         return tOeExamRecordMapper
-                .invigilatePageWarningList(iPage, examId, examActivityId, roomCode, approveStatus, name, identity,
+                .invigilatePageWarningList(iPage, examId, examActivityId, roomCodeList, approveStatus, name, identity,
                         minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount,
-                        minWarningCount, maxWarningCount, userId, orgId);
+                        minWarningCount, maxWarningCount, orgId);
     }
 
     /**
@@ -905,7 +901,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param approveStatus
      * @param name
      * @param identity
@@ -915,19 +911,18 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     @Override
-    public Integer approveStatusListUpdate(Long examId, Long examActivityId, String roomCode, Integer approveStatus,
+    public Integer approveStatusListUpdate(Long examId, Long examActivityId, List<String> roomCodeList, Integer approveStatus,
                                            String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount,
                                            Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount,
-                                           Long userId, Long orgId) {
+                                           Long orgId) {
         return tOeExamRecordMapper
-                .approveStatusListUpdate(examId, examActivityId, roomCode, approveStatus, name, identity,
+                .approveStatusListUpdate(examId, examActivityId, roomCodeList, approveStatus, name, identity,
                         minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount, maxExceptionCount,
-                        minWarningCount, maxWarningCount, userId, orgId);
+                        minWarningCount, maxWarningCount, orgId);
     }
 
     /**
@@ -936,12 +931,11 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param name
      * @param identity
      * @param status
-     * @param userId
      * @param orgId
      * @param breachStatus
      * @return
@@ -949,10 +943,10 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
     @SuppressWarnings("rawtypes")
     @Override
     public IPage<InvigilateListProgressBean> invigilatePageProgressList(IPage<Map> iPage, Long examId,
-                                                                        Long examActivityId, String roomCode, String courseCode, String name, String identity,
-                                                                        Integer status, Long userId,
+                                                                        Long examActivityId, List<String> roomCodeList, String courseCode, String name, String identity,
+                                                                        Integer status,
                                                                         Long orgId, Integer breachStatus) {
-        IPage<InvigilateListProgressBean> invigilateListProgressBeanIPage = tOeExamRecordMapper.invigilatePageProgressList(iPage, examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId, breachStatus);
+        IPage<InvigilateListProgressBean> invigilateListProgressBeanIPage = tOeExamRecordMapper.invigilatePageProgressList(iPage, examId, examActivityId, roomCodeList, courseCode, name, identity, status, orgId, breachStatus);
         for (InvigilateListProgressBean t : invigilateListProgressBeanIPage.getRecords()) {
             if (Objects.isNull(t.getTencentVideoUrl())) {
                 String videoSource = tmTencentVideoMessageService.videoSourceQuery(t.getExamRecordId());
@@ -989,21 +983,20 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param name
      * @param identity
      * @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, Integer breachStatus) {
-        return tOeExamRecordMapper.invigilatePageProgressListExport(examId, examActivityId, roomCode, courseCode, name, identity, status, userId, orgId, breachStatus);
+                                                                                  List<String> roomCodeList, String courseCode, String name, String identity,
+                                                                                  Integer status, Long orgId, Integer breachStatus) {
+        return tOeExamRecordMapper.invigilatePageProgressListExport(examId, examActivityId, roomCodeList, courseCode, name, identity, status, orgId, breachStatus);
     }
 
     /**
@@ -1012,7 +1005,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param iPage
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param status
      * @param breachStatus
@@ -1025,21 +1018,20 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     @SuppressWarnings("rawtypes")
     @Override
     public IPage<InvigilateListHistoryBean> invigilatePageListHistory(IPage<Map> iPage, Long examId,
-                                                                      Long examActivityId, String roomCode, String courseCode, String status, Integer breachStatus,
+                                                                      Long examActivityId, List<String> roomCodeList, String courseCode, String status, Integer breachStatus,
                                                                       String finishType, String name, String identity, Integer minMultipleFaceCount, Integer maxMultipleFaceCount,
                                                                       Integer minExceptionCount, Integer maxExceptionCount, Integer minWarningCount, Integer maxWarningCount,
-                                                                      Long userId, Long orgId) {
+                                                                      Long orgId) {
         return tOeExamRecordMapper
-                .invigilatePageListHistory(iPage, examId, examActivityId, roomCode, courseCode, status, breachStatus,
+                .invigilatePageListHistory(iPage, examId, examActivityId, roomCodeList, courseCode, status, breachStatus,
                         finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount,
-                        maxExceptionCount, minWarningCount, maxWarningCount, userId, orgId);
+                        maxExceptionCount, minWarningCount, maxWarningCount, orgId);
     }
 
     /**
@@ -1047,7 +1039,7 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      *
      * @param examId
      * @param examActivityId
-     * @param roomCode
+     * @param roomCodeList
      * @param courseCode
      * @param status
      * @param breachStatus
@@ -1060,14 +1052,13 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
      * @param maxExceptionCount
      * @param minWarningCount
      * @param maxWarningCount
-     * @param userId
      * @param orgId
      * @return
      */
     @Override
     public List<InvigilateListHistoryBean> invigilatePageListHistoryExport(Long examId,
                                                                            Long examActivityId,
-                                                                           String roomCode,
+                                                                           List<String> roomCodeList,
                                                                            String courseCode,
                                                                            String status,
                                                                            Integer breachStatus,
@@ -1080,12 +1071,11 @@ public class TOeExamRecordServiceImpl extends ServiceImpl<TOeExamRecordMapper, T
                                                                            Integer maxExceptionCount,
                                                                            Integer minWarningCount,
                                                                            Integer maxWarningCount,
-                                                                           Long userId,
                                                                            Long orgId) {
         return tOeExamRecordMapper
-                .invigilatePageListHistoryExport(examId, examActivityId, roomCode, courseCode, status, breachStatus,
+                .invigilatePageListHistoryExport(examId, examActivityId, roomCodeList, courseCode, status, breachStatus,
                         finishType, name, identity, minMultipleFaceCount, maxMultipleFaceCount, minExceptionCount,
-                        maxExceptionCount, minWarningCount, maxWarningCount, userId, orgId);
+                        maxExceptionCount, minWarningCount, maxWarningCount, orgId);
     }
 
     /**

+ 110 - 133
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -29,10 +29,10 @@
     </sql>
 
     <sql id="invigilatePageMiddle">
-        from t_oe_exam_record t
-		left join t_e_exam_student s on t.id = s.current_record_id
+        from t_e_exam_student s
 		left join t_e_exam tee on tee.id = t.exam_id
 		left join t_e_exam_activity teea on teea.id = t.exam_activity_id
+        left join t_oe_exam_record t on t.id = s.current_record_id
     </sql>
 
     <select id="invigilatePageListVideo" resultType="com.qmth.themis.business.bean.admin.InvigilateListVideoBean">
@@ -67,20 +67,8 @@
         left join t_e_exam tee on tee.id = s.exam_id
         left join t_e_exam_activity teea on teea.id = s.exam_activity_id
         left join t_e_student tes on s.student_id = tes.id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
-        </if>
         left join t_oe_exam_record toer on toer.id = s.current_record_id
         WHERE 1 = 1
-        <if test="examId != null and examId != ''">
-            and s.exam_id = #{examId}
-        </if>
-        <if test="userId != null and userId != ''">
-            and tbeiu.user_id = #{userId}
-        </if>
-        <if test="orgId != null and orgId != ''">
-            and tee.org_id = #{orgId}
-        </if>
         <choose>
             <when test="status != null and status != '' and status == 'UN_FINISH'">
                 and toer.id is null
@@ -89,11 +77,20 @@
                 and toer.id is not null
             </otherwise>
         </choose>
+        <if test="orgId != null and orgId != ''">
+            and tee.org_id = #{orgId}
+        </if>
+        <if test="examId != null and examId != ''">
+            and s.exam_id = #{examId}
+        </if>
         <if test="examActivityId != null and examActivityId != ''">
             and s.exam_activity_id = #{examActivityId}
         </if>
-        <if test="roomCode != null and roomCode != ''">
-            and s.room_code = #{roomCode}
+        <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+            and s.room_code in
+            <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                #{roomCode}
+            </foreach>
         </if>
         <if test="name != null and name !=''">
             and s.name like CONCAT('%', #{name},'%')
@@ -148,13 +145,19 @@
         <!--,t.monitor_live_url as monitorLiveUrl-->
         ,IFNULL(t.warning_count,0) as warningNew
         <include refid="invigilatePageMiddle"/>
-        <where>1 = 1
-            <if test="examId != null and examId != ''">
-                and t.exam_id = #{examId}
-            </if>
+        <where> 1 = 1
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
+            <if test="examId != null and examId != ''">
+                and s.exam_id = #{examId}
+            </if>
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and s.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
+            </if>
             and ((t.status = 'FIRST_PREPARE' and t.client_websocket_status = 'ON_LINE') or t.status in ('ANSWERING',
             'BREAK_OFF', 'RESUME_PREPARE'))
         </where>
@@ -188,21 +191,14 @@
         toer.finish_type as finishType,
         IFNULL(toer.exception_count,0) as exceptionCount,
         IFNULL(toer.warning_multiple_face_count,0) as multipleFaceCount
-        from
-        t_e_exam_student s
+        from t_e_exam_student s
         left join t_e_exam tee on tee.id = s.exam_id
         left join t_e_exam_activity teea on teea.id = s.exam_activity_id
         left join t_e_student tes on s.student_id = tes.id
-        LEFT JOIN t_oe_exam_record toer on toer.exam_student_id = s.id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
-        </if>
+        left join t_oe_exam_record toer on toer.exam_student_id = s.id
         <where> 1 = 1
-            <if test="examId != null and examId != ''">
-                and s.exam_id = #{examId}
-            </if>
-            <if test="userId != null and userId != ''">
-                and tbeiu.user_id = #{userId}
+            <if test="orgId != null and orgId != ''">
+                and tee.org_id = #{orgId}
             </if>
             <choose>
                 <when test="status != null and status != '' and status == 'UN_FINISH'">
@@ -212,14 +208,17 @@
                     and toer.id is not null
                 </otherwise>
             </choose>
-            <if test="orgId != null and orgId != ''">
-                and tee.org_id = #{orgId}
+            <if test="examId != null and examId != ''">
+                and s.exam_id = #{examId}
             </if>
             <if test="examActivityId != null and examActivityId != ''">
-                and toer.exam_activity_id = #{examActivityId}
+                and s.exam_activity_id = #{examActivityId}
             </if>
-            <if test="roomCode != null and roomCode != ''">
-                and s.room_code = #{roomCode}
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and s.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
             </if>
             <if test="name != null and name !=''">
                 and s.name like CONCAT('%', #{name},'%')
@@ -263,6 +262,9 @@
                 and toer.exception_count &lt;= #{maxExceptionCount}
             </if>
         </where>
+        <if test="(examActivityId != null and examActivityId != '') or (roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0)">
+            order by CAST(teea.code AS UNSIGNED),CAST(s.room_code AS UNSIGNED)
+        </if>
     </select>
 
     <select id="invigilatePageWarningList" resultType="com.qmth.themis.business.bean.admin.InvigilateListWarningBean">
@@ -291,24 +293,21 @@
         left join t_e_exam tee on tee.id = tiiwi.exam_id
         left join t_e_exam_activity teea on teea.id = tiiwi.exam_activity_id
         left join t_oe_exam_record toer on toer.id = tiiwi.exam_record_id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
-        </if>
         <where> 1 = 1
-            <if test="examId != null and examId != ''">
-                and tees.exam_id = #{examId}
-            </if>
-            <if test="userId != null and userId != ''">
-                and tbeiu.user_id = #{userId}
-            </if>
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
+            <if test="examId != null and examId != ''">
+                and tees.exam_id = #{examId}
+            </if>
             <if test="examActivityId != null and examActivityId != ''">
-                and toer.exam_activity_id = #{examActivityId}
+                and tees.exam_activity_id = #{examActivityId}
             </if>
-            <if test="roomCode != null and roomCode != ''">
-                and tees.room_code = #{roomCode}
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and tees.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
             </if>
             <if test="approveStatus != null and approveStatus != '' or approveStatus == 0">
                 and tiiwi.approve_status = #{approveStatus}
@@ -339,7 +338,10 @@
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
-        order by tiiwi.approve_status,CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        order by tiiwi.approve_status
+        <if test="(examActivityId != null and examActivityId != '') or (roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0)">
+            ,CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        </if>
     </select>
 
     <update id="approveStatusListUpdate">
@@ -352,24 +354,21 @@
         left join t_e_exam_activity teea on teea.id = tiiwi.exam_activity_id
         left join t_oe_exam_record toer on toer.id = tiiwi.exam_record_id
         left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tee.id
-        </if>
-        <where>1 = 1
-            <if test="examId != null and examId != ''">
-                and tee.id = #{examId}
-            </if>
-            <if test="userId != null and userId != ''">
-                and tbeiu.user_id = #{userId}
-            </if>
+        <where> 1 = 1
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
+            <if test="examId != null and examId != ''">
+                and toer.exam_id = #{examId}
+            </if>
             <if test="examActivityId != null and examActivityId != ''">
-                and teea.id = #{examActivityId}
+                and toer.exam_activity_id = #{examActivityId}
             </if>
-            <if test="roomCode != null and roomCode != ''">
-                and tees.room_code = #{roomCode}
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and tees.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
             </if>
             <if test="approveStatus != null and approveStatus != '' or approveStatus == 0">
                 and tiiwi.approve_status = #{approveStatus}
@@ -430,26 +429,22 @@
         t_e_exam_student tees
         left join t_e_exam tee on tee.id = tees.exam_id
         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_student_id = tees.id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
-        </if>
-        <where>1 = 1
-            <if test="examId != null and examId != ''">
-                and tees.exam_id = #{examId}
-            </if>
-            <if test="userId != null and userId != ''">
-                and tbeiu.user_id = #{userId}
-            </if>
+        <where> 1 = 1
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
+            <if test="examId != null and examId != ''">
+                and tees.exam_id = #{examId}
+            </if>
             <if test="examActivityId != null and examActivityId != ''">
-                and t.exam_activity_id = #{examActivityId}
+                and tees.exam_activity_id = #{examActivityId}
             </if>
-            <if test="roomCode != null and roomCode != ''">
-                and tees.room_code = #{roomCode}
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and tees.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
             </if>
             <if test="courseCode != null and courseCode != ''">
                 and tees.course_code = #{courseCode}
@@ -480,7 +475,7 @@
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
-        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+        <if test="(examActivityId != null and examActivityId != '') or (roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0)">
             order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
         </if>
     </select>
@@ -504,33 +499,25 @@
         if(tees.already_exam_count > 0,'已完成','未完成') as status,
         if(t.breach_status = 0,'违纪','正常') as breachStatus,
         tees.class_no as classNo
-        from
-        t_e_exam_student tees
-        left join t_e_exam tee on
-        tee.id = tees.exam_id
-        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
+        from t_e_exam_student tees
+        left join t_e_exam tee on tee.id = tees.exam_id
+        left join t_e_exam_activity teea on teea.id = tees.exam_activity_id
         left join t_oe_exam_record t on t.exam_student_id = tees.id
-        t.exam_student_id = tees.id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
-        </if>
-        <where>1 = 1
-            <if test="examId != null and examId != ''">
-                and tees.exam_id = #{examId}
-            </if>
-            <if test="userId != null and userId != ''">
-                and tbeiu.user_id = #{userId}
-            </if>
+        <where> 1 = 1
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
+            <if test="examId != null and examId != ''">
+                and tees.exam_id = #{examId}
+            </if>
             <if test="examActivityId != null and examActivityId != ''">
-                and t.exam_activity_id = #{examActivityId}
+                and tees.exam_activity_id = #{examActivityId}
             </if>
-            <if test="roomCode != null and roomCode != ''">
-                and tees.room_code = #{roomCode}
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and s.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
             </if>
             <if test="courseCode != null and courseCode != ''">
                 and tees.course_code = #{courseCode}
@@ -561,14 +548,14 @@
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
-        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+        <if test="(examActivityId != null and examActivityId != '') or (roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0)">
             order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
         </if>
     </select>
 
     <select id="invigilatePageListHistory" resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
         <include refid="invigilatePageListHistorySql"/>
-        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+        <if test="(examActivityId != null and examActivityId != '') or (roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0)">
             order by CAST(teea.code AS UNSIGNED),CAST(s.room_code AS UNSIGNED)
         </if>
     </select>
@@ -601,18 +588,11 @@
         s.class_no as classNo,
         IFNULL(toer.exception_count,0) as exceptionCount,
         IFNULL(toer.warning_multiple_face_count,0) as multipleFaceCount
-        from
-        t_e_exam_student s
-        left join t_e_exam tee on
-        tee.id = s.exam_id
-        left join t_e_exam_activity teea on
-        teea.id = s.exam_activity_id
-        left join t_e_student tes on
-        s.student_id = tes.id
+        from t_e_exam_student s
+        left join t_e_exam tee on tee.id = s.exam_id
+        left join t_e_exam_activity teea on teea.id = s.exam_activity_id
+        left join t_e_student tes on s.student_id = tes.id
         left join t_oe_exam_record toer on toer.exam_student_id = s.id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
-        </if>
         <where> 1 = 1
             <choose>
                 <when test="status != null and status != '' and status == 'UN_FINISH'">
@@ -622,20 +602,20 @@
                     and toer.id is not null
                 </otherwise>
             </choose>
-            <if test="examId != null and examId != ''">
-                and s.exam_id = #{examId}
-            </if>
-            <if test="userId != null and userId != ''">
-                and tbeiu.user_id = #{userId}
-            </if>
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
+            <if test="examId != null and examId != ''">
+                and s.exam_id = #{examId}
+            </if>
             <if test="examActivityId != null and examActivityId != ''">
                 and s.exam_activity_id = #{examActivityId}
             </if>
-            <if test="roomCode != null and roomCode != ''">
-                and s.room_code = #{roomCode}
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and s.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
             </if>
             <if test="name != null and name !=''">
                 and s.name like CONCAT('%', #{name},'%')
@@ -703,7 +683,7 @@
     <select id="invigilatePageListHistoryExport"
             resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
         <include refid="invigilatePageListHistorySql"/>
-        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+        <if test="(examActivityId != null and examActivityId != '') or (roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0)">
             order by CAST(teea.code AS UNSIGNED),CAST(s.room_code AS UNSIGNED)
         </if>
     </select>
@@ -1701,24 +1681,21 @@
         left join t_e_exam tee on tee.id = toer.exam_id
         left join t_e_exam_activity teea on teea.id = toer.exam_activity_id
         left join t_e_exam_student tees on tees.id = toer.exam_student_id
-        <if test="userId != null and userId != ''">
-            left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tee.id
-        </if>
-        <where>1 = 1
-            <if test="examId != null and examId != ''">
-                and tee.id = #{examId}
-            </if>
-            <if test="userId != null and userId != ''">
-                and tbeiu.user_id = #{userId}
-            </if>
+        <where> 1 = 1
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
             </if>
+            <if test="examId != null and examId != ''">
+                and toer.exam_id = #{examId}
+            </if>
             <if test="examActivityId != null and examActivityId != ''">
-                and teea.id = #{examActivityId}
+                and toer.exam_activity_id = #{examActivityId}
             </if>
-            <if test="roomCode != null and roomCode != ''">
-                and tees.room_code = #{roomCode}
+            <if test="roomCodeList != null and roomCodeList != '' and roomCodeList.size > 0">
+                and tees.room_code in
+                <foreach collection="roomCodeList" item="roomCode" index="index" open="(" close=")" separator=",">
+                    #{roomCode}
+                </foreach>
             </if>
             <if test="name != null and name !=''">
                 and tees.name like CONCAT('%', #{name},'%')