Joburgess há 5 anos atrás
pai
commit
85e936de50

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -180,12 +180,12 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = examRoomStudentRelationDao.findExamRoomStudents(params);
-			List<Integer> studentIds = dataList.stream().map(ExamRoomStudentRelationDto::getStudentId).collect(Collectors.toList());
+			List<Integer> studentIds = dataList.stream().map(e->e.getExamRegistration().getStudentId()).collect(Collectors.toList());
 			List<Integer> subjectIds = dataList.stream().map(e->e.getExamRegistration().getSubjectId()).collect(Collectors.toList());
 			Map<Integer, String> studentIdNameMap = this.getMap("sys_user", "id_", "real_name_", studentIds, Integer.class, String.class);
 			Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
 			for (ExamRoomStudentRelationDto e : dataList) {
-				e.setStudentInfo(new SysUser(e.getStudentId(),studentIdNameMap.get(e.getStudentId())));
+				e.setStudentInfo(new SysUser(e.getStudentId(),studentIdNameMap.get(e.getExamRegistration().getStudentId())));
 				e.setSubject(new Subject(e.getExamRegistration().getSubjectId(), subjectIdNameMap.get(e.getExamRegistration().getSubjectId())));
 			}
 		}

+ 9 - 8
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -118,13 +118,13 @@
 				</foreach>
 			</if>
 			<if test="examId!=null">
-				AND er.examination_basic_id_ = 1
+				AND er.examination_basic_id_ = #{examId}
 			</if>
-			<if test="inRoom!=null and inRoom=0">
+			<if test="inRoom!=null and inRoom==0">
 				AND ersr.id_ IS NULL
 			</if>
-			<if test="inRoom!=null and inRoom=1">
-				AND ersr.exam_room_id_ =1
+			<if test="inRoom!=null and inRoom==1">
+				AND ersr.exam_room_id_ =#{examRoomId}
 			</if>
 		</where>
 	</sql>
@@ -132,23 +132,24 @@
 	<select id="findExamRoomStudents" resultMap="ExamRoomStudentRelationDto" parameterType="map">
 		SELECT
 			ersr.id_,
-			ersr.student_id_,
+			er.id_ regist_id_,
+			er.student_id_ regist_student_id_,
 			er.subject_id_ regist_subject_id_,
 			er.level_ regist_level_,
 			er.create_time_ regist_create_time_
 		FROM
 			exam_registration er
-		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_ ON ersr.examination_basic_id_=er.examination_basic_id_
+		LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
 		<include refid="queryCondition"/>
 		ORDER BY id_ <include refid="global.limit"/>
 	</select>
 
 	<select id="countExamRoomStudents" resultType="int">
 		SELECT
-			COUNT(ersr.id_)
+			COUNT(er.id_)
 		FROM
 		exam_registration er
-		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_
+		LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
 		<include refid="queryCondition"/>
 	</select>