blob: 00cc57982a5e3064303194bf53c6d801abafa661 [file] [log] [blame]
visionegg7a4c2c02025-05-19 14:36:12 +08001<?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">
visionegg7b06c6f2025-05-28 13:31:24 +08004 <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
visionegg7a4c2c02025-05-19 14:36:12 +080013 <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>
visionegg7b06c6f2025-05-28 13:31:24 +080017 <select id="selectCommentListByTorrentId" resultMap="SysTorrentCommentMap">
visionegg7a4c2c02025-05-19 14:36:12 +080018 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>