|
@@ -38,13 +38,17 @@
|
|
|
join `learn_student` ls on tc.`class_id` = ls.`class_id`
|
|
join `learn_student` ls on tc.`class_id` = ls.`class_id`
|
|
|
join `dz_classes` c on ls.`class_id` = c.`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 `sys_user` u ON ls.`student_id` = u.`user_id`
|
|
|
- LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` and ts.`batch_id` = #{batchId} AND ts.`build_type` = #{buildType} and ts.`subject_id` = #{subjectId}
|
|
|
|
|
|
|
+ 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}
|
|
<where>tc.`teacher_id` = #{teacherId}
|
|
|
|
|
+ <if test="classId != null"> AND ls.`class_id` = #{classId}</if>
|
|
|
<if test="buildType != null and buildType = 'ExactIntelligent'"> AND ls.`university_id` is not null</if>
|
|
<if test="buildType != null and buildType = 'ExactIntelligent'"> AND ls.`university_id` is not null</if>
|
|
|
<if test="universityId != null"> AND ls.`university_id` = #{universityId}</if>
|
|
<if test="universityId != null"> AND ls.`university_id` = #{universityId}</if>
|
|
|
<if test="majorGroup != null"> AND ls.`major_group` = #{majorGroup}</if>
|
|
<if test="majorGroup != null"> AND ls.`major_group` = #{majorGroup}</if>
|
|
|
<if test="majorPlanId != null"> AND ls.`major_plan_id` = #{majorPlanId}</if>
|
|
<if test="majorPlanId != null"> AND ls.`major_plan_id` = #{majorPlanId}</if>
|
|
|
- <if test="examType != null and examType != ''"> AND u.`exam_type` = #{examType}</if>
|
|
|
|
|
|
|
+ <if test="examType != null and examType != ''"> AND u.`exam_type` = #{examType}</if>
|
|
|
</where>
|
|
</where>
|
|
|
group by c.`class_id`, c.`name`
|
|
group by c.`class_id`, c.`name`
|
|
|
</select>
|
|
</select>
|
|
@@ -56,9 +60,12 @@
|
|
|
sum(if(ts.`student_id` is not null AND ts.`status` = 4 , 1, 0)) send
|
|
sum(if(ts.`student_id` is not null AND ts.`status` = 4 , 1, 0)) send
|
|
|
FROM `dz_teacher_class` tc
|
|
FROM `dz_teacher_class` tc
|
|
|
join `learn_student` ls on tc.`class_id` = ls.`class_id`
|
|
join `learn_student` ls on tc.`class_id` = ls.`class_id`
|
|
|
- JOIN sys_user u ON ls.`student_id` = u.`user_id` AND u.`exam_type` = #{examType}
|
|
|
|
|
|
|
+ JOIN sys_user u ON ls.`student_id` = u.`user_id`
|
|
|
join `dz_classes` c on ls.`class_id` = c.`class_id`
|
|
join `dz_classes` c on ls.`class_id` = c.`class_id`
|
|
|
- LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` and ts.`batch_id` = #{batchId} AND ts.`build_type` = #{buildType} and ts.`subject_id` = #{subjectId}
|
|
|
|
|
|
|
+ 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}
|
|
<where>tc.`teacher_id` = #{teacherId}
|
|
|
<if test="universityId != null"> AND ls.`university_id` = #{universityId}</if>
|
|
<if test="universityId != null"> AND ls.`university_id` = #{universityId}</if>
|
|
|
<if test="majorGroup != null"> AND ls.`major_group` = #{majorGroup}</if>
|
|
<if test="majorGroup != null"> AND ls.`major_group` = #{majorGroup}</if>
|
|
@@ -68,6 +75,29 @@
|
|
|
group by c.`class_id`, c.`name`
|
|
group by c.`class_id`, c.`name`
|
|
|
</select>
|
|
</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,
|
|
|
|
|
+ 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_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_paper` lp ON ts.`paper_id` = lp.`id`
|
|
|
|
|
+ <where> ls.`class_id` = #{classId}
|
|
|
|
|
+ <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>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<sql id="selectDzClassesVo">
|
|
<sql id="selectDzClassesVo">
|
|
|
select t1.class_id, t1.dept_id, t1.school_id, t1.year, t1.name, t1.online, t1.status, t1.stats, t1.create_time, t1.update_time,t1.is_default,
|
|
select t1.class_id, t1.dept_id, t1.school_id, t1.year, t1.name, t1.online, t1.status, t1.stats, t1.create_time, t1.update_time,t1.is_default,
|
|
|
t2.id, t2.name school_name, t2.dept_id, t2.pro, t2.city, t2.area
|
|
t2.id, t2.name school_name, t2.dept_id, t2.pro, t2.city, t2.area
|