Browse Source

巡考菜单优化

wangliang 2 năm trước cách đây
mục cha
commit
e5b0da47c9

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 2796
logs/themis-admin.log


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 17665
logs/themis-task.log


+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TIeInvigilateWarnInfoMapper.java

@@ -56,7 +56,7 @@ public interface TIeInvigilateWarnInfoMapper extends BaseMapper<TIeInvigilateWar
      */
     public List<TIeWarningNotifyDto> warningMessage(@Param("examId") Long examId, @Param("userId") Long userId, @Param("orgId") Long orgId);
 
-    public List<WarningNotifyBean> findLastMsg(@Param("conut") Integer conut, @Param("orgId") Long orgId);
+    public List<WarningNotifyBean> findLastMsg(@Param("count") Integer count, @Param("orgId") Long orgId);
 
     /**
      * 查找预警和异常信息

+ 6 - 11
themis-business/src/main/resources/mapper/TIeInvigilateWarnInfoMapper.xml

@@ -110,13 +110,6 @@
     </select>
 
     <select id="findLastMsg" resultType="com.qmth.themis.business.bean.admin.WarningNotifyBean">
-        SELECT
-        INSERT(rpad(substring(f.identity, 1, 2), char_length(f.identity), '*'),char_length(f.identity)-1,char_length(f.identity),substring(f.identity, char_length(f.identity) - 1 , char_length(f.identity) - 2)) as identity,
-        f.name,
-        f.room_code roomCode,
-        tem.*
-        FROM
-        (
         SELECT
         t.exam_student_id AS examStudentId,
         t.info,
@@ -126,18 +119,20 @@
         t.exam_id AS examId,
         t.exam_record_id AS examRecordId,
         t.create_time createTime,
-        IF(t.approve_status = 0,'未处理','已处理') as approveStatus
+        IF(t.approve_status = 0,'未处理','已处理') as approveStatus,
+        INSERT(rpad(substring(f.identity, 1, 2), char_length(f.identity), '*'),char_length(f.identity)-1,char_length(f.identity),substring(f.identity, char_length(f.identity) - 1 , char_length(f.identity) - 2)) as identity,
+        f.name,
+        f.room_code roomCode
         FROM
         t_ie_invigilate_warn_info t
         left join t_e_exam h on t.exam_id=h.id
+        LEFT JOIN t_e_exam_student f ON t.exam_student_id = f.id
         where 1=1
         <if test="orgId != null">
             and h.org_id=#{orgId}
         </if>
         and h.monitor_status <![CDATA[ <> ]]> 'FINISHED'
-        order by t.create_time desc limit #{conut}
-        ) tem
-        LEFT JOIN t_e_exam_student f ON tem.examStudentId = f.id
+        order by t.create_time desc limit #{count}
     </select>
 
     <select id="findWarnAndExceptionInfo" resultType="java.lang.Integer">

+ 17 - 36
themis-business/src/main/resources/mapper/TOeExamRecordMapper.xml

@@ -848,16 +848,8 @@
 
     <select id="patrolReport" resultType="com.qmth.themis.business.bean.admin.InvigilateListPatrolReportBean">
         select
-        t.roomCode,
-        t.roomName,
-        sum(t.warningCount) as warningCount,
-        count((t.client_websocket_status = 'OFF_LINE' or t.client_websocket_status is null) or null) as
-        clientWebsocketStatusCount
-        from
-        (
-        select
-        s.room_code roomCode, s.room_name roomName, IFNULL(t.warning_count,
-        0) as warningCount, t.client_websocket_status
+        s.room_code roomCode, s.room_name roomName, sum(IFNULL(t.warning_count, 0)) as warningCount,
+        count((t.client_websocket_status = 'OFF_LINE' or t.client_websocket_status is null) or null) as clientWebsocketStatusCount
         from
         t_oe_exam_record t
         left join t_e_exam_student s on
@@ -878,11 +870,8 @@
             </if>
             and t.STATUS in ('FIRST_PREPARE','ANSWERING','BREAK_OFF','RESUME_PREPARE')
         </where>
-        ) t
-        group by
-        t.roomCode,
-        t.roomName
-        order by t.roomCode
+        group by s.room_code,s.room_name
+        order by s.room_code
     </select>
 
     <select id="getOnlineCount" resultType="java.lang.Long">
@@ -1111,37 +1100,29 @@
     <select id="findByOrgId" resultType="java.lang.Long">
         select count(1) as c
         from t_oe_exam_record toer
-        where exists(
-                select tee.id
-                from t_e_exam tee
-                where tee.org_id = #{orgId}
-                  and toer.exam_id = tee.id
-                  and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
-            )
+        join t_e_exam tee on tee.id = toer.exam_id
+        where 1 = 1
+          and tee.org_id = #{orgId}
+          and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
           and toer.STATUS in ('FIRST_PREPARE','ANSWERING','BREAK_OFF','RESUME_PREPARE')
           and toer.client_websocket_status = 'ON_LINE'
         union all
         select count(1) as c
         from t_oe_exam_record toer
-        where exists(
-                select tee.id
-                from t_e_exam tee
-                where tee.org_id = #{orgId}
-                  and toer.exam_id = tee.id
-                  and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
-            )
+        join t_e_exam tee on tee.id = toer.exam_id
+        where 1 = 1
+          and tee.org_id = #{orgId}
+          and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
           and toer.STATUS = 'FIRST_PREPARE'
           and toer.client_websocket_status = 'ON_LINE'
         union all
         select count(1) as c
         from t_oe_exam_record toer
-        where exists(
-                select tee.id
-                from t_e_exam tee
-                where tee.org_id = #{orgId}
-                  and toer.exam_id = tee.id
-                  and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
-            )
+        join t_e_exam tee on tee.id = toer.exam_id
+        where 1 = 1
+          and tee.org_id = #{orgId}
+          and toer.exam_id = tee.id
+          and tee.monitor_status <![CDATA[ <> ]]> 'FINISHED'
           and toer.STATUS = 'ANSWERING'
           and toer.client_websocket_status = 'ON_LINE'
     </select>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác