Browse Source

BUG修改

wangliang 2 years ago
parent
commit
d34830c4eb

+ 8 - 2
server/src/main/java/com/qmth/jkserver/dao/ExamRepeatRecordDao.java

@@ -10,8 +10,14 @@ import java.util.Set;
 
 public interface ExamRepeatRecordDao extends BaseMapper<ExamRepeatRecord> {
 
-    public IPage<ExamRepeatRecord> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeByIpage(IPage<Map> iPage, @Param("examCode") String examCode,
+    public Long findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByCount(@Param("examCode") String examCode,
+                                                                                                      @Param("batchId") String batchId,
+                                                                                                      @Param("placeCodeSet") Set<String> placeCodeSet,
+                                                                                                      @Param("roomCode") String roomCode,
+                                                                                                      @Param("placeName") String placeName);
+    public IPage<ExamRepeatRecord> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage(IPage<Map> iPage, @Param("examCode") String examCode,
                                                                                           @Param("batchId") String batchId,
                                                                                           @Param("placeCodeSet") Set<String> placeCodeSet,
-                                                                                          @Param("roomCode") String roomCode);
+                                                                                          @Param("roomCode") String roomCode,
+                                                                                          @Param("placeName") String placeName);
 }

+ 6 - 4
server/src/main/java/com/qmth/jkserver/dao/ExamStudentAnswerDao.java

