Ver Fonte

BUG fix

wangliang há 1 ano atrás
pai
commit
b982382cfe

+ 14 - 10
themis-business/src/main/resources/mapper/TEExamStudentMapper.xml

@@ -215,11 +215,13 @@
         left join t_oe_exam_record toer on t.id = toer.exam_student_id
         where 1 = 1
         and t.exam_id = #{examId}
-        and t.exam_activity_id in
-        <foreach collection="activityIds" item="acid" index="index"
-                 open="(" close=")" separator=",">
-            #{acid}
-        </foreach>
+        <if test="activityIds != null and activityIds != '' and activityIds.size > 0">
+            and t.exam_activity_id in
+            <foreach collection="activityIds" item="acid" index="index"
+                     open="(" close=")" separator=",">
+                #{acid}
+            </foreach>
+        </if>
         <if test="activityId != null and activityId != ''">
             and t.exam_activity_id = #{activityId}
         </if>
@@ -257,11 +259,13 @@
         left join t_oe_exam_record toer1 on t.id = toer1.exam_student_id and toer1.first_start_time is not null
         where 1 = 1
         and toer.exam_id = #{examId}
-        and toer.exam_activity_id in
-        <foreach collection="activityIds" item="acid" index="index"
-                 open="(" close=")" separator=",">
-            #{acid}
-        </foreach>
+        <if test="activityIds != null and activityIds != '' and activityIds.size > 0">
+            and toer.exam_activity_id in
+            <foreach collection="activityIds" item="acid" index="index"
+                     open="(" close=")" separator=",">
+                #{acid}
+            </foreach>
+        </if>
         <if test="activityId != null and activityId != ''">
             and t.exam_activity_id = #{activityId}
         </if>