wangliang 10 kuukautta sitten
vanhempi
commit
1e06eb1b65

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

@@ -296,9 +296,7 @@
         left join t_e_exam tee on tee.id = tiiwi.exam_id
         left join t_e_exam_activity teea on teea.id = tiiwi.exam_activity_id
         left join t_oe_exam_record toer on toer.id = tiiwi.exam_record_id
-        <if test="markStatus != null and markStatus != ''">
-            join t_e_exam_mark_log teeml on teeml.exam_record_id = toer.id and teeml.status = #{markStatus}
-        </if>
+        left join t_e_exam_mark_log teeml on teeml.exam_record_id = toer.id
         <where> 1 = 1
             <if test="orgId != null and orgId != ''">
                 and tee.org_id = #{orgId}
@@ -342,6 +340,16 @@
             <if test="maxExceptionCount != null and maxExceptionCount != '' or maxExceptionCount == 0">
                 and toer.exception_count &lt;= #{maxExceptionCount}
             </if>
+            <if test="markStatus != null and markStatus != ''">
+                <choose>
+                    <when test="markStatus == 'MARK'">
+                        and teeml.status = #{markStatus}
+                    </when>
+                    <otherwise>
+                        and (teeml.status <![CDATA[ <> ]]> 'MARK' or teeml.id is null)
+                    </otherwise>
+                </choose>
+            </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
         order by tiiwi.approve_status