@@ -52,16 +52,17 @@ public interface ExamStudentAnswerDao extends BaseMapper<ExamStudentAnswer> {
 
     public Long findByExamCodeAndPlaceCodeAndRoomCodeCount(@Param("examCode") String examCode, @Param("placeCode") String placeCode, @Param("roomCode") String roomCode);
 
-    public Long findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(@Param("examCode") String examCode,
+    public Long findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(@Param("examCode") String examCode,
                                                                                                         @Param("stageId") String stageId,
                                                                                                         @Param("batchId") String batchId,
                                                                                                         @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                                         @Param("roomCode") String roomCode,
                                                                                                         @Param("absent") Boolean absent,
                                                                                                         @Param("cheat") Boolean cheat,
-                                                                                                        @Param("abort") Boolean abort);
+                                                                                                        @Param("abort") Boolean abort,
+                                                                                                        @Param("placeName") String placeName);
 
-    public IPage<Map> findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortByIpage(IPage<Map> iPage,
+    public IPage<Map> findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameByIpage(IPage<Map> iPage,
                                                                                                                 @Param("examCode") String examCode,
                                                                                                                 @Param("stageId") String stageId,
                                                                                                                 @Param("batchId") String batchId,
@@ -69,7 +70,8 @@ public interface ExamStudentAnswerDao extends BaseMapper<ExamStudentAnswer> {
                                                                                                                 @Param("roomCode") String roomCode,
                                                                                                                 @Param("absent") Boolean absent,
                                                                                                                 @Param("cheat") Boolean cheat,
-                                                                                                                @Param("abort") Boolean abort);
+                                                                                                                @Param("abort") Boolean abort,
+                                                                                                                @Param("placeName") String placeName);
 
     public List<ExamStudentAnswer> findByExamCodeByTicketNo(@Param("examCode") String examCode);
 

+ 9 - 4
server/src/main/java/com/qmth/jkserver/dao/ExamStudentDao.java

@@ -53,19 +53,19 @@ public interface ExamStudentDao extends BaseMapper<ExamStudent> {
     public IPage<Map> findByExamCodeByMap(IPage<Map> iPage, @Param("examCode") String examCode);
 
     @SuppressWarnings("MybatisXMapperMethodInspection")
-    public List<Map> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndBatchName(@Param("examCode") String examCode,
+    public List<Map> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceName(@Param("examCode") String examCode,
                                                                                  @Param("batchId") String batchId,
                                                                                  @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                  @Param("roomCode") String roomCode,
-                                                                                 @Param("batchName") String batchName);
+                                                                                 @Param("placeName") String placeName);
 
     @SuppressWarnings("MybatisXMapperMethodInspection")
-    public IPage<Map> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndBatchNameByIpage(@Param("iPage") IPage<Map> iPage,
+    public IPage<Map> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage(IPage<Map> iPage,
                                                                                          @Param("examCode") String examCode,
                                                                                          @Param("batchId") String batchId,
                                                                                          @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                          @Param("roomCode") String roomCode,
-                                                                                         @Param("batchName") String batchName);
+                                                                                         @Param("placeName") String placeName);
 
     public IPage<ExamStudent> findByIpage(IPage<Map> iPage,
                                           @Param("schoolId") Long schoolId,
@@ -79,4 +79,9 @@ public interface ExamStudentDao extends BaseMapper<ExamStudent> {
                                           @Param("examFinishStatus") String examFinishStatus,
                                           @Param("pattern") String pattern);
 
+    public Long findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameCount(@Param("examCode") String examCode,
+                                                                                @Param("batchId") String batchId,
+                                                                                @Param("placeCodeSet") Set<String> placeCodeSet,
+                                                                                @Param("roomCode") String roomCode,
+                                                                                @Param("placeName") String placeName);
 }

+ 56 - 52
server/src/main/java/com/qmth/jkserver/service/impl/ExamKwHZServiceImpl.java

@@ -88,7 +88,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //        AggregationResults<DBObject> tresult = mongoTemplate.aggregate(totalAgg, ExamStudent.class,
 //                DBObject.class);
 //        int total = tresult.getMappedResults().size();
-        List<Map> listTotal = examStudentDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndBatchName(code, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(code, placeName), roomCode, placeName);
+        List<Map> listTotal = examStudentDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceName(code, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(code, placeName), roomCode, placeName);
         int total = listTotal.size();
 //        Aggregation agg = Aggregation.newAggregation(ExamStudent.class,
 //                Aggregation.match(criteria),
@@ -100,7 +100,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //        ).withOptions(aggregationOptions);
 //        AggregationResults<DBObject> result = mongoTemplate.aggregate(agg, ExamStudent.class, DBObject.class);
 //        List<DBObject> fullStudentList = result.getMappedResults();
-        IPage<Map> examStudentIpage = examStudentDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndBatchNameByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize)
+        IPage<Map> examStudentIpage = examStudentDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize)
                 , code, batchId, placeCodeLike(code, placeName), roomCode, placeName);
         List<ExamStudentCountDto> resultList = new ArrayList<ExamStudentCountDto>();
         for (Map countDto : examStudentIpage.getRecords()) {
@@ -127,7 +127,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //            query.addCriteria(Criteria.where("student.roomCode").is(rCode));
 //            query.addCriteria(Criteria.where("isAbsent").is(true));
 //            long absentStudentNum = mongoTemplate.count(query, ExamStudentAnswer.class);
-            long absentStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(code, stageId, bid, new HashSet<>(Arrays.asList(pCode)), rCode, true, null, null);
+            long absentStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(code, stageId, bid, new HashSet<>(Arrays.asList(pCode)), rCode, true, null, null, null);
             examStudentCountDto.setAbsentStudentNum(absentStudentNum);
 //            Query roomQuery = new Query();
 //            roomQuery.addCriteria(Criteria.where("examCode").is(code));
@@ -152,7 +152,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //            rquery.addCriteria(Criteria.where("student.roomCode").is(rCode));
 //            rquery.addCriteria(Criteria.where("isAbsent").is(false));
 //            long realStudentNum = mongoTemplate.count(rquery, ExamStudentAnswer.class);
-            long realStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(code, stageId, bid, new HashSet<>(Arrays.asList(pCode)), rCode, false, null, null);
+            long realStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(code, stageId, bid, new HashSet<>(Arrays.asList(pCode)), rCode, false, null, null, null);
             examStudentCountDto.setRealityStudentNum(realStudentNum);
         }
         return new PageImpl<ExamStudentCountDto>(resultList, PageRequest.of(pageNo - 1, pageSize), total);
