فهرست منبع

优化识别对照查询sql

yin 1 سال پیش
والد
کامیت
bee809c952
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml

+ 5 - 3
teachcloud-mark/src/main/resources/mapper/ScanOmrTaskMapper.xml

@@ -51,9 +51,10 @@
 					and exists (select 1 from mark_paper mp where s.exam_id = mp.exam_id and s.course_paper_id = mp.course_paper_id and s.paper_type = mp.paper_type and mp.status = #{markPaperStatus})
 					and exists(select 1
 						from scan_omr_task t
-						where s.id = t.student_id
+						where t.exam_id = #{examId}
 						and t.status=#{status}
-						<if test="dpr != null">
+						and s.id = t.student_id
+				<if test="dpr != null">
 							<if test="dpr.requestUserId != null">
 								AND s.create_id = #{dpr.requestUserId}
 							</if>
@@ -85,8 +86,9 @@
 			and exists (select 1 from mark_paper mp where s.exam_id = mp.exam_id and s.course_paper_id = mp.course_paper_id and s.paper_type = mp.paper_type and mp.status = #{markPaperStatus})
 			and exists(select 1
 			from scan_omr_task t
-			where s.id = t.student_id
+			where t.exam_id = #{examId}
 			and t.status=#{status}
+			and s.id = t.student_id
 			<if test="dpr != null">
 				<if test="dpr.requestUserId != null">
 					AND s.create_id = #{dpr.requestUserId}