同步闭源版本部分代码,修复页面顺序问题

This commit is contained in:
暮光:城中城
2022-12-07 20:24:17 +08:00
parent f7cfce0bd8
commit d0e69ef184
3 changed files with 19 additions and 10 deletions

View File

@@ -18,11 +18,8 @@
and a.space_id in
<foreach collection="spaceIds" open="(" close=")" item="item" separator=",">#{item}</foreach>
</if>
<if test="newsType == 1">order by a.update_time desc</if>
<if test="newsType == 2">order by a.create_time desc</if>
<if test="newsType == 3">order by a.view_num desc</if>
<if test="newsType == 4">order by a.zan_num desc</if>
<if test="newsType == 5">order by a.view_num+a.zan_num desc</if>
order by a.update_time desc
limit 15
</select>
</mapper>

View File

@@ -1,5 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zyplayer.doc.data.repository.manage.mapper.WikiPageMapper">
<update id="updateChildrenSeq">
update wiki_page a
join (
SELECT id, @rownum := @rownum + 1 AS rownum
FROM (SELECT @rownum := 0) t, wiki_page
where parent_id = #{parentId} and space_id = #{spaceId}
ORDER BY seq_no ASC, update_time DESC
) b on a.id = b.id
set seq_no = b.rownum
where a.parent_id = #{parentId} and a.space_id = #{spaceId};
</update>
</mapper>