@@ -195,14 +195,14 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
             throw JkServerException.withFieldValidateError("错误的查询条件:" + condition);
         }
 //        total = this.mongoTemplate.count(query, ExamStudentAnswer.class);
-        total = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, absent, cheat, abort);
+        total = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, absent, cheat, abort, placeName);
 //        Sort.Order order1 = new Sort.Order(Direction.ASC, "student.ticketNo");
 //        Sort.Order order2 = new Sort.Order(Direction.ASC, "student.courseCode");
 //        query.with(new Sort(order1, order2));
 //        query.limit(pageSize);
 //        query.skip((pageNo - 1) * pageSize);
 //        list = this.mongoTemplate.find(query, ExamStudentAnswer.class);
-        IPage<Map> examstudentAnswerIpage = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize), examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, absent, cheat, abort);
+        IPage<Map> examstudentAnswerIpage = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize), examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, absent, cheat, abort, placeName);
         List<ExamStudenDetailDto> detailDtos = new ArrayList<ExamStudenDetailDto>();
         for (Map answer : examstudentAnswerIpage.getRecords()) {
             detailDtos.add(convert(answer));
@@ -216,26 +216,27 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
                                                   String condition, int pageNo, int pageSize) {
 //        Query query = new Query();
 //        query.addCriteria(Criteria.where("examCode").is(examCode));
-        QueryWrapper<ExamRepeatRecord> examRepeatRecordQueryWrapper = new QueryWrapper<>();
-        examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getExamCode, examCode);
-        if (StringUtils.isNotEmpty(batchId)) {
-//            query.addCriteria(Criteria.where("batchId").is(batchId));
-            examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getBatchId, batchId);
-        }
-        if (StringUtils.isNotEmpty(placeCode)) {
-//            query.addCriteria(Criteria.where("placeCode").is(placeCode));
-            examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getPlaceCode, placeCode);
-        }
-        if (StringUtils.isNotEmpty(roomCode)) {
-//            query.addCriteria(Criteria.where("roomCode").is(roomCode));
-            examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getRoomCode, roomCode);
-        }
-        if (StringUtils.isEmpty(placeCode) && StringUtils.isNotEmpty(placeName)) {
-//            query.addCriteria(Criteria.where("placeCode").in(placeCodeLike(examCode, placeName)));
-            examRepeatRecordQueryWrapper.lambda().in(ExamRepeatRecord::getPlaceCode, placeCodeLike(examCode, placeName));
-        }
-//        long total = this.mongoTemplate.count(query, ExamRepeatRecord.class);
-        long total = jkExamRepeatRecordService.count(examRepeatRecordQueryWrapper);
+//        QueryWrapper<ExamRepeatRecord> examRepeatRecordQueryWrapper = new QueryWrapper<>();
+//        examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getExamCode, examCode);
+//        if (StringUtils.isNotEmpty(batchId)) {
+////            query.addCriteria(Criteria.where("batchId").is(batchId));
+//            examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getBatchId, batchId);
+//        }
+//        if (StringUtils.isNotEmpty(placeCode)) {
+////            query.addCriteria(Criteria.where("placeCode").is(placeCode));
+//            examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getPlaceCode, placeCode);
+//        }
+//        if (StringUtils.isNotEmpty(roomCode)) {
+////            query.addCriteria(Criteria.where("roomCode").is(roomCode));
+//            examRepeatRecordQueryWrapper.lambda().eq(ExamRepeatRecord::getRoomCode, roomCode);
+//        }
+//        if (StringUtils.isEmpty(placeCode) && StringUtils.isNotEmpty(placeName)) {
+////            query.addCriteria(Criteria.where("placeCode").in(placeCodeLike(examCode, placeName)));
+//            examRepeatRecordQueryWrapper.lambda().in(ExamRepeatRecord::getPlaceCode, placeCodeLike(examCode, placeName));
+//        }
+////        long total = this.mongoTemplate.count(query, ExamRepeatRecord.class);
+//        long total = jkExamRepeatRecordService.count(examRepeatRecordQueryWrapper);
+        long total = examRepeatRecordDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByCount(examCode, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, placeName);
 
 //        Sort.Order order1 = new Sort.Order(Direction.ASC, "ticketNo");
 //        Sort.Order order2 = new Sort.Order(Direction.ASC, "courseCode");
