|
@@ -108,11 +108,12 @@ public class ExamServiceImpl extends ServiceImpl<ExamDao, ExamEntity> implements
|
|
|
@Override
|
|
|
public IPage<ExamVo> pageQuery(ExamQuery query) {
|
|
|
Page<ExamVo> page = new Page<>(query.getPageNumber(), query.getPageSize());
|
|
|
+ long mainQueryS = System.currentTimeMillis();
|
|
|
IPage<ExamVo> iPage = this.baseMapper.pageExam(page, query);
|
|
|
+ System.out.println("主查询时间: " + (System.currentTimeMillis() - mainQueryS));
|
|
|
for (ExamVo record : iPage.getRecords()) {
|
|
|
// 考生总量
|
|
|
- List<ExamStudentEntity> studentEntityList = examStudentService.listByExamId(record.getId());
|
|
|
- record.setStudentCount(studentEntityList.size());
|
|
|
+ record.setStudentCount(examStudentService.count(new QueryWrapper<ExamStudentEntity>().lambda().eq(ExamStudentEntity::getExamId,record.getId())));
|
|
|
|
|
|
// 绑定用户
|
|
|
List<ExamUserRelationEntity> examUserRelationEntities = examUserRelationService.listByExamId(record.getId());
|
|
@@ -154,6 +155,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamDao, ExamEntity> implements
|
|
|
}
|
|
|
record.setProgress(progress);
|
|
|
}
|
|
|
+ System.out.println("总查询时间: " + (System.currentTimeMillis() - mainQueryS));
|
|
|
return iPage;
|
|
|
}
|
|
|
|