Skip to content

Commit

Permalink
优化评论
Browse files Browse the repository at this point in the history
  • Loading branch information
TreasureJade committed Dec 12, 2019
1 parent 59838d0 commit 54893f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/main/resources/mappers/CommentMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@
where blog_id = #{blogId} and pid =0
</select>
<select id="selectCommentById" resultType="com.swpu.uchain.blog.vo.CommentVO">
SELECT u.user_id,u.username,u.head_portrait ,c.comment_id,c.comment_msg,c.creat_time
FROM
user u,
comment c
WHERE u.user_id = c.user_id
and c.comment_id = #{id}
SELECT u.user_id,u.username,u.head_portrait ,c.comment_id,c.comment_msg,c.creat_time
FROM comment c
LEFT JOIN user u on c.user_id = u.user_id
where c.comment_id = #{id}
</select>
<select id="selectByPid" resultType="com.swpu.uchain.blog.vo.ReplyVO">
SELECT u.user_id,u.username,u.head_portrait ,c.comment_id,c.comment_msg,c.creat_time,c.reply_user_id
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mappers/UserMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
select user_id, phone_number, `password`, `role`, username, true_name, email, birthday,
head_portrait
from user
where userId = #{commentId,jdbcType=BIGINT}
where user_id = #{id,jdbcType=BIGINT}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select user_id, phone_number, `password`, `role`, username, true_name, email, birthday,
Expand Down

0 comments on commit 54893f6

Please sign in to comment.