@@ -243,7 +244,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //        query.limit(pageSize);
 //        query.skip((pageNo - 1) * pageSize);
 //        List<ExamRepeatRecord> list = this.mongoTemplate.find(query, ExamRepeatRecord.class);
-        IPage<ExamRepeatRecord> list = examRepeatRecordDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize), examCode, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode);
+        IPage<ExamRepeatRecord> list = examRepeatRecordDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(pageNo, pageSize), examCode, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, placeName);
         List<ExamStudenDetailDto> detailDtos = new ArrayList<ExamStudenDetailDto>();
         for (ExamRepeatRecord record : list.getRecords()) {
             detailDtos.add(convert(record));
@@ -283,25 +284,28 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
         Map<String, Long> result = new LinkedHashMap<>();
 //        Query tquery = new Query();
 //        tquery.addCriteria(Criteria.where("examCode").is(examCode));
-        QueryWrapper<ExamStudent> examStudentQueryWrapper = new QueryWrapper<>();
-        if (StringUtils.isNotEmpty(batchId)) {
-//            tquery.addCriteria(Criteria.where("batchId").is(batchId));
-            examStudentQueryWrapper.lambda().eq(ExamStudent::getBatchId, batchId);
-        }
-        if (StringUtils.isNotEmpty(placeCode)) {
-//            tquery.addCriteria(Criteria.where("placeCode").is(placeCode));
-            examStudentQueryWrapper.lambda().eq(ExamStudent::getPlaceCode, placeCode);
-        }
-        if (StringUtils.isNotEmpty(roomCode)) {
-//            tquery.addCriteria(Criteria.where("roomCode").is(roomCode));
-            examStudentQueryWrapper.lambda().eq(ExamStudent::getRoomCode, roomCode);
-        }
-        if (StringUtils.isEmpty(placeCode) && StringUtils.isNotEmpty(placeName)) {
-//            tquery.addCriteria(Criteria.where("placeCode").in(placeCodeLike(examCode, placeName)));
-            examStudentQueryWrapper.lambda().in(ExamStudent::getPlaceCode, placeCodeLike(examCode, placeName));
-        }
-//        long totalCount = mongoTemplate.count(tquery, ExamStudent.class);
-        long totalCount = examStudentService.count(examStudentQueryWrapper);
+//        QueryWrapper<ExamStudent> examStudentQueryWrapper = new QueryWrapper<>();
+//        examStudentQueryWrapper.lambda().eq(ExamStudent::getExamCode, examCode);
+//        if (StringUtils.isNotEmpty(batchId)) {
+////            tquery.addCriteria(Criteria.where("batchId").is(batchId));
+//            examStudentQueryWrapper.lambda().eq(ExamStudent::getBatchId, batchId);
+//        }
+//        if (StringUtils.isNotEmpty(placeCode)) {
+////            tquery.addCriteria(Criteria.where("placeCode").is(placeCode));
+//            examStudentQueryWrapper.lambda().eq(ExamStudent::getPlaceCode, placeCode);
+//        }
+//        if (StringUtils.isNotEmpty(roomCode)) {
+////            tquery.addCriteria(Criteria.where("roomCode").is(roomCode));
+//            examStudentQueryWrapper.lambda().eq(ExamStudent::getRoomCode, roomCode);
+//        }
+//        if (StringUtils.isEmpty(placeCode) && StringUtils.isNotEmpty(placeName)) {
+////            tquery.addCriteria(Criteria.where("placeCode").in(placeCodeLike(examCode, placeName)));
+//            examStudentQueryWrapper.lambda().in(ExamStudent::getPlaceCode, placeCodeLike(examCode, placeName));
+//        }
+////        long totalCount = mongoTemplate.count(tquery, ExamStudent.class);
+//        long totalCount = examStudentService.count(examStudentQueryWrapper);
+
+        long totalCount = examStudentDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameCount(examCode, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, placeName);
         result.put("full", totalCount);
 //        Query aquery = new Query();
 //        aquery.addCriteria(Criteria.where("examCode").is(examCode));
@@ -319,7 +323,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //        }
 //        aquery.addCriteria(Criteria.where("isAbsent").is(true));
 //        long absentCount = mongoTemplate.count(aquery, ExamStudentAnswer.class);
-        long absentCount = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, true, null, null);
+        long absentCount = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, true, null, null, placeName);
         result.put("absent", absentCount);
 //        Query rquery = new Query();
 //        rquery.addCriteria(Criteria.where("examCode").is(examCode));
