Selaa lähdekoodia

监考考试批次查询

wangliang 1 vuosi sitten
vanhempi
commit
887b3d1974
1 muutettua tiedostoa jossa 131 lisäystä ja 132 poistoa
  1. 131 132
      themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

+ 131 - 132
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -162,7 +162,7 @@
     </select>
 
     <select id="invigilatePagePatrolList" resultType="com.qmth.themis.business.bean.admin.InvigilateListPatrolBean">
-        select distinct s.exam_id as examId,
+        select s.exam_id as examId,
         tee.name as examName,
         s.exam_activity_id as examActivityId,
         teea.code as examActivityCode,
@@ -198,70 +198,70 @@
             left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
         </if>
         <where> 1 = 1
-        <if test="examId != null and examId != ''">
-            and s.exam_id = #{examId}
-        </if>
-        <if test="userId != null and userId != ''">
-            and tbeiu.user_id = #{userId}
-        </if>
-        <choose>
-            <when test="status != null and status != '' and status == 'UN_FINISH'">
-                and toer.id is null
-            </when>
-            <otherwise>
-                and toer.id is not null
-            </otherwise>
-        </choose>
-        <if test="orgId != null and orgId != ''">
-            and tee.org_id = #{orgId}
-        </if>
-        <if test="examActivityId != null and examActivityId != ''">
-            and s.exam_activity_id = #{examActivityId}
-        </if>
-        <if test="roomCode != null and roomCode != ''">
-            and s.room_code = #{roomCode}
-        </if>
-        <if test="name != null and name !=''">
-            and s.name like CONCAT('%', #{name},'%')
-        </if>
-        <if test="identity != null and identity !=''">
-            and s.identity like CONCAT('%', #{identity},'%')
-        </if>
-        and teea.finish_time > unix_timestamp(current_timestamp()) * 1000
-        <if test="status != null and status != '' and status != 'UN_FINISH'">
+            <if test="examId != null and examId != ''">
+                and s.exam_id = #{examId}
+            </if>
+            <if test="userId != null and userId != ''">
+                and tbeiu.user_id = #{userId}
+            </if>
             <choose>
-                <when test="status == 'EXAMING'">
-                    and toer.status in ('ANSWERING','RESUME_PREPARE','BREAK_OFF')
+                <when test="status != null and status != '' and status == 'UN_FINISH'">
+                    and toer.id is null
                 </when>
                 <otherwise>
-                    and toer.status = #{status}
+                    and toer.id is not null
                 </otherwise>
             </choose>
-        </if>
-        <if test="maxWarningCount != null and maxWarningCount != '' or maxWarningCount == 0">
-            and toer.warning_count &lt;= #{maxWarningCount}
-        </if>
-        <if test="minWarningCount != null and minWarningCount != '' or minWarningCount == 0">
-            and toer.warning_count &gt;= #{minWarningCount}
-        </if>
-        <if test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
-            and toer.client_websocket_status = #{clientWebsocketStatus}
-        </if>
-        <if test="status == null or status == ''">
-            and toer.status in ('FIRST_PREPARE','ANSWERING','BREAK_OFF','RESUME_PREPARE')
-        </if>
-        <if test="minMultipleFaceCount != null and minMultipleFaceCount != '' or minMultipleFaceCount == 0">
-            and toer.warning_multiple_face_count &gt;= #{minMultipleFaceCount}
-        </if>
-        <if test="maxMultipleFaceCount != null and maxMultipleFaceCount != '' or maxMultipleFaceCount == 0">
-            and toer.warning_multiple_face_count &lt;= #{maxMultipleFaceCount}
-        </if>
-        <if test="minExceptionCount != null and minExceptionCount != '' or minExceptionCount == 0">
-            and toer.exception_count &gt;= #{minExceptionCount}
-        </if>
-        <if test="maxExceptionCount != null and maxExceptionCount != '' or maxExceptionCount == 0">
-            and toer.exception_count &lt;= #{maxExceptionCount}
-        </if>
+            <if test="orgId != null and orgId != ''">
+                and tee.org_id = #{orgId}
+            </if>
+            <if test="examActivityId != null and examActivityId != ''">
+                and toer.exam_activity_id = #{examActivityId}
+            </if>
+            <if test="roomCode != null and roomCode != ''">
+                and s.room_code = #{roomCode}
+            </if>
+            <if test="name != null and name !=''">
+                and s.name like CONCAT('%', #{name},'%')
+            </if>
+            <if test="identity != null and identity !=''">
+                and s.identity like CONCAT('%', #{identity},'%')
+            </if>
+            and teea.finish_time > unix_timestamp(current_timestamp()) * 1000
+            <if test="status != null and status != '' and status != 'UN_FINISH'">
+                <choose>
+                    <when test="status == 'EXAMING'">
+                        and toer.status in ('ANSWERING','RESUME_PREPARE','BREAK_OFF')
+                    </when>
+                    <otherwise>
+                        and toer.status = #{status}
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="maxWarningCount != null and maxWarningCount != '' or maxWarningCount == 0">
+                and toer.warning_count &lt;= #{maxWarningCount}
+            </if>
+            <if test="minWarningCount != null and minWarningCount != '' or minWarningCount == 0">
+                and toer.warning_count &gt;= #{minWarningCount}
+            </if>
+            <if test="clientWebsocketStatus != null and clientWebsocketStatus != ''">
+                and toer.client_websocket_status = #{clientWebsocketStatus}
+            </if>
+            <if test="status == null or status == ''">
+                and toer.status in ('FIRST_PREPARE','ANSWERING','BREAK_OFF','RESUME_PREPARE')
+            </if>
+            <if test="minMultipleFaceCount != null and minMultipleFaceCount != '' or minMultipleFaceCount == 0">
+                and toer.warning_multiple_face_count &gt;= #{minMultipleFaceCount}
+            </if>
+            <if test="maxMultipleFaceCount != null and maxMultipleFaceCount != '' or maxMultipleFaceCount == 0">
+                and toer.warning_multiple_face_count &lt;= #{maxMultipleFaceCount}
+            </if>
+            <if test="minExceptionCount != null and minExceptionCount != '' or minExceptionCount == 0">
+                and toer.exception_count &gt;= #{minExceptionCount}
+            </if>
+            <if test="maxExceptionCount != null and maxExceptionCount != '' or maxExceptionCount == 0">
+                and toer.exception_count &lt;= #{maxExceptionCount}
+            </if>
         </where>
     </select>
 
@@ -295,9 +295,8 @@
             left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = tees.exam_id
         </if>
         <where> 1 = 1
-            and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
             <if test="examId != null and examId != ''">
-                and toer.exam_id = #{examId}
+                and tees.exam_id = #{examId}
             </if>
             <if test="userId != null and userId != ''">
                 and tbeiu.user_id = #{userId}
@@ -338,6 +337,7 @@
             <if test="maxExceptionCount != null and maxExceptionCount != '' or maxExceptionCount == 0">
                 and toer.exception_count &lt;= #{maxExceptionCount}
             </if>
+            and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
         order by tiiwi.approve_status,CAST(teea.code AS UNSIGNED),CAST(tees.room_code AS UNSIGNED)
     </select>
@@ -406,8 +406,7 @@
     </update>
 
     <select id="invigilatePageProgressList" resultType="com.qmth.themis.business.bean.admin.InvigilateListProgressBean">
-        select
-        distinct tee.id as examId,
+        select tee.id as examId,
         tee.name as examName,
         teea.id as examActivityId,
         teea.code as examActivityCode,
@@ -438,7 +437,7 @@
         </if>
         <where>1 = 1
             <if test="examId != null and examId != ''">
-                and t.exam_id = #{examId}
+                and tees.exam_id = #{examId}
             </if>
             <if test="userId != null and userId != ''">
                 and tbeiu.user_id = #{userId}
@@ -517,7 +516,7 @@
         </if>
         <where>1 = 1
             <if test="examId != null and examId != ''">
-                and t.exam_id = #{examId}
+                and tees.exam_id = #{examId}
             </if>
             <if test="userId != null and userId != ''">
                 and tbeiu.user_id = #{userId}
@@ -609,77 +608,77 @@
             left join t_b_exam_invigilate_user tbeiu on tbeiu.exam_id = s.exam_id
         </if>
         <where> 1 = 1
-        <choose>
-            <when test="status != null and status != '' and status == 'UN_FINISH'">
-                and toer.id is null
-            </when>
-            <otherwise>
-                and toer.id is not null
-            </otherwise>
-        </choose>
-        <if test="examId != null and examId != ''">
-            and s.exam_id = #{examId}
-        </if>
-        <if test="userId != null and userId != ''">
-            and tbeiu.user_id = #{userId}
-        </if>
-        <if test="orgId != null and orgId != ''">
-            and tee.org_id = #{orgId}
-        </if>
-        <if test="examActivityId != null and examActivityId != ''">
-            and s.exam_activity_id = #{examActivityId}
-        </if>
-        <if test="roomCode != null and roomCode != ''">
-            and s.room_code = #{roomCode}
-        </if>
-        <if test="name != null and name !=''">
-            and s.name like CONCAT('%', #{name},'%')
-        </if>
-        <if test="identity != null and identity !=''">
-            and s.identity like CONCAT('%', #{identity},'%')
-        </if>
-        <if test="courseCode != null and courseCode != ''">
-            and s.course_code = #{courseCode}
-        </if>
-        <choose>
-            <when test="status == null">
-                and toer.status <![CDATA[ <> ]]> 'JUNK'
-            </when>
-            <when test="status != null and status != '' and status != 'UN_FINISH'">
+            <choose>
+                <when test="status != null and status != '' and status == 'UN_FINISH'">
+                    and toer.id is null
+                </when>
+                <otherwise>
+                    and toer.id is not null
+                </otherwise>
+            </choose>
+            <if test="examId != null and examId != ''">
+                and s.exam_id = #{examId}
+            </if>
+            <if test="userId != null and userId != ''">
+                and tbeiu.user_id = #{userId}
+            </if>
+            <if test="orgId != null and orgId != ''">
+                and tee.org_id = #{orgId}
+            </if>
+            <if test="examActivityId != null and examActivityId != ''">
+                and s.exam_activity_id = #{examActivityId}
+            </if>
+            <if test="roomCode != null and roomCode != ''">
+                and s.room_code = #{roomCode}
+            </if>
+            <if test="name != null and name !=''">
+                and s.name like CONCAT('%', #{name},'%')
+            </if>
+            <if test="identity != null and identity !=''">
+                and s.identity like CONCAT('%', #{identity},'%')
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and s.course_code = #{courseCode}
+            </if>
+            <choose>
+                <when test="status == null">
+                    and toer.status <![CDATA[ <> ]]> 'JUNK'
+                </when>
+                <when test="status != null and status != '' and status != 'UN_FINISH'">
+                    <choose>
+                        <when test="status == 'EXAMING'">
+                            and toer.status in ('ANSWERING','RESUME_PREPARE','BREAK_OFF')
+                        </when>
+                        <otherwise>
+                            and toer.status = #{status}
+                        </otherwise>
+                    </choose>
+                </when>
+            </choose>
+            <if test="maxWarningCount != null and maxWarningCount != '' or maxWarningCount == 0">
+                and toer.warning_count &lt;= #{maxWarningCount}
+            </if>
+            <if test="minWarningCount != null and minWarningCount != '' or minWarningCount == 0">
+                and toer.warning_count &gt;= #{minWarningCount}
+            </if>
+            <if test="breachStatus != null and breachStatus != '' or breachStatus == 0">
+                <if test="breachStatus == 0">
+                    and toer.breach_status = #{breachStatus}
+                </if>
+                <if test="breachStatus == 1">
+                    and (toer.breach_status = #{breachStatus} or toer.breach_status is null)
+                </if>
+            </if>
+            <if test="finishType != null and finishType != ''">
                 <choose>
-                    <when test="status == 'EXAMING'">
-                        and toer.status in ('ANSWERING','RESUME_PREPARE','BREAK_OFF')
+                    <when test="finishType == 'ALL'">
+                        and toer.finish_type in ('MANUAL','AUTO','BREACH','INTERRUPT')
                     </when>
                     <otherwise>
-                        and toer.status = #{status}
+                        and toer.finish_type = #{finishType}
                     </otherwise>
                 </choose>
-            </when>
-        </choose>
-        <if test="maxWarningCount != null and maxWarningCount != '' or maxWarningCount == 0">
-            and toer.warning_count &lt;= #{maxWarningCount}
-        </if>
-        <if test="minWarningCount != null and minWarningCount != '' or minWarningCount == 0">
-            and toer.warning_count &gt;= #{minWarningCount}
-        </if>
-        <if test="breachStatus != null and breachStatus != '' or breachStatus == 0">
-            <if test="breachStatus == 0">
-                and toer.breach_status = #{breachStatus}
-            </if>
-            <if test="breachStatus == 1">
-                and (toer.breach_status = #{breachStatus} or toer.breach_status is null)
             </if>
-        </if>
-        <if test="finishType != null and finishType != ''">
-            <choose>
-                <when test="finishType == 'ALL'">
-                    and toer.finish_type in ('MANUAL','AUTO','BREACH','INTERRUPT')
-                </when>
-                <otherwise>
-                    and toer.finish_type = #{finishType}
-                </otherwise>
-            </choose>
-        </if>
             <if test="minMultipleFaceCount != null and minMultipleFaceCount != '' or minMultipleFaceCount == 0">
                 and toer.warning_multiple_face_count &gt;= #{minMultipleFaceCount}
             </if>
@@ -1751,7 +1750,7 @@
             <if test="roomCode != null and roomCode != ''">
                 and tees.room_code = #{roomCode}
             </if>
-                and (t.status = 'FINISHED' or t.status = 'PERSISTED') and t.first_start_time is not null
+            and (t.status = 'FINISHED' or t.status = 'PERSISTED') and t.first_start_time is not null
         </where>
     </select>
 </mapper>