订单评价和回复接口定义以及mapper实现
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?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="cn.iocoder.mall.order.biz.dao.OrderCommentMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id,order_id,order_no,product_spu_id,product_spu_name,product_sku_id,product_sku_attrs,product_sku_price,product_sku_pic_url,
|
||||
user_id,user_avatar,user_nick_name,star,product_description_star,logistics_star,merchant_star,replay_count,like_count,comment_content,
|
||||
comment_pics,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<!--插入-->
|
||||
<insert id="insert" parameterType="OrderCommentCreateDTO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO order_comment(order_id,order_no,product_spu_id,product_spu_name,product_sku_id,
|
||||
product_sku_attrs,product_sku_price,product_sku_pic_url,user_id,user_avatar,user_nick_name,star,
|
||||
product_description_star,logistics_star,merchant_star,comment_content,comment_pics,create_time,update_time)
|
||||
VALUES (#{orderId},#{orderNo},#{productSpuId},#{productSpuName},#{productSkuId},#{productSkuAttrs},
|
||||
#{productSkuPrice},#{productSkuPicUrl},#{userId},#{userAvatar},#{userNickName},#{star},
|
||||
#{productDescriptionStar},#{logisticsStar},#{merchantStar},#{commentContent},#{commentPics},#{createTime}, #{updateTime});
|
||||
</insert>
|
||||
|
||||
<!--根据 sku id 获取评论总数-->
|
||||
<select id="selectCommentTotalCountByProductSkuId" parameterType="Integer" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT (*)
|
||||
FROM order_comment
|
||||
WHERE
|
||||
product_sku_id = #{productSkuId}
|
||||
</select>
|
||||
|
||||
<!--分页获取评论分页-->
|
||||
<select id="selectCommentPage" parameterType="OrderCommentQueryDTO" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment
|
||||
WHERE
|
||||
product_sku_id = #{productSkuId}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT ${pageNo * pageSize}, ${pageSize}
|
||||
</select>
|
||||
|
||||
<!--根据评论 id 获取用户详情-->
|
||||
<select id="selectCommentInfoByCommentId" parameterType="Integer" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment
|
||||
WHERE
|
||||
id = #{id}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT ${pageNo * pageSize}, ${pageSize}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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="cn.iocoder.mall.order.biz.dao.OrderCommentReplayMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id,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,reply_like_count,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<!--插入-->
|
||||
<insert id="insert" parameterType="OrderCommentReplyCreateDTO" 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
|
||||
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})
|
||||
</insert>
|
||||
|
||||
<!--根据评论 id 和用户类型获取商家回复列表-->
|
||||
<select id="selectCommentMerchantReplyByCommentId" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
comment_id = #{commentId}
|
||||
AND
|
||||
user_type = #{userType}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!--根据评论 id 和用户类型获取评论总数-->
|
||||
<select id="selectCommentReplyTotalCountByCommentId" parameterType="Integer" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT (*)
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
comment_id = #{commentId}
|
||||
AND
|
||||
user_type = #{userType}
|
||||
</select>
|
||||
|
||||
<!--分页用户回复-->
|
||||
<select id="selectCommentReplyPage" parameterType="OrderCommentReplyPageDTO" resultType="cn.iocoder.mall.order.biz.dataobject.OrderCommentReplyDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM order_comment_replay
|
||||
WHERE
|
||||
comment_id = #{commentId}
|
||||
AND
|
||||
user_type = #{userType}
|
||||
ORDER BY create_time DESC
|
||||
LIMIT ${pageNo * pageSize}, ${pageSize}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -3,8 +3,7 @@
|
||||
<mapper namespace="cn.iocoder.mall.order.biz.dao.OrderLogisticsDetailMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id
|
||||
,
|
||||
id,
|
||||
order_logistics_id,
|
||||
logistics_time,
|
||||
logistics_information,
|
||||
|
||||
Reference in New Issue
Block a user