|
@@ -2,52 +2,50 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.qmth.themis.business.dao.TEOrgSummaryMapper">
|
|
<mapper namespace="com.qmth.themis.business.dao.TEOrgSummaryMapper">
|
|
|
|
|
|
- <select id="orgSummary" resultType="java.lang.Integer">
|
|
|
|
- <include refid="orgSummaryByOnlineCountCommon" />
|
|
|
|
- union all
|
|
|
|
- <include refid="orgSummaryByExamCountCommon" />
|
|
|
|
- union all
|
|
|
|
- <include refid="orgSummaryByFinishCountAndFinishStudentCountCommon" />
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
- <select id="orgSummaryByFinishCountAndFinishStudentCount" resultType="java.lang.Integer">
|
|
|
|
- <include refid="orgSummaryByFinishCountAndFinishStudentCountCommon" />
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
- <sql id="orgSummaryByFinishCountAndFinishStudentCountCommon">
|
|
|
|
- select count(1) as c
|
|
|
|
- from t_oe_exam_record toer
|
|
|
|
- where toer.STATUS in ('FINISHED', 'PERSISTED')
|
|
|
|
- <if test="orgId != null and orgId != '' and orgId > 0">
|
|
|
|
|
|
+ <select id="orgSummary" resultType="com.qmth.themis.business.bean.admin.OrgSummaryBean">
|
|
|
|
+ select
|
|
|
|
+ sum(case when (toer.client_websocket_status = 'ON_LINE'
|
|
<if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
<if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
and toer.exam_id in
|
|
and toer.exam_id in
|
|
<foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
#{examId}
|
|
#{examId}
|
|
</foreach>
|
|
</foreach>
|
|
- </if>
|
|
|
|
- </if>
|
|
|
|
- union all
|
|
|
|
- select count(tees.id) as c
|
|
|
|
- from t_e_exam_student tees
|
|
|
|
- left join t_oe_exam_record toer on toer.exam_student_id = tees.id and tees.current_record_id = toer.id
|
|
|
|
- where toer.STATUS in ('FINISHED', 'PERSISTED') or tees.already_exam_count > 0
|
|
|
|
- <if test="orgId != null and orgId != ''">
|
|
|
|
|
|
+ </if>) then 1 else 0 end) as onlineCount,
|
|
|
|
+ sum(case when (toer.status = 'ANSWERING' and toer.client_websocket_status = 'ON_LINE') or toer.status = 'RESUME_PREPARE' or toer.status = 'BREAK_OFF'
|
|
<if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
<if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
and toer.exam_id in
|
|
and toer.exam_id in
|
|
<foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
#{examId}
|
|
#{examId}
|
|
</foreach>
|
|
</foreach>
|
|
- </if>
|
|
|
|
- </if>
|
|
|
|
- </sql>
|
|
|
|
|
|
+ </if> then 1 else 0 end) as examCount,
|
|
|
|
+ sum(case when (toer.status in ('FINISHED', 'PERSISTED')
|
|
|
|
+ <if test="orgId != null and orgId != '' and orgId > 0">
|
|
|
|
+ <if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
|
|
+ and toer.exam_id in
|
|
|
|
+ <foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
|
|
+ #{examId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>) then 1 else 0 end) as finishCount,
|
|
|
|
+ sum(case when (tees.id and toer.status in ('FINISHED', 'PERSISTED') or tees.already_exam_count > 0
|
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
|
+ <if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
|
|
+ and toer.exam_id in
|
|
|
|
+ <foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
|
|
+ #{examId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </if>) then 1 else 0 end) as finishStudentCount
|
|
|
|
+ from t_oe_exam_record toer
|
|
|
|
+ left join t_e_exam_student tees on tees.current_record_id = toer.id
|
|
|
|
+ </select>
|
|
|
|
|
|
<select id="orgSummaryByFinishCount" resultType="java.lang.Integer">
|
|
<select id="orgSummaryByFinishCount" resultType="java.lang.Integer">
|
|
<include refid="orgSummaryByFinishCountCommon" />
|
|
<include refid="orgSummaryByFinishCountCommon" />
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<sql id="orgSummaryByFinishCountCommon">
|
|
<sql id="orgSummaryByFinishCountCommon">
|
|
- select count(1) as finishCount
|
|
|
|
- from t_oe_exam_record toer
|
|
|
|
|
|
+ select count(1) as finishCount from t_oe_exam_record toer
|
|
where toer.STATUS in ('FINISHED', 'PERSISTED')
|
|
where toer.STATUS in ('FINISHED', 'PERSISTED')
|
|
<if test="orgId != null and orgId != '' and orgId > 0">
|
|
<if test="orgId != null and orgId != '' and orgId > 0">
|
|
<if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
<if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
@@ -59,38 +57,6 @@
|
|
</if>
|
|
</if>
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
- <select id="orgSummaryByOnlineCount" resultType="java.lang.Integer">
|
|
|
|
- <include refid="orgSummaryByOnlineCountCommon" />
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
- <sql id="orgSummaryByOnlineCountCommon">
|
|
|
|
- select count(1) as c
|
|
|
|
- from t_oe_exam_record toer
|
|
|
|
- where toer.client_websocket_status = 'ON_LINE'
|
|
|
|
- <if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
|
|
- and toer.exam_id in
|
|
|
|
- <foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
|
|
- #{examId}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- </sql>
|
|
|
|
-
|
|
|
|
- <select id="orgSummaryByExamCount" resultType="java.lang.Integer">
|
|
|
|
- <include refid="orgSummaryByExamCountCommon" />
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
- <sql id="orgSummaryByExamCountCommon">
|
|
|
|
- select count(1) as c
|
|
|
|
- from t_oe_exam_record toer
|
|
|
|
- where (toer.STATUS = 'ANSWERING' and toer.client_websocket_status = 'ON_LINE') or toer.status = 'RESUME_PREPARE' or toer.status = 'BREAK_OFF'
|
|
|
|
- <if test="examIdSet != null and examIdSet != '' and examIdSet.size > 0">
|
|
|
|
- and toer.exam_id in
|
|
|
|
- <foreach collection="examIdSet" item="examId" index="index" open="(" close=")" separator=",">
|
|
|
|
- #{examId}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- </sql>
|
|
|
|
-
|
|
|
|
<insert id="saveOrgSummary">
|
|
<insert id="saveOrgSummary">
|
|
INSERT INTO t_e_org_summary
|
|
INSERT INTO t_e_org_summary
|
|
(${fieldName})
|
|
(${fieldName})
|