|
|
@@ -18,10 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="toUserId" column="to_user_id" />
|
|
|
<result property="isDel" column="is_del" />
|
|
|
<result property="nickName" column="nick_name" />
|
|
|
+ <result property="videoId" column="video_id" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsUserCourseCommentVo">
|
|
|
- select comment_id,to_user_id, user_id,is_del, course_id, type, parent_id, content, reply_count, create_time, update_time, likes, nick_name from fs_user_course_comment
|
|
|
+ select comment_id,to_user_id, user_id,is_del, course_id, type, parent_id, content, reply_count, create_time, update_time, likes, nick_name, video_id from fs_user_course_comment
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsUserCourseCommentList" parameterType="FsUserCourseComment" resultMap="FsUserCourseCommentResult">
|
|
|
@@ -34,7 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
|
|
<if test="replyCount != null "> and reply_count = #{replyCount}</if>
|
|
|
<if test="likes != null "> and likes = #{likes}</if>
|
|
|
- <if test="isDel != null "> and is_del = #{isDel}</if>
|
|
|
+ <if test="isDel != null"> and is_del = #{isDel}</if>
|
|
|
+ <if test="videoId != null"> and video_id = #{videoId}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
@@ -58,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="toUserId != null">to_user_id,</if>
|
|
|
<if test="isDel != null">is_del,</if>
|
|
|
<if test="nickName != null">nick_name,</if>
|
|
|
+ <if test="videoId != null">video_id,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
@@ -72,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="toUserId != null">#{toUserId},</if>
|
|
|
<if test="isDel != null">#{isDel},</if>
|
|
|
<if test="nickName != null">#{nickName},</if>
|
|
|
+ <if test="videoId != null">#{videoId},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -90,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="toUserId != null">to_user_id = #{toUserId},</if>
|
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
|
|
<if test="nickName != null">nick_name = #{nickName},</if>
|
|
|
+ <if test="videoId != null">video_id = #{videoId},</if>
|
|
|
</trim>
|
|
|
where comment_id = #{commentId}
|
|
|
</update>
|
|
|
@@ -118,4 +123,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
ORDER BY user_id, create_time ASC
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectCommentsByVideoIdAndUserIds" resultMap="FsUserCourseCommentResult">
|
|
|
+ <include refid="selectFsUserCourseCommentVo"/>
|
|
|
+ WHERE video_id = #{videoId} AND type = 1 AND is_del = 0
|
|
|
+ AND user_id IN
|
|
|
+ <foreach item="userId" collection="userIds" open="(" separator="," close=")">
|
|
|
+ #{userId}
|
|
|
+ </foreach>
|
|
|
+ ORDER BY user_id, create_time ASC
|
|
|
+ </select>
|
|
|
</mapper>
|