|
@@ -8,6 +8,7 @@ import com.fs.course.vo.FsUserCourseCommentListUVO;
|
|
|
import com.fs.course.vo.FsUserCourseCommentListVO;
|
|
|
import com.fs.course.vo.FsUserCourseCommentReplyListUVO;
|
|
|
import com.fs.course.vo.FsUserCourseCommentVO;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
|
|
@@ -118,13 +119,20 @@ public interface FsUserCourseCommentMapper
|
|
|
List<FsUserCourseCommentListUVO> selectFsUserCourseCommentListVOByCourseId(Long courseId);
|
|
|
|
|
|
@Select({"<script> " +
|
|
|
- "select c.*,u.nick_name,u.avatar,tu.nick_name to_nick_name from fs_user_course_comment c " +
|
|
|
- " LEFT JOIN fs_user u ON c.user_id=u.user_id " +
|
|
|
- " LEFT JOIN fs_user tu ON tu.user_id =c.to_user_id " +
|
|
|
- " where c.is_del = 0 and c.type = 2 and c.parent_id = #{commentId} " +
|
|
|
- " order by c.comment_id desc "+
|
|
|
+ "SELECT c.*, u.nick_name, u.avatar, tu.nick_name to_nick_name, " +
|
|
|
+ "<if test='userId != null and userId != \"\"'>" +
|
|
|
+ " IFNULL(l.id, 0) AS is_like " +
|
|
|
+ "</if>" +
|
|
|
+ "FROM fs_user_course_comment c " +
|
|
|
+ "LEFT JOIN fs_user u ON c.user_id = u.user_id " +
|
|
|
+ "LEFT JOIN fs_user tu ON tu.user_id = c.to_user_id " +
|
|
|
+ "<if test='userId != null and userId != \"\"'>" +
|
|
|
+ " LEFT JOIN fs_user_course_comment_like l ON c.comment_id = l.comment_id AND #{userId} = l.user_id " +
|
|
|
+ "</if>" +
|
|
|
+ "WHERE c.is_del = 0 AND c.type = 2 AND c.parent_id = #{commentId} " +
|
|
|
+ "ORDER BY c.comment_id DESC" +
|
|
|
"</script>"})
|
|
|
- List<FsUserCourseCommentReplyListUVO> selectFsUserCourseCommentReplyListUVO(Long commentId);
|
|
|
+ List<FsUserCourseCommentReplyListUVO> selectFsUserCourseCommentReplyListUVO(@Param("commentId") Long commentId, @Param("userId") String userId);
|
|
|
|
|
|
@Select({"<script> " +
|
|
|
"select c.*,u.nick_name,u.avatar,tu.nick_name to_nick_name from fs_user_course_comment c " +
|