|
|
@@ -30,7 +30,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectClassesDirectedBuildStats" resultType="com.alibaba.fastjson2.JSONObject">
|
|
|
- SELECT c.`class_id` classId, c.`name` className, count(*) `total`, SUM(if(ls.`major_plan_id` IS NULL, 1, 0)) unexact,
|
|
|
+ SELECT c.`class_id` classId, c.`name` className, lt.`batch_id` batchId, lt.`name` batchName, count(*) `total`, SUM(if(ls.`major_plan_id` IS NULL, 1, 0)) unexact,
|
|
|
SUM(IF(ls.`major_plan_id` IS not NULL and ts.`student_id` IS NULL, 1, 0)) unsend,
|
|
|
SUM(IF(ls.`major_plan_id` IS not NULL and ts.`student_id` IS NOT NULL and ts.`status` != 4 , 1, 0)) unfinish,
|
|
|
sum(if(ls.`major_plan_id` IS NOT NULL and ts.`student_id` is not null AND ts.`status` = 4 , 1, 0)) send
|
|
|
@@ -38,6 +38,7 @@
|
|
|
join `learn_student` ls on tc.`class_id` = ls.`class_id`
|
|
|
join `dz_classes` c on ls.`class_id` = c.`class_id`
|
|
|
JOIN `sys_user` u ON ls.`student_id` = u.`user_id`
|
|
|
+ join `learn_test` lt on lt.`year` = #{year} <if test="batchId != null"> and lt.`batch_id` = #{batchId} </if>
|
|
|
LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id`
|
|
|
<if test="batchId != null"> and ts.`batch_id` = #{batchId} </if>
|
|
|
<if test="buildType != null"> AND ts.`build_type` = #{buildType} </if>
|
|
|
@@ -50,11 +51,12 @@
|
|
|
<if test="majorPlanId != null"> AND ls.`major_plan_id` = #{majorPlanId}</if>
|
|
|
<if test="examType != null and examType != ''"> AND u.`exam_type` = #{examType}</if>
|
|
|
</where>
|
|
|
- group by c.`class_id`, c.`name`
|
|
|
+ group by c.`class_id`, c.`name`, lt.`batch_id`, lt.`name`
|
|
|
+ order by c.`class_id`, c.`name`, lt.`batch_id`, lt.`name`
|
|
|
</select>
|
|
|
|
|
|
<select id="selectClassesBuildStats" resultType="com.alibaba.fastjson2.JSONObject">
|
|
|
- SELECT c.`class_id` classId, c.`name` className, count(*) `total`,
|
|
|
+ SELECT c.`class_id` classId, c.`name` className, lt.`batch_id` batchId, lt.`name` batchName, count(*) `total`,
|
|
|
SUM(IF(ts.`student_id` IS NULL, 1, 0)) unsend,
|
|
|
SUM(IF(ts.`student_id` IS NOT NULL and ts.`status` != 4 , 1, 0)) unfinish,
|
|
|
sum(if(ts.`student_id` is not null AND ts.`status` = 4 , 1, 0)) send
|
|
|
@@ -62,32 +64,36 @@
|
|
|
join `learn_student` ls on tc.`class_id` = ls.`class_id`
|
|
|
JOIN sys_user u ON ls.`student_id` = u.`user_id`
|
|
|
join `dz_classes` c on ls.`class_id` = c.`class_id`
|
|
|
+ join `learn_test` lt on lt.`year` = #{year} <if test="batchId != null"> and lt.`batch_id` = #{batchId} </if>
|
|
|
LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_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>tc.`teacher_id` = #{teacherId}
|
|
|
+ <if test="classId != null"> AND ls.`class_id` = #{classId}</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>
|
|
|
</where>
|
|
|
- group by c.`class_id`, c.`name`
|
|
|
+ group by c.`class_id`, c.`name`, lt.`batch_id`, lt.`name`
|
|
|
+ order by c.`class_id`, c.`name`, lt.`batch_id`, lt.`name`
|
|
|
</select>
|
|
|
|
|
|
<select id="getPaperStudentRecords" resultType="com.alibaba.fastjson2.JSONObject">
|
|
|
- SELECT ls.`student_id` studentId, u.`nick_name` studentName, u.`phonenumber` mobile, ts.`batch_id` batchId, ts.`subject_id` subjectId, ts.`paper_id` paperId, lp.`paperName`, lp.`fenshu` total, le.`score`, le.`score_rate` rate,
|
|
|
+ SELECT ts.examinee_id examineeId, ls.`student_id` studentId, u.`nick_name` studentName, dc.`name` className, u.`phonenumber` mobile, ts.`batch_id` batchId, ts.`subject_id` subjectId, ts.`paper_id` paperId, lp.`paperName`, lp.`fenshu` total, le.`score`, le.`score_rate` rate,
|
|
|
lt.`name` batchName, ds.`subject_name` subjectName,
|
|
|
CASE WHEN ls.`major_plan_id` IS NULL AND #{buildType} IN ('ExactHand', 'ExactIntelligent') THEN '10' WHEN ts.`student_id` IS NULL THEN '20' WHEN ts.`status` != 4 THEN '30' ELSE '40' END state
|
|
|
FROM `learn_student` ls
|
|
|
JOIN `sys_user` u ON ls.`student_id` = u.`user_id`
|
|
|
JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id`
|
|
|
+ JOIN `dz_classes` dc on dc.`class_id` = ls.`class_id`
|
|
|
JOIN `dz_subject` ds on ds.`subject_id` = ts.`subject_id`
|
|
|
join `learn_test` lt on lt.`batch_id` = ts.`batch_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>
|
|
|
- LEFT JOIN `learn_examinee` le ON le.`paper_id` = ts.`paper_id` AND le.`student_id` = ts.`student_id`
|
|
|
+ LEFT JOIN `learn_examinee` le ON le.examinee_id = ts.examinee_id
|
|
|
LEFT JOIN `learn_paper` lp ON ts.`paper_id` = lp.`id`
|
|
|
<where> ls.`class_id` = #{classId}
|
|
|
<if test="universityId != null"> AND ls.`university_id` = #{universityId}</if>
|