haogh 1 年之前
父节点
当前提交
5699a27f97

+ 0 - 6
src/main/java/com/qmth/exam/reserve/service/impl/StudentApplyServiceImpl.java

@@ -118,21 +118,15 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
             ApplyTaskEntity task = getApplyTask();
             req.setTaskId(task.getId());
         }
-        String applyTeachingName = null;
         if (req.getTeachingId() != null) {
             List<CategoryVO> listExamSite = examSiteService.listExamSite(req.getTeachingId());
             List<Long> examSiteIds = listExamSite.stream().map(CategoryVO::getId).collect(Collectors.toList());
             if (!examSiteIds.isEmpty()) {
                 req.setExamSiteIds(examSiteIds);
-                applyTeachingName = categoryService.getById(req.getTeachingId()).getName();
             }
         }
         IPage<StudentApplyVO> iPage = this.baseMapper
                 .page(new Page<StudentApplyVO>(req.getPageNumber(), req.getPageSize()), req);
-        List<StudentApplyVO> records = iPage.getRecords();
-        for (StudentApplyVO vo : records) {
-            vo.setApplyTeachingName(applyTeachingName);
-        }
         return PageUtil.of(iPage);
     }
 

+ 2 - 1
src/main/resources/mapper/StudentApplyMapper.xml

@@ -5,12 +5,13 @@
             resultType="com.qmth.exam.reserve.bean.stdapply.StudentApplyVO">
         select a.id,s.name,s.identity_number
         identityNumber,s.student_code
-        studentCode,o.name teachingName,es.name
+        studentCode,o.name teachingName,cat.name applyTeachingName,es.name
         agentName, p.start_time
         startTime,p.end_time endTime,
         r.name roomName, a.cancel,a.update_time updateTime,u.name userName,a.seat_number seatNumber
         from t_student s,t_category o,t_student_apply a
         left join t_exam_site es on es.id=a.exam_site_id
+		left join t_category cat on cat.id= es.category_id
         left join t_time_period p on p.id=a.time_period_id
         left join t_exam_room r on r.id=a.exam_room_id
         left join t_user u on u.id=a.operate_id