wangliang 1 год назад
Родитель
Сommit
5ea9268e43
1 измененных файлов с 15 добавлено и 5 удалено
  1. 15 5
      themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

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

@@ -480,7 +480,9 @@
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
-        order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+            order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        </if>
     </select>
 
     <select id="invigilatePageProgressListExport"
@@ -559,12 +561,16 @@
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
-        order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+            order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        </if>
     </select>
 
     <select id="invigilatePageListHistory" resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
         <include refid="invigilatePageListHistorySql"/>
-        order by CAST(teea.code AS UNSIGNED),CAST(s.room_code AS UNSIGNED)
+        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+            order by CAST(teea.code AS UNSIGNED),CAST(s.room_code AS UNSIGNED)
+        </if>
     </select>
 
     <sql id="invigilatePageListHistorySql">
@@ -697,7 +703,9 @@
     <select id="invigilatePageListHistoryExport"
             resultType="com.qmth.themis.business.bean.admin.InvigilateListHistoryBean">
         <include refid="invigilatePageListHistorySql"/>
-        order by CAST(teea.code AS UNSIGNED),CAST(s.room_code AS UNSIGNED)
+        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+            order by CAST(teea.code AS UNSIGNED),CAST(s.room_code AS UNSIGNED)
+        </if>
     </select>
 
     <select id="getDoneCountByDay" resultType="java.util.Map">
@@ -1290,7 +1298,9 @@
                 and tees.identity like CONCAT('%', #{identity},'%')
             </if>
         </where>
-        order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        <if test="(examActivityId != null and examActivityId != '') or (roomCode != null and roomCode != '')">
+            order by CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
+        </if>
     </select>
 
     <select id="examRecordDetailListQuery" resultType="java.lang.String">