查看冷门资源
Change-Id: Idb875bd6ff4c6dba3cc40cf6ef298731b526c1a7
diff --git a/src/main/resources/mapper/TorrentMapper.xml b/src/main/resources/mapper/TorrentMapper.xml
index 8e5419b..9c165ce 100644
--- a/src/main/resources/mapper/TorrentMapper.xml
+++ b/src/main/resources/mapper/TorrentMapper.xml
@@ -105,5 +105,17 @@
JOIN favorite f ON t.id = f.seed_id
WHERE f.user_id = #{userId}
</select>
+ <update id="incrementViews" parameterType="long">
+ UPDATE torrent
+ SET views = views + 1
+ WHERE id = #{id}
+ </update>
+ <select id="selectColdTorrents" resultType="com.example.myproject.entity.TorrentEntity">
+ SELECT * FROM torrent
+ WHERE views < #{threshold}
+ ORDER BY views ASC
+ </select>
+
+
</mapper>
\ No newline at end of file