From fee3f263bcd761e50215351473f02af9f81c57ca Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Wed, 17 Jul 2024 19:14:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=AE=8C=E6=88=90=E6=83=85=E5=86=B5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?,=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97,=E5=85=88=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xboe/module/course/dao/CourseContentDao.java | 8 ++++++++ .../school/study/service/impl/StudySignupServiceImpl.java | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseContentDao.java b/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseContentDao.java index b945ea63..e1f7aeca 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseContentDao.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/course/dao/CourseContentDao.java @@ -1,10 +1,13 @@ package com.xboe.module.course.dao; +import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import com.xboe.core.orm.BaseDao; import com.xboe.module.course.entity.CourseContent; +import java.util.List; + @Repository public class CourseContentDao extends BaseDao { @@ -20,4 +23,9 @@ public class CourseContentDao extends BaseDao { int count=count(hql, courseId); return count; } + + public List findContentList(String courseId) { + String sql = "select * from CourseContent c where c.courseId = ?1"; + return findList(sql, courseId); + } } diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java index 7f7f629d..4adbdfcd 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudySignupServiceImpl.java @@ -137,9 +137,9 @@ public class StudySignupServiceImpl implements IStudySignupService{ @Override public StudyCourseItem addStudyCourseItem(StudySignup signup) { - List courseContents = contentDao.sqlFindList("SELECT * from boe_course_content where course_id = "+ signup.getCourseId()); + List courseContents = contentDao.findContentList(signup.getCourseId()); if (!courseContents.isEmpty()) { - log.info("查看在线课集合内容数据(共 {} 条记录)", courseContents.toString()); + log.info("查看在线课集合内容数据(共 {} 条记录)", courseContents.size()); for (CourseContent c : courseContents){ log.info("查看在线课内容数据: {}", c); // 使用toString()或自定义格式化字符串