|
|
@@ -127,7 +127,8 @@
|
|
|
LEFT JOIN `dz_school` train_school ON ls.`school_id` = train_school.`id`
|
|
|
LEFT JOIN `dz_classes` train_class ON ls.`class_id` = train_class.`class_id`
|
|
|
LEFT JOIN `dz_agent` agent ON (card.`agent_id` = agent.`agent_id` OR card.`leaf_agent_id` = agent.`agent_id` OR (u.`invite_code` IS NOT NULL AND u.`invite_code` != '' AND CAST(u.`invite_code` AS UNSIGNED) = agent.`agent_id`))
|
|
|
- LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` AND ts.`batch_id` = lt.`batch_id` AND ts.`class_id` = tc.`class_id`
|
|
|
+ LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` AND ts.`class_id` = tc.`class_id`
|
|
|
+ <if test="batchId != null"> AND ts.`batch_id` = #{batchId} </if>
|
|
|
<if test="buildType != null"> AND ts.`build_type` = #{buildType} </if>
|
|
|
<if test="subjectId != null"> AND ts.`subject_id` = #{subjectId} </if>
|
|
|
<where>
|
|
|
@@ -135,13 +136,16 @@
|
|
|
<if test="classId != null"> AND ls.`class_id` = #{classId}</if>
|
|
|
<if test="batchId != null"> AND lt.`batch_id` = #{batchId}</if>
|
|
|
<if test="universityId != null"> AND ls.`university_id` = #{universityId}</if>
|
|
|
+ <if test="majorGroup != null"> AND ls.`major_group` = #{majorGroup}</if>
|
|
|
<if test="majorPlanId != null"> AND ls.`major_plan_id` = #{majorPlanId}</if>
|
|
|
<if test="examType != null and examType != ''"> AND u.`exam_type` = #{examType}</if>
|
|
|
<!-- 根据统计类型过滤 -->
|
|
|
<choose>
|
|
|
<!-- send: 组卷已完成 -->
|
|
|
<when test="statType == 'send'">
|
|
|
- AND ls.`major_plan_id` IS NOT NULL
|
|
|
+ <if test="buildType != null and (buildType == 'ExactIntelligent' or buildType == 'ExactHand')">
|
|
|
+ AND ls.`major_plan_id` IS NOT NULL
|
|
|
+ </if>
|
|
|
AND ts.`student_id` IS NOT NULL
|
|
|
AND ts.`status` = 4
|
|
|
</when>
|
|
|
@@ -149,19 +153,23 @@
|
|
|
<when test="statType == 'total'">
|
|
|
<!-- 不添加额外条件,返回所有学生 -->
|
|
|
</when>
|
|
|
- <!-- unexact: 未定向未组卷 -->
|
|
|
+ <!-- unexact: 未定向未组卷(仅定向模式) -->
|
|
|
<when test="statType == 'unexact'">
|
|
|
AND ls.`major_plan_id` IS NULL
|
|
|
</when>
|
|
|
<!-- unfinish: 组卷未完成 -->
|
|
|
<when test="statType == 'unfinish'">
|
|
|
- AND ls.`major_plan_id` IS NOT NULL
|
|
|
+ <if test="buildType != null and (buildType == 'ExactIntelligent' or buildType == 'ExactHand')">
|
|
|
+ AND ls.`major_plan_id` IS NOT NULL
|
|
|
+ </if>
|
|
|
AND ts.`student_id` IS NOT NULL
|
|
|
AND ts.`status` != 4
|
|
|
</when>
|
|
|
- <!-- unsend: 定向未组卷 -->
|
|
|
+ <!-- unsend: 定向未组卷(定向模式)或未组卷(全量模式) -->
|
|
|
<when test="statType == 'unsend'">
|
|
|
- AND ls.`major_plan_id` IS NOT NULL
|
|
|
+ <if test="buildType != null and (buildType == 'ExactIntelligent' or buildType == 'ExactHand')">
|
|
|
+ AND ls.`major_plan_id` IS NOT NULL
|
|
|
+ </if>
|
|
|
AND ts.`student_id` IS NULL
|
|
|
</when>
|
|
|
</choose>
|