|
@@ -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>
|