Browse Source

Merge remote-tracking branch 'origin/dev_v3.4.0' into dev_v3.4.0

caozixuan 11 months ago
parent
commit
ebbac209a9
1 changed files with 26 additions and 19 deletions
  1. 26 19
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

+ 26 - 19
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -323,19 +323,8 @@
         <if test="query.studentCodeOrName != null and query.studentCodeOrName !=''">
             and (t.student_code=#{query.studentCodeOrName} or bes.student_name=#{query.studentCodeOrName})
         </if>
-        <if test="dpr != null">
-            <if test="dpr.requestUserId != null">
-                AND t.create_id = #{dpr.requestUserId}
-            </if>
-            <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
-                AND bc.teaching_room_id IN
-                <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-        </if>
-        <if test="query.markPaperStatus != null">
-            and s.status = #{query.markPaperStatus}
+        <if test="dpr != null and dpr.requestUserId != null">
+            AND t.create_id = #{dpr.requestUserId}
         </if>
     </sql>
     <select id="queryPage"
@@ -362,11 +351,20 @@
                t.paper_number coursePaperNumber,
                c.paper_count cardPaperCount
         from mark_student t
-        left join (select * from basic_exam_student where exam_id=#{query.examId}) bes on t.basic_student_id = bes.id
+        inner join basic_exam_student bes on t.basic_student_id = bes.id
         left join scan_answer_card c on t.exam_id=c.exam_id and t.card_number=c.number
-        left join mark_paper s on s.course_paper_id=t.course_paper_id and s.exam_id=t.exam_id
+        inner join mark_paper s on s.course_paper_id=t.course_paper_id and s.exam_id=t.exam_id
+            <if test="query.markPaperStatus != null">
+                and s.status = #{query.markPaperStatus}
+            </if>
         left join sys_user su on t.create_id = su.id
-        left join basic_course bc on t.course_id = bc.id
+        inner join basic_course bc on t.course_id = bc.id
+            <if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                AND bc.teaching_room_id IN
+                <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         <include refid="queryWhereAndOrder"/>
         order by t.id
     </select>
@@ -374,10 +372,19 @@
         select
         t.id
         from mark_student t
-        left join (select * from basic_exam_student where exam_id=#{query.examId}) bes on t.basic_student_id = bes.id
-        left join mark_paper s on s.course_paper_id=t.course_paper_id and s.exam_id=t.exam_id
+        inner join basic_exam_student bes on t.basic_student_id = bes.id
+        inner join mark_paper s on s.course_paper_id=t.course_paper_id and s.exam_id=t.exam_id
+            <if test="query.markPaperStatus != null">
+                and s.status = #{query.markPaperStatus}
+            </if>
         left join sys_user su on t.create_id = su.id
-        left join basic_course bc on t.course_id = bc.id
+        inner join basic_course bc on t.course_id = bc.id
+        <if test="dpr != null and dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+            AND bc.teaching_room_id IN
+            <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         <include refid="queryWhereAndOrder"/>
         order by t.id
     </select>