fix(TorrentComment):修复了获取评论列表中没有正确得到userId和时间的bug
Change-Id: I563e173e5b9367c9d76bb49c6c924dcfc62ca3d8
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTorrentCommentMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTorrentCommentMapper.xml
index 139e0e1..00cc579 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTorrentCommentMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTorrentCommentMapper.xml
@@ -1,11 +1,20 @@
<?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" resultType="com.ruoyi.system.domain.SysTorrentComment">
+ <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}