|
@@ -70,17 +70,20 @@ public interface FsUserCourseCommentMapper
|
|
|
public int deleteFsUserCourseCommentByCommentIds(Long[] commentIds);
|
|
public int deleteFsUserCourseCommentByCommentIds(Long[] commentIds);
|
|
|
|
|
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
- "select c.*,u.nick_name,u.phone,u.avatar from fs_user_course_comment c LEFT JOIN fs_user u ON c.user_id=u.user_id"+
|
|
|
|
|
|
|
+ "select c.*,u.nick_name as nickNameOriginal,u.phone,u.avatar from fs_user_course_comment c LEFT JOIN fs_user u ON c.user_id=u.user_id"+
|
|
|
"<where> \n" +
|
|
"<where> \n" +
|
|
|
" <if test=\"userId != null \"> and c.user_id = #{userId}</if>\n" +
|
|
" <if test=\"userId != null \"> and c.user_id = #{userId}</if>\n" +
|
|
|
" <if test=\"courseId != null \"> and c.course_id = #{courseId}</if>\n" +
|
|
" <if test=\"courseId != null \"> and c.course_id = #{courseId}</if>\n" +
|
|
|
|
|
+ " <if test=\"videoId != null \"> and c.video_id = #{videoId}</if>\n" +
|
|
|
" <if test=\"type != null \"> and c.type = #{type}</if>\n" +
|
|
" <if test=\"type != null \"> and c.type = #{type}</if>\n" +
|
|
|
|
|
+ " <if test=\"excludeFeatured != null and excludeFeatured == true\"> and (c.type is null or c.type != 3) and (c.is_del = 0 or c.is_del is null)</if>\n" +
|
|
|
" <if test=\"parentId != null \"> and c.parent_id = #{parentId}</if>\n" +
|
|
" <if test=\"parentId != null \"> and c.parent_id = #{parentId}</if>\n" +
|
|
|
" <if test=\"content != null and content != ''\"> and c.content = #{content}</if>\n" +
|
|
" <if test=\"content != null and content != ''\"> and c.content = #{content}</if>\n" +
|
|
|
" <if test=\"replyCount != null \"> and c.reply_count = #{replyCount}</if>\n" +
|
|
" <if test=\"replyCount != null \"> and c.reply_count = #{replyCount}</if>\n" +
|
|
|
|
|
+ " <if test=\"nickName != null and nickName != ''\"> and (u.nick_name like concat('%', #{nickName}, '%') or c.nick_name like concat('%', #{nickName}, '%'))</if>\n" +
|
|
|
" <if test=\"phone != null \"> and u.phone = #{phone}</if>\n" +
|
|
" <if test=\"phone != null \"> and u.phone = #{phone}</if>\n" +
|
|
|
" </where>" +
|
|
" </where>" +
|
|
|
- "order by comment_id desc"+
|
|
|
|
|
|
|
+ "order by c.comment_id desc"+
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
List<FsUserCourseCommentListVO> selectFsUserCourseCommentListVO(FsUserCourseCommentParam fsUserCourseComment);
|
|
List<FsUserCourseCommentListVO> selectFsUserCourseCommentListVO(FsUserCourseCommentParam fsUserCourseComment);
|
|
|
@Select("select c.*,u.nick_name,u.phone from fs_user_course_comment c LEFT JOIN fs_user u ON c.user_id=u.user_id where comment_id=#{commentId}")
|
|
@Select("select c.*,u.nick_name,u.phone from fs_user_course_comment c LEFT JOIN fs_user u ON c.user_id=u.user_id where comment_id=#{commentId}")
|
|
@@ -92,16 +95,22 @@ public interface FsUserCourseCommentMapper
|
|
|
"LEFT JOIN fs_user u ON c.user_id=u.user_id " +
|
|
"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 " +
|
|
"LEFT JOIN fs_user tu ON tu.user_id =c.to_user_id " +
|
|
|
"LEFT JOIN fs_user_course_comment_like l ON c.comment_id=l.comment_id and #{userId}=l.user_id "+
|
|
"LEFT JOIN fs_user_course_comment_like l ON c.comment_id=l.comment_id and #{userId}=l.user_id "+
|
|
|
- "where c.is_del = 0 and c.type = 1 \n" +
|
|
|
|
|
|
|
+ "where c.is_del = 0 and c.type = 1 \n" +
|
|
|
"<if test=\"courseId != null \"> and c.course_id = #{courseId}</if>\n" +
|
|
"<if test=\"courseId != null \"> and c.course_id = #{courseId}</if>\n" +
|
|
|
"<if test=\"videoId != null \"> and c.video_id = #{videoId}</if>\n" +
|
|
"<if test=\"videoId != null \"> and c.video_id = #{videoId}</if>\n" +
|
|
|
|
|
+ "<if test=\"userId != null\"> and (c.visible_all = 1 or c.user_id = #{userId})</if>\n" +
|
|
|
|
|
+ "<if test=\"userId == null\"> and c.visible_all = 1</if>\n" +
|
|
|
"<if test=\"sortType != null and sortType == 1\"> order by c.likes desc </if>" +
|
|
"<if test=\"sortType != null and sortType == 1\"> order by c.likes desc </if>" +
|
|
|
"<if test=\"sortType != null and sortType == 2\"> order by c.comment_id desc </if>" +
|
|
"<if test=\"sortType != null and sortType == 2\"> order by c.comment_id desc </if>" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
List<FsUserCourseCommentListUVO> selectFsUserCourseCommentListUVO(FsUserCourseCommentUParam param);
|
|
List<FsUserCourseCommentListUVO> selectFsUserCourseCommentListUVO(FsUserCourseCommentUParam param);
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
- "select c.*,u.nick_name as nickNameOriginal,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.user_id=#{userId} " +
|
|
|
|
|
|
|
+ "select c.*,u.nick_name as nickNameOriginal,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 or c.is_del is null) " +
|
|
|
|
|
+ "and (c.type is null or c.type != 3) " +
|
|
|
|
|
+ "and (c.user_id = #{userId} or c.visible_all = 1) " +
|
|
|
"<if test='courseId != null'> and c.course_id = #{courseId}</if>" +
|
|
"<if test='courseId != null'> and c.course_id = #{courseId}</if>" +
|
|
|
"<if test='videoId != null'> and c.video_id = #{videoId}</if>" +
|
|
"<if test='videoId != null'> and c.video_id = #{videoId}</if>" +
|
|
|
" order by c.create_time desc" +
|
|
" order by c.create_time desc" +
|