提交 aa02bcd0 authored 作者: 吴德鹏's avatar 吴德鹏

修改post ——> post_data

上级 671d73d5
...@@ -44,12 +44,12 @@ ...@@ -44,12 +44,12 @@
`item_ids`, `item_ids`,
`tag_ids`, `tag_ids`,
`title` `title`
from post from post_data
where id = #{id} where id = #{id}
</select> </select>
<update id="placedTop" parameterType="com.platform.entity.PostEntity"> <update id="placedTop" parameterType="com.platform.entity.PostEntity">
update post set is_top=#{isTop} where id=#{id} update post_data set is_top=#{isTop} where id=#{id}
</update> </update>
<select id="queryList" resultType="com.platform.vo.PostVo"> <select id="queryList" resultType="com.platform.vo.PostVo">
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
IFNULL(l.likes,0) likes, IFNULL(l.likes,0) likes,
u.nick createdBy u.nick createdBy
FROM FROM
post p post_data p
LEFT JOIN tb_cf_user_info u ON u.user_id=p.user_id LEFT JOIN tb_cf_user_info u ON u.user_id=p.user_id
LEFT JOIN ( SELECT count( 1 ) count, post_id FROM `comment` GROUP BY post_id ) c ON p.id = c.post_id LEFT JOIN ( SELECT count( 1 ) count, post_id FROM `comment` GROUP BY post_id ) c ON p.id = c.post_id
LEFT JOIN ( SELECT count( 1 ) likes, post_id FROM post_like GROUP BY post_id ) l ON p.id = l.post_id LEFT JOIN ( SELECT count( 1 ) likes, post_id FROM post_like GROUP BY post_id ) l ON p.id = l.post_id
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</select> </select>
<select id="queryTotal" resultType="int"> <select id="queryTotal" resultType="int">
select count(*) from post select count(*) from post_data
WHERE 1=1 WHERE 1=1
<if test="title != null and title.trim() != ''"> <if test="title != null and title.trim() != ''">
AND caption LIKE concat('%',#{title},'%') AND caption LIKE concat('%',#{title},'%')
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</select> </select>
<insert id="save" parameterType="com.platform.entity.PostEntity"> <insert id="save" parameterType="com.platform.entity.PostEntity">
insert into post( insert into post_data(
`id`, `id`,
`archived`, `archived`,
`archived_by`, `archived_by`,
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
</insert> </insert>
<update id="update" parameterType="com.platform.entity.PostEntity"> <update id="update" parameterType="com.platform.entity.PostEntity">
update post update post_data
<set> <set>
<if test="archived != null">`archived` = #{archived},</if> <if test="archived != null">`archived` = #{archived},</if>
<if test="archivedBy != null">`archived_by` = #{archivedBy},</if> <if test="archivedBy != null">`archived_by` = #{archivedBy},</if>
...@@ -170,18 +170,18 @@ ...@@ -170,18 +170,18 @@
</update> </update>
<delete id="delete"> <delete id="delete">
delete from post where id = #{value} delete from post_data where id = #{value}
</delete> </delete>
<delete id="deleteBatch"> <delete id="deleteBatch">
delete from post where id in delete from post_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<update id="changePostStatus"> <update id="changePostStatus">
update post set archived=#{archived} where id in update post_data set archived=#{archived} where id in
<foreach item="id" collection="ids" open="(" separator="," close=")"> <foreach item="id" collection="ids" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
...@@ -189,6 +189,6 @@ ...@@ -189,6 +189,6 @@
<!--统计置顶帖子数量--> <!--统计置顶帖子数量-->
<select id="getPostTopNum" resultType="int"> <select id="getPostTopNum" resultType="int">
select count(1) from post where is_top=1 and archived=1 select count(1) from post_data where is_top=1 and archived=1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论