添加注释

This commit is contained in:
KilLze
2025-12-19 01:41:04 +08:00
parent 0f3c9e78a6
commit c6f3cb72dd
6 changed files with 85 additions and 12 deletions

View File

@@ -3,7 +3,8 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bao.dating.mapper.PostMapper">
<!-- 动态添加 -->
<!--动态添加-->
<insert id="insert" useGeneratedKeys="true" keyProperty="postId">
INSERT INTO post
(user_id, content,
@@ -26,10 +27,18 @@
</if>
#{isPublic}, 0, 0, #{createdAt}, #{updatedAt})
</insert>
<!--动态删除-->
<delete id="deletePostById" parameterType="int">
DELETE FROM post WHERE post_id = #{postId}
</delete>
<!--增加点赞数量-->
<update id="increaseLikeCount">
update dating.post set like_count = like_count + 1 where post.post_id = #{postId}
</update>
<!--减少点赞数量-->
<update id="decreaseLikeCount">
update dating.post set like_count= like_count - 1 where post.post_id = #{postId}
</update>
@@ -39,8 +48,4 @@
select dating.post.like_count from dating.post where post.post_id = #{postId}
</select>
<delete id="deletePostById" parameterType="int">
DELETE FROM post WHERE post_id = #{postId}
</delete>
</mapper>