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

修改post ——> post_data

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