wangliang 1 жил өмнө
parent
commit
f2717735ab

+ 28 - 190
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -10,185 +10,22 @@
                         teea.code as       examActivityCode,
                         t.exam_student_id  examStudentId,
                         t.id               examRecordId,
-        INSERT
-        (
-        rpad
-        (
-        substring
-        (
-        s
-        .
-        identity
-        ,
-        1
-        ,
-        2
-        )
-        ,
-        char_length
-        (
-        s
-        .
-        identity
-        )
-        ,
-        '*'
-        )
-        ,
-        char_length
-        (
-        s
-        .
-        identity
-        )
-        -
-        1
-        ,
-        char_length
-        (
-        s
-        .
-        identity
-        )
-        ,
-        substring
-        (
-        s
-        .
-        identity
-        ,
-        char_length
-        (
-        s
-        .
-        identity
-        )
-        -
-        1
-        ,
-        char_length
-        (
-        s
-        .
-        identity
-        )
-        -
-        2
-        )
-        )
-        as
-        identity
-        ,
-        s
-        .
-        room_code
-        roomCode
-        ,
-        s
-        .
-        room_name
-        roomName
-        ,
-        s
-        .
-        name
-        name
-        ,
-        s
-        .
-        course_name
-        courseName
-        ,
-        s
-        .
-        course_code
-        courseCode
-        ,
-        IFNULL
-        (
-        t
-        .
-        paper_download
-        ,
-        1
-        )
-        paperDownload
-        ,
-        t
-        .
-        status
-        statusCode
-        ,
-        TRUNCATE
-        (
-        t
-        .
-        answer_progress
-        ,
-        2
-        )
-        progress
-        ,
-        IFNULL
-        (
-        t
-        .
-        client_current_ip
-        ,
-        '无'
-        )
-        clientCurrentIp
-        ,
-        IFNULL
-        (
-        t
-        .
-        warning_count
-        ,
-        0
-        )
-        as
-        warningCount
-        ,
-        IFNULL
-        (
-        t
-        .
-        breach_status
-        ,
-        1
-        )
-        as
-        breachStatus
-        ,
-        IFNULL
-        (
-        t
-        .
-        client_websocket_status
-        ,
-        'OFF_LINE'
-        )
-        as
-        clientWebsocketStatus
-        ,
-        t
-        .
-        client_last_sync_time
-        as
-        updateTime
-        ,
-        t
-        .
-        monitor_video_source
-        as
-        monitorVideoSource
-        ,
-        t
-        .
-        monitor_record
-        as
-        monitorRecord
+        INSERT(rpad(substring(s.identity, 1, 2), char_length(s.identity), '*'),char_length(s.identity)-1,char_length(s.identity),substring(s.identity, char_length(s.identity) - 1 , char_length(s.identity) - 2)) as identity,
+        s.room_code roomCode,
+        s.room_name roomName,
+        s.name name,
+        s.course_name courseName,
+        s.course_code courseCode,
+        IFNULL (t.paper_download ,1) paperDownload,
+        t.status statusCode,
+        TRUNCATE (t.answer_progress ,2) progress,
+        IFNULL (t.client_current_ip ,'无' ) clientCurrentIp,
+        IFNULL (t.warning_count ,0) as warningCount,
+        IFNULL (t.breach_status ,1) as breachStatus,
+        IFNULL (t.client_websocket_status ,'OFF_LINE') as clientWebsocketStatus,
+        t.client_last_sync_time as updateTime,
+        t.monitor_video_source as monitorVideoSource,
+        t.monitor_record as monitorRecord
     </sql>
 
     <sql id="invigilatePageMiddle">
@@ -685,7 +522,10 @@
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
-        group by tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number,t.breach_status,tees.class_no) t
+        group by t.id,
+        tees.room_code,
+        tees.room_name,
+        tees.course_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number,t.breach_status,tees.class_no) t
         <where>
             <if test="status != null and status != '' or status == 0">
                 <choose>
@@ -780,7 +620,10 @@
             </if>
             and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
         </where>
-        group by tee.id,tees.room_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number,t.breach_status,tees.class_no) t
+        group by t.id,
+        tees.room_code,
+        tees.room_name,
+        tees.course_code,tee.name,teea.id,teea.code,tees.`identity`,tees.name,leftExamCount,statusTemp,tes.mobile_number,t.breach_status,tees.class_no) t
         <where>
             <if test="status != null and status != '' or status == 0">
                 <choose>
@@ -1388,8 +1231,8 @@
             <if test="examActivityId != null and examActivityId != ''">
                 and t.exam_activity_id = #{examActivityId}
             </if>
-            and (t.STATUS = 'ANSWERING' and t.client_websocket_status = 'ON_LINE')
-            or t.STATUS in ('RESUME_PREPARE','BREAK_OFF')
+            and ((t.STATUS = 'ANSWERING' and t.client_websocket_status = 'ON_LINE')
+            or t.STATUS in ('RESUME_PREPARE','BREAK_OFF'))
         </where>
         union all
         select
@@ -1886,7 +1729,6 @@
         from t_e_exam_student tees
                  left join t_oe_exam_record toer on toer.exam_student_id = tees.id
         where toer.STATUS in ('FINISHED', 'PERSISTED')
-          and toer.id is not null
     </select>
 
     <select id="orgDataCount" resultType="com.qmth.themis.business.bean.admin.OrgDataCountBean">
@@ -1929,13 +1771,9 @@
                tir.province,
                count(toer.id) as onlineCount
         from t_ip_region tir
-                 join t_oe_exam_record toer on
-            tir.exam_record_id = toer.id
-                 join t_e_exam tee on
-            toer.exam_id = tee.id
+            join t_oe_exam_record toer on tir.exam_record_id = toer.id
         WHERE toer.client_websocket_status = 'ON_LINE'
-          and tir.country != '0'
-	        and tir.province != '0'
+          and tir.country != '0' and tir.province != '0'
         group by
             tir.country,
             tir.province