Explorar o código

查询课程评论加上小节的id

yuhongqi hai 3 semanas
pai
achega
864fae9c31

+ 1 - 1
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseCommentMapper.java

@@ -154,7 +154,7 @@ public interface FsUserCourseCommentMapper
             "</script>"})
             "</script>"})
     List<FsUserCourseCommentListUVO> selectFsUserCourseCommentListUVOAll(FsUserCourseCommentUParam param);
     List<FsUserCourseCommentListUVO> selectFsUserCourseCommentListUVOAll(FsUserCourseCommentUParam param);
 
 
-    List<FsUserCourseComment> selectFsUserCourseCommentListByTypeAndCourseId(@Param("type") int type,@Param("courseId") Long courseId);
+    List<FsUserCourseComment> selectFsUserCourseCommentListByTypeAndCourseId(@Param("type") int type,@Param("courseId") Long courseId,@Param("videoId") Long videoId);
 
 
     /**
     /**
      * 按课程ID和用户ID列表批量查询评论(type=1,未删除)
      * 按课程ID和用户ID列表批量查询评论(type=1,未删除)

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/IFsUserCourseCommentService.java

@@ -82,5 +82,5 @@ public interface IFsUserCourseCommentService
     int addComment(Long parentId);
     int addComment(Long parentId);
     int minusComment(Long parentId);
     int minusComment(Long parentId);
 
 
-    List<FsUserCourseComment> selectFsUserCourseCommentListByTypeAndCourseId(int i, Long courseId);
+    List<FsUserCourseComment> selectFsUserCourseCommentListByTypeAndCourseId(int i, Long courseId, Long videoId);
 }
 }

+ 2 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseCommentServiceImpl.java

@@ -151,8 +151,8 @@ public class FsUserCourseCommentServiceImpl implements IFsUserCourseCommentServi
     }
     }
 
 
     @Override
     @Override
-    public List<FsUserCourseComment> selectFsUserCourseCommentListByTypeAndCourseId(int type, Long courseId) {
-        return fsUserCourseCommentMapper.selectFsUserCourseCommentListByTypeAndCourseId(type,courseId);
+    public List<FsUserCourseComment> selectFsUserCourseCommentListByTypeAndCourseId(int type, Long courseId, Long videoId) {
+        return fsUserCourseCommentMapper.selectFsUserCourseCommentListByTypeAndCourseId(type,courseId,videoId);
     }
     }
 
 
     @Override
     @Override

+ 1 - 1
fs-service/src/main/resources/mapper/course/FsUserCourseCommentMapper.xml

@@ -111,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
     </update>
 
 
     <select id="selectFsUserCourseCommentListByTypeAndCourseId" resultType="com.fs.course.domain.FsUserCourseComment">
     <select id="selectFsUserCourseCommentListByTypeAndCourseId" resultType="com.fs.course.domain.FsUserCourseComment">
-        select * from fs_user_course_comment where type = #{type} and course_id = #{courseId} and is_del = 0 order by create_time desc
+        select * from fs_user_course_comment where type = #{type} and course_id = #{courseId} <if test="videoId != null"> and video_id = #{videoId} </if> and is_del = 0 order by create_time desc
     </select>
     </select>
 
 
     <select id="selectCommentsByCourseIdAndUserIds" resultMap="FsUserCourseCommentResult">
     <select id="selectCommentsByCourseIdAndUserIds" resultMap="FsUserCourseCommentResult">

+ 2 - 2
fs-user-app/src/main/java/com/fs/app/controller/CourseCommentController.java

@@ -112,7 +112,7 @@ public class CourseCommentController extends AppBaseController
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         try {
         try {
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
-            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId());
+            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId(),param.getVideoId());
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
         } catch (Exception ignore) {}
         } catch (Exception ignore) {}
 
 
@@ -135,7 +135,7 @@ public class CourseCommentController extends AppBaseController
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         try {
         try {
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
-            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId());
+            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId(),param.getVideoId());
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
         } catch (Exception ignore) {}
         } catch (Exception ignore) {}
         return R.ok().put("data",listPageInfo).put("defaultPageInfo",defaultPageInfo);
         return R.ok().put("data",listPageInfo).put("defaultPageInfo",defaultPageInfo);

+ 2 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/CourseCommentScrmController.java

@@ -91,7 +91,7 @@ public class CourseCommentScrmController extends AppBaseController
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         try {
         try {
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
-            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId());
+            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId(),param.getVideoId());
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
         } catch (Exception ignore) {}
         } catch (Exception ignore) {}
 
 
@@ -114,7 +114,7 @@ public class CourseCommentScrmController extends AppBaseController
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         PageInfo<FsUserCourseComment> defaultPageInfo= new PageInfo<>(fsUserCourseComments);
         try {
         try {
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
             PageHelper.startPage(param.getPageNum(), param.getPageSize());
-            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId());
+            fsUserCourseComments = fsUserCourseCommentService.selectFsUserCourseCommentListByTypeAndCourseId(3, param.getCourseId(),param.getVideoId());
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
             defaultPageInfo = new PageInfo<>(fsUserCourseComments);
         } catch (Exception ignore) {}
         } catch (Exception ignore) {}
         return R.ok().put("data",listPageInfo).put("defaultPageInfo",defaultPageInfo);
         return R.ok().put("data",listPageInfo).put("defaultPageInfo",defaultPageInfo);