visionegg | 7a4c2c0 | 2025-05-19 14:36:12 +0800 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 3 | <mapper namespace="com.ruoyi.system.mapper.SysTorrentCommentMapper"> |
BirdNETM | 632c061 | 2025-05-27 17:41:40 +0800 | [diff] [blame] | 4 | <resultMap id="SysTorrentCommentMap" type="com.ruoyi.system.domain.SysTorrentComment"> |
| 5 | <id property="commentId" column="comment_id"/> |
| 6 | <result property="torrentId" column="torrent_id"/> |
| 7 | <result property="userId" column="user_id"/> |
| 8 | <result property="content" column="content"/> |
| 9 | <result property="parentId" column="parent_id"/> |
| 10 | <result property="createTime" column="create_time"/> |
| 11 | </resultMap> |
| 12 | |
visionegg | 7a4c2c0 | 2025-05-19 14:36:12 +0800 | [diff] [blame] | 13 | <insert id="insertComment" parameterType="com.ruoyi.system.domain.SysTorrentComment"> |
| 14 | insert into sys_torrent_comment (torrent_id, user_id, content, parent_id, create_time) |
| 15 | values (#{torrentId}, #{userId}, #{content}, #{parentId}, sysdate()) |
| 16 | </insert> |
BirdNETM | 632c061 | 2025-05-27 17:41:40 +0800 | [diff] [blame] | 17 | <select id="selectCommentListByTorrentId" resultMap="SysTorrentCommentMap"> |
visionegg | 7a4c2c0 | 2025-05-19 14:36:12 +0800 | [diff] [blame] | 18 | select comment_id, torrent_id, user_id, content, parent_id, create_time |
| 19 | from sys_torrent_comment |
| 20 | where torrent_id = #{torrentId} |
| 21 | order by create_time desc |
| 22 | </select> |
| 23 | <delete id="deleteCommentById"> |
| 24 | delete from sys_torrent_comment where comment_id = #{commentId} |
| 25 | </delete> |
| 26 | </mapper> |