增加评论回复接口和评论列表接口实现以及部分实体调整

This commit is contained in:
wangtongzhou
2019-06-01 17:51:53 +08:00
parent 685a373360
commit 4f50605455
16 changed files with 283 additions and 26 deletions

View File

@@ -9,7 +9,7 @@
<!--插入-->
<insert id="insert" parameterType="OrderCommentReplyDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id
INSERT INTO order_comment_replay(comment_id,reply_type,parent_id,parent_user_id,parent_user_nick_name,parent_user_avatar,reply_content,reply_user_id,
reply_user_nick_name,reply_user_avatar,user_type,create_time,update_time)
VALUES (#{commentId},#{replyType},#{parentId},#{parentUserId},#{parentUserNickName},#{parentUserAvatar},#{replyContent},#{replyUserId},
#{replyUserNickName},#{replyUserAvatar},#{userType},#{createTime},#{updateTime})
@@ -51,10 +51,29 @@
LIMIT ${pageNo * pageSize}, ${pageSize}
</select>
<!--根据评论 id 查询商家最新的评论列表-->
<select id="selectCommentNewMerchantReplyByCommentIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
SELECT
<include refid="FIELDS" />
FROM order_comment_replay
WHERE
create_time=(SELECT
a.maxtime
FROM
(SELECT
MAX(create_time) AS maxtime,comment_id
FROM order_comment_replay
WHERE
comment_id IN
<foreach collection="commentIds" item="commentId" separator="," open="(" close=")">
#{commentId}
</foreach>
GROUP BY comment_id ) AS a)
AND
comment_id IN
<foreach collection="commentIds" item="commentId" separator="," open="(" close=")">
#{commentId}
</foreach>
</select>
</mapper>