冷门种子推荐,冷门种子下载不计入下载量,冷门种子自动化判断
Change-Id: Iba4d232d8408195c5af01d2f1686d171e3d5eeac
diff --git a/src/main/resources/mapper/TorrentMapper.xml b/src/main/resources/mapper/TorrentMapper.xml
index 243fd92..cec75eb 100644
--- a/src/main/resources/mapper/TorrentMapper.xml
+++ b/src/main/resources/mapper/TorrentMapper.xml
@@ -31,4 +31,26 @@
FROM torrents
WHERE torrent_id = #{torrentId}
</select>
+
+ <select id="selectByInfoHashList" resultType="com.example.g8backend.entity.Torrent" parameterType="list">
+ SELECT
+ torrent_id,
+ user_id,
+ torrent_name,
+ file_path,
+ HEX(info_hash) AS infoHash,
+ file_size
+ FROM torrents
+ WHERE info_hash IN
+ <foreach collection="infoHashes" item="hash" open="(" separator="," close=")">
+ UNHEX(#{hash})
+ </foreach>
+ </select>
+
+ <update id="updateIsRareByInfoHash">
+ UPDATE torrent
+ SET israre = #{israre}
+ WHERE info_hash = #{infoHash}
+ </update>
+
</mapper>
\ No newline at end of file