@@ -337,7 +341,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //        }
 //        rquery.addCriteria(Criteria.where("isAbsent").is(false));
 //        long realCount = mongoTemplate.count(rquery, ExamStudentAnswer.class);
-        long realCount = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, false, null, null);
+        long realCount = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(examCode, null, batchId, Objects.nonNull(placeCode) ? new HashSet<>(Arrays.asList(placeCode)) : placeCodeLike(examCode, placeName), roomCode, false, null, null, placeName);
         result.put("real", realCount);
         return result;
     }
@@ -347,7 +351,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //        Query query = new Query();
 //        query.addCriteria(Criteria.where("examCode").is(examCode));
 //        List<ExamStudentAnswer> list = this.mongoTemplate.find(query, ExamStudentAnswer.class);
-        IPage<Map> examstudentAnswerIpage = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(0, 1000000), examCode, null, null, null, null, null, null, null);
+        IPage<Map> examstudentAnswerIpage = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(0, 1000000), examCode, null, null, null, null, null, null, null, null);
         Map<String, List<ExamStudenDetailDto>> result = new HashMap<String, List<ExamStudenDetailDto>>();
         result.put("isAbort", new ArrayList<ExamStudenDetailDto>());
         result.put("isCheat", new ArrayList<ExamStudenDetailDto>());
@@ -495,7 +499,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //                over = true;
 //            }
 //            for (DBObject countDto : fullStudentList) {
