分页 将mybatis-plus依赖移到子模块

This commit is contained in:
苏元皓
2024-08-13 14:02:11 +08:00
parent e2a408488f
commit b755ecfeef
14 changed files with 815 additions and 68 deletions

View File

@@ -10,18 +10,20 @@
<result property="communityId" column="community_id" jdbcType="BIGINT"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="content" column="content" jdbcType="VARCHAR"/>
<result property="videoUrl" column="video_url" jdbcType="VARCHAR"/> <!-- 新增字段 -->
<result property="imageUrls" column="image_urls" jdbcType="VARCHAR"/> <!-- 新增字段 -->
<result property="videoUrl" column="video_url" jdbcType="VARCHAR"/>
<result property="imageUrls" column="image_urls" jdbcType="VARCHAR"/>
<result property="isDeleted" column="is_deleted" jdbcType="TINYINT"/>
<result property="isOfficial" column="is_official" jdbcType="TINYINT"/> <!-- 新增字段 -->
<result property="isOfficial" column="is_official" jdbcType="TINYINT"/>
<result property="isPublic" column="is_public" jdbcType="TINYINT"/>
<result property="location" column="location" jdbcType="VARCHAR"/>
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
post_id, user_openid, community_id, title, content,
video_url, image_urls, <!-- 新增字段 -->
is_deleted, is_official, created_at, updated_at
video_url, image_urls,
is_deleted, is_official, is_public, location, created_at, updated_at
</sql>
<!-- 查询指定帖子的所有评论 -->
@@ -36,12 +38,12 @@
<insert id="insertPost" parameterType="com.ivmiku.tutorial.entity.Post">
INSERT INTO post (
post_id, user_openid, community_id, title, content,
video_url, image_urls, <!-- 新增字段 -->
is_deleted, is_official, created_at, updated_at
video_url, image_urls,
is_deleted, is_official, is_public, location, created_at, updated_at
) VALUES (
#{postId}, #{userOpenid}, #{communityId}, #{title}, #{content},
#{videoUrl}, #{imageUrls}, <!-- 新增字段 -->
#{isDeleted}, #{isOfficial}, #{createdAt}, #{updatedAt}
#{videoUrl}, #{imageUrls},
#{isDeleted}, #{isOfficial}, #{is_public}, #{location}, #{createdAt}, #{updatedAt}
)
</insert>
@@ -53,10 +55,12 @@
community_id = #{communityId},
title = #{title},
content = #{content},
video_url = #{videoUrl}, <!-- 新增字段 -->
image_urls = #{imageUrls}, <!-- 新增字段 -->
video_url = #{videoUrl},
image_urls = #{imageUrls},
is_deleted = #{isDeleted},
is_official = #{isOfficial},
is_public = #{is_public},
location = #{location},
created_at = #{createdAt},
updated_at = #{updatedAt}
WHERE post_id = #{postId}
@@ -72,9 +76,9 @@
<select id="getTagPostList" resultType="com.ivmiku.tutorial.entity.Post">
SELECT p.post_id, p.user_openid, p.community_id, p.title, p.content,
p.is_deleted, p.is_official, p.created_at, p.updated_at
p.is_deleted, p.is_official, p.is_public, p.location, p.created_at, p.updated_at
FROM post p, posttag pt, tag t
WHERE p.post_id = pt.post_id AND pt.tag_id = t.tag_id AND t.tag_id = #{tagId} AND p.is_deleted = 0
WHERE p.post_id = pt.post_id AND pt.tag_id = t.tag_id AND t.tag_id = #{tagId} AND p.is_deleted = 0 AND p.is_public = 1
</select>
</mapper>