| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| <mapper namespace="com.ruoyi.system.mapper.SysTorrentCommentMapper"> |
| <resultMap id="SysTorrentCommentMap" type="com.ruoyi.system.domain.SysTorrentComment"> |
| <id property="commentId" column="comment_id"/> |
| <result property="torrentId" column="torrent_id"/> |
| <result property="userId" column="user_id"/> |
| <result property="content" column="content"/> |
| <result property="parentId" column="parent_id"/> |
| <result property="createTime" column="create_time"/> |
| </resultMap> |
| |
| <insert id="insertComment" parameterType="com.ruoyi.system.domain.SysTorrentComment"> |
| insert into sys_torrent_comment (torrent_id, user_id, content, parent_id, create_time) |
| values (#{torrentId}, #{userId}, #{content}, #{parentId}, sysdate()) |
| </insert> |
| <select id="selectCommentListByTorrentId" resultMap="SysTorrentCommentMap"> |
| select comment_id, torrent_id, user_id, content, parent_id, create_time |
| from sys_torrent_comment |
| where torrent_id = #{torrentId} |
| order by create_time desc |
| </select> |
| <delete id="deleteCommentById"> |
| delete from sys_torrent_comment where comment_id = #{commentId} |
| </delete> |
| </mapper> |