积分置顶文章 查询增加过期时间条件+去除冗余代码

积分置顶文章 查询增加过期时间条件+去除冗余代码
This commit is contained in:
amypeng 2026-06-15 16:43:24 +08:00
parent 66c8132fe3
commit ab53fa6ee0
2 changed files with 2 additions and 16 deletions

View File

@ -66,15 +66,6 @@ public interface ZonePointsDocMapper {
*/
int hasPointsTopByZoneIdAndUserId(@Param("zoneId") Long zoneId, @Param("userId") Long userId);
/**
* 更新文章的积分置顶状态
*
* @param id 主键ID
* @param isPointsTop 是否置顶
* @return 影响行数
*/
int updatePointsTopStatus(@Param("id") Long id, @Param("isPointsTop") Boolean isPointsTop);
/**
* 查询用户在指定专区下的置顶文章
*

View File

@ -83,21 +83,16 @@
where zone_id = #{zoneId}
and user_id = #{userId}
and is_points_top = 1
and expiry_time >= NOW()
</select>
<!-- 更新文章的积分置顶状态 -->
<update id="updatePointsTopStatus">
update zone_points_doc
set is_points_top = #{isPointsTop}
where id = #{id}
</update>
<!-- 查询用户在指定专区下的置顶文章 -->
<select id="selectPointsTopByZoneIdAndUserId" resultMap="ZonePointsDocResult">
<include refid="selectZonePointsDocVo"/>
where zone_id = #{zoneId}
and user_id = #{userId}
and is_points_top = 1
and expiry_time &gt;= NOW()
limit 1
</select>