feat(study): 添加学生统计查询中的年份筛选功能

dev
zhaokai 2026-03-09 17:53:41 +08:00
parent f4db959e5d
commit 12407cb28a
2 changed files with 9 additions and 0 deletions

View File

@ -33,5 +33,7 @@ public class StudentCountQry {
private List<Long> corpinfoIds;
private List<String> phones;
private String year;
}

View File

@ -132,6 +132,9 @@
from
user u
left join training_user tu on tu.phone = u.username
left join student s on s.phone=u.username
left join student_exam_record ser on ser.student_id = s.student_id
left join class c on ser.class_id = c.class_id
where u.delete_enum = 'FALSE'
AND u.employment_flag = '1'
and tu.start_time &lt;= now()
@ -142,6 +145,10 @@
#{corpinfoId}
</foreach>
</if>
<if test="params.year != null and params.year != ''">
AND (DATE_FORMAT(c.start_time, '%Y') = #{params.studentId}
OR DATE_FORMAT(c.start_time, '%Y') = #{params.studentId})
</if>
GROUP BY u.corpinfo_id
</select>