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

room_code和exam_id条件加入

wangliang 4 жил өмнө
parent
commit
c7bd553f61

+ 3 - 3
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -21,7 +21,7 @@
                 from
                 t_b_exam_invigilate_user tbeiu
                 left join t_e_exam_student tees on
-                tees.room_code = tbeiu.room_code
+                tees.room_code = tbeiu.room_code and tees.exam_id = tbeiu.exam_id
                 where
                 tbeiu.user_id = #{userId}
                 and t.id = tbeiu.exam_id)
@@ -93,7 +93,7 @@
                 from
                 t_b_exam_invigilate_user tbeiu
                 left join t_e_exam_student tees on
-                tees.room_code = tbeiu.room_code
+                tees.room_code = tbeiu.room_code and tees.exam_id = tbeiu.exam_id
                 where
                 tbeiu.user_id = #{userId}
                 and t.id = tbeiu.exam_id)
@@ -191,7 +191,7 @@
             from
                 t_b_exam_invigilate_user tbeiu
             left join t_e_exam_student tees on
-                tees.room_code = tbeiu.room_code
+                tees.room_code = tbeiu.room_code and tees.exam_id = tbeiu.exam_id
             <where> 1 = 1
                 <if test="userId != null and userId != ''">
                     and tbeiu.user_id = #{userId}

+ 1 - 1
themis-business/src/main/resources/mapper/TEExamReexamMapper.xml

@@ -29,7 +29,7 @@
                 <if test="userId != null and userId != ''">
                     and tbeiu.user_id = #{userId}
                 </if>
-                    and tbeiu.exam_id = tees.exam_id
+                    and tbeiu.exam_id = tees.exam_id and tees.room_code = tbeiu.room_code
                 )
                 <if test="examId != null and examId != ''">
                     and tees.exam_id = #{examId}

+ 1 - 1
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -12,7 +12,7 @@
         <if test="userId != null and userId != ''">
             tbeiu.user_id = #{userId} and
         </if>
-        tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id and toer.exam_id = tbeiu.exam_id))) t on t.id = tiiwi.exam_record_id
+        tbeiu.room_code = tees.room_code and tees.exam_id = tbeiu.exam_id and toer.exam_student_id = tees.id))) t on t.id = tiiwi.exam_record_id
         <where>
             <if test="examId != null and examId != ''">
                 and tiiwi.exam_id = #{examId}

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

@@ -117,7 +117,7 @@
 		<if test="userId != null and userId != ''">
 			tbeiu.user_id = #{userId} and
 		</if>
-		tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id)))
+		tbeiu.room_code = tees.room_code and tees.exam_id = tbeiu.exam_id and toer.exam_student_id = tees.id)))
 		t1 on t1.id = t.id
 	</sql>
 
@@ -353,7 +353,7 @@
 		<if test="userId != null and userId != ''">
 			tbeiu.user_id = #{userId} and
 		</if>
-		tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id)))
+		tbeiu.room_code = tees.room_code and tees.exam_id = tbeiu.exam_id and toer.exam_student_id = tees.id)))
 		t on t.id = tiiwi.exam_record_id
 		left join t_oe_exam_record toer on toer.id = t.id
 		left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
@@ -443,7 +443,7 @@
 		<if test="userId != null and userId != ''">
 			tbeiu.user_id = #{userId} and
 		</if>
-		tbeiu.room_code = tees.room_code and toer.exam_student_id = tees.id)))
+		tbeiu.room_code = tees.room_code and tees.exam_id = tbeiu.exam_id and toer.exam_student_id = tees.id)))
 		t on t.id = tiiwi.exam_record_id
 		left join t_oe_exam_record toer on toer.id = t.id
 		left join t_e_exam_student tees on tees.id = tiiwi.exam_student_id
@@ -771,7 +771,7 @@
 		<if test="userId != null and userId != ''">
 			and tbeiu.user_id = #{userId}
 		</if>
-		and tbeiu.exam_id = tees.exam_id))) t1 on
+		and tbeiu.exam_id = tees.exam_id and tees.room_code = tbeiu.room_code))) t1 on
 		t1.id = t.id
 		<where> 1 = 1
 			<if test="examId != null and examId != ''">