fix: 【FCJDFDXTXS-190】资源学习情况只查询有报名记录的数据

This commit is contained in:
liu.zixi
2025-12-18 18:48:12 +08:00
parent ef30ee17c3
commit 0270653d22

View File

@@ -122,6 +122,13 @@ public class StudyCourseItemDao extends BaseDao<StudyCourseItem> {
// courseId
builder.append(System.lineSeparator());
builder.append("WHERE bsc.course_id = :courseId");
// 只查询报过名的数据
builder.append(System.lineSeparator());
builder.append("AND EXISTS (");
builder.append(System.lineSeparator());
builder.append("SELECT 1 FROM boe_study_signup s WHERE s.aid = bsc.aid");
builder.append(System.lineSeparator());
builder.append(")");
// 用户
if (userIds != null && !userIds.isEmpty()) {
builder.append(System.lineSeparator());