-            IPage<Map> examStudentIpage = examStudentDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndBatchNameByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(skip, limit), examCode, null, null, null, null);
+            IPage<Map> examStudentIpage = examStudentDao.findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(skip, limit), examCode, null, null, null, null);
             if (!CollectionUtils.isEmpty(examStudentIpage.getRecords())) {
                 for (Map countDto : examStudentIpage.getRecords()) {
                     ExamStudentCountDto examStudentCountDto = new ExamStudentCountDto();
@@ -519,7 +523,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //                query.addCriteria(Criteria.where("student.batchId").is(batchId));
 //                query.addCriteria(Criteria.where("isAbsent").is(true));
 //                long absentStudentNum = mongoTemplate.count(query, ExamStudentAnswer.class);
-                    long absentStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(examCode, stageId, batchId, null, null, true, null, null);
+                    long absentStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(examCode, stageId, batchId, null, null, true, null, null, null);
                     examStudentCountDto.setAbsentStudentNum(absentStudentNum);
                     // 计算当前批次、当前考次下面的实考人数
 //                Query rquery = new Query();
@@ -528,7 +532,7 @@ public class ExamKwHZServiceImpl implements ExamKwHZService {
 //                rquery.addCriteria(Criteria.where("student.batchId").is(batchId));
 //                rquery.addCriteria(Criteria.where("isAbsent").is(false));
 //                long realStudentNum = mongoTemplate.count(rquery, ExamStudentAnswer.class);
-                    long realStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount(examCode, stageId, batchId, null, null, false, null, null);
+                    long realStudentNum = examStudentAnswerDao.findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(examCode, stageId, batchId, null, null, false, null, null, null);
                     examStudentCountDto.setRealityStudentNum(realStudentNum);
                     if (examStudentIpage.getRecords().size() < limit) {
                         over = true;

+ 34 - 1
server/src/main/resources/mapper/JkExamRepeatRecordMapper.xml

@@ -2,8 +2,38 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.jkserver.dao.ExamRepeatRecordDao">
 
-    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeByIpage" resultType="com.qmth.jkserver.model.ExamRepeatRecord">
+    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByCount" resultType="java.lang.Long">
+        select
+        count(1)
+        from
+        jk_exam_repeat_record t
+        left join jk_exam_room jer on jer.exam_code = t.exam_code
+        <where>
+            <if test="examCode != null and examCode != ''">
+                and t.exam_code = #{examCode}
+            </if>
+            <if test="batchId != null and batchId != ''">
+                and t.batch_id = #{batchId}
+            </if>
+            <if test="placeCodeSet != null and placeCodeSet != '' and placeCodeSet.size > 0">
+                and t.place_code in
+                <foreach collection="placeCodeSet" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="roomCode != null and roomCode != ''">
+                and t.room_code = #{roomCode}
+            </if>
+            <if test="placeName != null and placeName != ''">
+                and jer.place_name like concat('%', #{placeName}, '%')
+            </if>
+        </where>
+    </select>
+
+    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage" resultType="com.qmth.jkserver.model.ExamRepeatRecord">
         select t.* from jk_exam_repeat_record t
+        left join jk_exam_room jer on jer.exam_code = t.exam_code
         <where>
             <if test="examCode != null and examCode != ''">
                 and t.exam_code = #{examCode}
@@ -21,6 +51,9 @@
             <if test="roomCode != null and roomCode != ''">
                 and t.room_code = #{roomCode}
             </if>
+            <if test="placeName != null and placeName != ''">
+                and jer.place_name like concat('%', #{placeName}, '%')
+            </if>
         </where>
         order by t.ticket_no,t.course_code
     </select>

+ 1 - 1
server/src/main/resources/mapper/JkExamRoomMapper.xml

@@ -49,7 +49,7 @@
                 and t.place_name like concat('%', #{placeName}, '%')
             </if>
             <if test="kjAlready != null and kjAlready != '' or kjAlready == 0">
-                and t.kjAlready = #{kjAlready}
+                and t.kj_already = #{kjAlready}
             </if>
         </where>
         order by t.place_code,t.room_code

+ 11 - 4
server/src/main/resources/mapper/JkExamStudentAnswerMapper.xml

@@ -76,13 +76,14 @@
         </where>
     </select>
 
-    <select id="findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortCount" resultType="java.lang.Long">
+    <select id="findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount" resultType="java.lang.Long">
         select
         count(1)
         from
         jk_exam_student_answer jesa
         join jk_exam_student jes on
         jes.id = jesa.student_id
+        left join jk_exam_room jer on jer.exam_code = jes.exam_code
         <where>
             <if test="examCode != null and examCode != ''">
                 and jesa.exam_code = #{examCode}
@@ -112,10 +113,13 @@
             <if test="abort != null and abort != '' or abort == 0">
                 and jesa.is_abort = #{abort}
             </if>
+            <if test="placeName != null and placeName != ''">
+                and jer.place_name like concat('%', #{placeName}, '%')
+            </if>
         </where>
     </select>
 
-    <select id="findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortByIpage" resultType="java.util.Map">
+    <select id="findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameByIpage" resultType="java.util.Map">
         select
             jesa.id as id,
             jesa.exam_code as examCode,
@@ -147,8 +151,8 @@
             jes.ticket_no as ticketNo
         from
         jk_exam_student_answer jesa
-        join jk_exam_student jes on
-        jes.id = jesa.student_id
+        join jk_exam_student jes on jes.id = jesa.student_id
+        left join jk_exam_room jer on jer.exam_code = jes.exam_code
         <where>
             <if test="examCode != null and examCode != ''">
                 and jesa.exam_code = #{examCode}
@@ -178,6 +182,9 @@
             <if test="abort != null and abort != '' or abort == 0">
                 and jesa.is_abort = #{abort}
             </if>
+            <if test="placeName != null and placeName != ''">
+                and jer.place_name like concat('%', #{placeName}, '%')
+            </if>
         </where>
         order by jes.ticket_no,jes.course_code
     </select>

+ 39 - 7
server/src/main/resources/mapper/JkExamStudentMapper.xml

@@ -68,8 +68,10 @@
         order by t.batch_id
     </select>
 
-    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndBatchName" resultType="java.util.Map">
-        select t.stage_id as stageId,t.batch_id as batchId,t.place_code as placeCode,t.room_code as roomCode,t.batch_name as batchName,count(1) as fullStudentNum from jk_exam_student t
+    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceName" resultType="java.util.Map">
+        select t.stage_id as stageId,t.batch_id as batchId,t.place_code as placeCode,t.room_code as roomCode,t.batch_name as batchName,count(1) as fullStudentNum
+        from jk_exam_student t
+        left join jk_exam_room jer on jer.exam_code = t.exam_code
         <where>
             <if test="examCode != null and examCode != ''">
                 and t.exam_code = #{examCode}
@@ -87,15 +89,16 @@
             <if test="roomCode != null and roomCode != ''">
                 and t.room_code = #{roomCode}
             </if>
-            <if test="batchName != null and batchName != ''">
-                and t.batch_name = #{batchName}
+            <if test="placeName != null and placeName != ''">
+                and jer.place_name like concat('%', #{placeName}, '%')
             </if>
         </where>
         group by t.stage_id,t.batch_id,t.place_code,t.room_code,t.batch_name
     </select>
 
-    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndBatchNameByIpage" resultType="java.util.Map">
+    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage" resultType="java.util.Map">
         select t.stage_id as stageId,t.batch_id as batchId,t.place_code as placeCode,t.room_code as roomCode,t.batch_name as batchName,count(1) as fullStudentNum from jk_exam_student t
+        left join jk_exam_room jer on jer.exam_code = t.exam_code
         <where>
             <if test="examCode != null and examCode != ''">
                 and t.exam_code = #{examCode}
@@ -113,14 +116,43 @@
             <if test="roomCode != null and roomCode != ''">
                 and t.room_code = #{roomCode}
             </if>
-            <if test="batchName != null and batchName != ''">
-                and t.batch_name = #{batchName}
+            <if test="placeName != null and placeName != ''">
+                and jer.place_name like concat('%', #{placeName}, '%')
             </if>
         </where>
         group by t.stage_id,t.batch_id,t.place_code,t.room_code,t.batch_name
         order by t.place_code,t.room_code
     </select>
 
+    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameCount" resultType="java.lang.Long">
+        select
+        count(1)
+        from
+        jk_exam_student t
+        left join jk_exam_room jer on jer.exam_code = t.exam_code
+        <where>
+            <if test="examCode != null and examCode != ''">
+                and t.exam_code = #{examCode}
+            </if>
+            <if test="batchId != null and batchId != ''">
+                and t.batch_id = #{batchId}
+            </if>
+            <if test="placeCodeSet != null and placeCodeSet != '' and placeCodeSet.size > 0">
+                and t.place_code in
+                <foreach collection="placeCodeSet" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="roomCode != null and roomCode != ''">
+                and t.room_code = #{roomCode}
+            </if>
+            <if test="placeName != null and placeName != ''">
+                and jer.place_name like concat('%', #{placeName}, '%')
+            </if>
+        </where>
+    </select>
+
     <select id="findByIpage" resultType="com.qmth.jkserver.model.ExamStudent">
         select t.* from jk_exam_student t
         join jk_exam_code tec on tec.exam_code = t.exam_code