86133 | ec55c54 | 2025-04-21 11:51:32 +0800 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | <mapper namespace="com.ruoyi.torrent.mapper.BtTorrentAnnounceMapper"> |
| 6 | |
| 7 | <resultMap type="BtTorrentAnnounce" id="BtTorrentAnnounceResult"> |
| 8 | <result property="id" column="id" /> |
| 9 | <result property="torrentId" column="torrent_id" /> |
| 10 | <result property="announceUrl" column="announce_url" /> |
| 11 | </resultMap> |
| 12 | |
| 13 | <sql id="selectBtTorrentAnnounceVo"> |
| 14 | select id, torrent_id, announce_url from bt_torrent_announce |
| 15 | </sql> |
| 16 | |
| 17 | <select id="selectBtTorrentAnnounceList" parameterType="BtTorrentAnnounce" resultMap="BtTorrentAnnounceResult"> |
| 18 | <include refid="selectBtTorrentAnnounceVo"/> |
| 19 | <where> |
| 20 | <if test="torrentId != null "> and torrent_id = #{torrentId}</if> |
| 21 | <if test="announceUrl != null and announceUrl != ''"> and announce_url = #{announceUrl}</if> |
| 22 | </where> |
| 23 | </select> |
| 24 | |
| 25 | <select id="selectBtTorrentAnnounceById" parameterType="Long" resultMap="BtTorrentAnnounceResult"> |
| 26 | <include refid="selectBtTorrentAnnounceVo"/> |
| 27 | where id = #{id} |
| 28 | </select> |
| 29 | |
| 30 | <insert id="insertBtTorrentAnnounce" parameterType="BtTorrentAnnounce" useGeneratedKeys="true" keyProperty="id"> |
| 31 | insert into bt_torrent_announce |
| 32 | <trim prefix="(" suffix=")" suffixOverrides=","> |
| 33 | <if test="torrentId != null">torrent_id,</if> |
| 34 | <if test="announceUrl != null and announceUrl != ''">announce_url,</if> |
| 35 | </trim> |
| 36 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| 37 | <if test="torrentId != null">#{torrentId},</if> |
| 38 | <if test="announceUrl != null and announceUrl != ''">#{announceUrl},</if> |
| 39 | </trim> |
| 40 | </insert> |
| 41 | |
| 42 | <update id="updateBtTorrentAnnounce" parameterType="BtTorrentAnnounce"> |
| 43 | update bt_torrent_announce |
| 44 | <trim prefix="SET" suffixOverrides=","> |
| 45 | <if test="torrentId != null">torrent_id = #{torrentId},</if> |
| 46 | <if test="announceUrl != null and announceUrl != ''">announce_url = #{announceUrl},</if> |
| 47 | </trim> |
| 48 | where id = #{id} |
| 49 | </update> |
| 50 | |
| 51 | <delete id="deleteBtTorrentAnnounceById" parameterType="Long"> |
| 52 | delete from bt_torrent_announce where id = #{id} |
| 53 | </delete> |
| 54 | |
| 55 | <delete id="deleteBtTorrentAnnounceByIds" parameterType="String"> |
| 56 | delete from bt_torrent_announce where id in |
| 57 | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| 58 | #{id} |
| 59 | </foreach> |
| 60 | </delete> |
| 61 | </mapper> |