|
@@ -5,10 +5,43 @@
|
|
|
<resultMap id="BaseResultMap" type="com.yami.shop.bean.model.OrderRefund">
|
|
<resultMap id="BaseResultMap" type="com.yami.shop.bean.model.OrderRefund">
|
|
|
<id column="refund_id" property="refundId"/>
|
|
<id column="refund_id" property="refundId"/>
|
|
|
<result column="refund_sn" property="refundSn"/>
|
|
<result column="refund_sn" property="refundSn"/>
|
|
|
|
|
+ <result column="order_number" property="orderNumber"/>
|
|
|
<result column="shop_id" property="shopId"/>
|
|
<result column="shop_id" property="shopId"/>
|
|
|
<result column="user_id" property="userId"/>
|
|
<result column="user_id" property="userId"/>
|
|
|
<result column="order_id" property="orderId"/>
|
|
<result column="order_id" property="orderId"/>
|
|
|
- <result column="refund_type" property="orderId"/>
|
|
|
|
|
|
|
+ <result column="refund_type" property="refundType"/>
|
|
|
|
|
+ <result column="order_item_id" property="orderItemId"/>
|
|
|
|
|
+ <result column="goods_num" property="goodsNum"/>
|
|
|
|
|
+ <result column="refund_amount" property="refundAmount"/>
|
|
|
|
|
+ <result column="apply_type" property="applyType"/>
|
|
|
|
|
+ <result column="is_receiver" property="isReceiver"/>
|
|
|
|
|
+ <result column="buyer_reason" property="buyerReason"/>
|
|
|
|
|
+ <result column="buyer_desc" property="buyerDesc"/>
|
|
|
|
|
+ <result column="buyer_mobile" property="buyerMobile"/>
|
|
|
|
|
+ <result column="photo_files" property="photoFiles"/>
|
|
|
|
|
+ <result column="return_money_sts" property="returnMoneySts"/>
|
|
|
|
|
+ <result column="reject_message" property="rejectMessage"/>
|
|
|
|
|
+ <result column="seller_msg" property="sellerMsg"/>
|
|
|
|
|
+ <result column="apply_time" property="applyTime"/>
|
|
|
|
|
+ <result column="handel_time" property="handelTime"/>
|
|
|
|
|
+ <result column="ship_time" property="shipTime"/>
|
|
|
|
|
+ <result column="receive_time" property="receiveTime"/>
|
|
|
|
|
+ <result column="cancel_time" property="cancelTime"/>
|
|
|
|
|
+ <result column="refund_time" property="refundTime"/>
|
|
|
|
|
+ <result column="decision_time" property="decisionTime"/>
|
|
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
|
|
+ <result column="reject_time" property="rejectTime"/>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap id="OrderRefundVoMap" type="com.yami.shop.bean.vo.OrderRefundVo">
|
|
|
|
|
+ <id column="refund_id" property="refundId"/>
|
|
|
|
|
+ <result column="refund_sn" property="refundSn"/>
|
|
|
|
|
+ <result column="order_number" property="orderNumber"/>
|
|
|
|
|
+ <result column="shop_id" property="shopId"/>
|
|
|
|
|
+ <result column="user_id" property="userId"/>
|
|
|
|
|
+ <result column="order_id" property="orderId"/>
|
|
|
|
|
+ <result column="refund_type" property="refundType"/>
|
|
|
<result column="order_item_id" property="orderItemId"/>
|
|
<result column="order_item_id" property="orderItemId"/>
|
|
|
<result column="goods_num" property="goodsNum"/>
|
|
<result column="goods_num" property="goodsNum"/>
|
|
|
<result column="refund_amount" property="refundAmount"/>
|
|
<result column="refund_amount" property="refundAmount"/>
|
|
@@ -414,54 +447,71 @@
|
|
|
COUNT(CASE WHEN return_money_sts = 70 THEN 1 END) AS refundCompleteCount
|
|
COUNT(CASE WHEN return_money_sts = 70 THEN 1 END) AS refundCompleteCount
|
|
|
FROM tz_order_refund
|
|
FROM tz_order_refund
|
|
|
<where>
|
|
<where>
|
|
|
- <if test="orderNumber != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.orderNumber != null">
|
|
|
and order_number = #{orderRefund.orderNumber}
|
|
and order_number = #{orderRefund.orderNumber}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="refundSn != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.refundSn != null">
|
|
|
and refund_sn = #{orderRefund.refundSn}
|
|
and refund_sn = #{orderRefund.refundSn}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="buyerMobile != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.buyerMobile != null">
|
|
|
and buyer_mobile = #{orderRefund.buyerMobile}
|
|
and buyer_mobile = #{orderRefund.buyerMobile}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="applyType != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.applyType != null">
|
|
|
and apply_type = #{orderRefund.applyType}
|
|
and apply_type = #{orderRefund.applyType}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="returnMoneySts != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.returnMoneySts != null and orderRefund.returnMoneySts != 0">
|
|
|
and return_money_sts = #{orderRefund.returnMoneySts}
|
|
and return_money_sts = #{orderRefund.returnMoneySts}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orderParam.startTime != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.startTime != null">
|
|
|
AND create_time >= #{orderRefund.startTime}
|
|
AND create_time >= #{orderRefund.startTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orderParam.endTime != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.endTime != null">
|
|
|
AND create_time <= #{orderRefund.endTime}
|
|
AND create_time <= #{orderRefund.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="orderRefundPage" resultMap="BaseResultMap">
|
|
|
|
|
- select refund.* from tz_order_refund refund
|
|
|
|
|
|
|
+ <select id="orderRefundPage" resultMap="OrderRefundVoMap">
|
|
|
|
|
+ select refund.*, o.actual_total as actualTotal, o.product_nums as productNums, o.hb_order_status as hbOrderStatus,
|
|
|
|
|
+ tsd.shop_name as shopName
|
|
|
|
|
+ from tz_order_refund refund
|
|
|
|
|
+ join tz_shop_detail tsd on refund.shop_id = tsd.shop_id
|
|
|
|
|
+ join tz_order o on refund.order_id = o.order_id
|
|
|
<where>
|
|
<where>
|
|
|
- <if test="orderNumber != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.orderNumber != null">
|
|
|
and refund.order_number = #{orderRefund.orderNumber}
|
|
and refund.order_number = #{orderRefund.orderNumber}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="refundSn != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.refundSn != null">
|
|
|
and refund.refund_sn = #{orderRefund.refundSn}
|
|
and refund.refund_sn = #{orderRefund.refundSn}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="buyerMobile != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.buyerMobile != null">
|
|
|
and refund.buyer_mobile = #{orderRefund.buyerMobile}
|
|
and refund.buyer_mobile = #{orderRefund.buyerMobile}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="applyType != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.applyType != null">
|
|
|
and refund.apply_type = #{orderRefund.applyType}
|
|
and refund.apply_type = #{orderRefund.applyType}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="returnMoneySts != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.returnMoneySts != null and orderRefund.returnMoneySts != 0">
|
|
|
and refund.return_money_sts = #{orderRefund.returnMoneySts}
|
|
and refund.return_money_sts = #{orderRefund.returnMoneySts}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orderParam.startTime != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.startTime != null">
|
|
|
AND refund.create_time >= #{orderRefund.startTime}
|
|
AND refund.create_time >= #{orderRefund.startTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="orderParam.endTime != null">
|
|
|
|
|
|
|
+ <if test="orderRefund.endTime != null">
|
|
|
AND refund.create_time <= #{orderRefund.endTime}
|
|
AND refund.create_time <= #{orderRefund.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectInfoById" resultMap="OrderRefundVoMap">
|
|
|
|
|
+ select refund.*,
|
|
|
|
|
+ o.actual_total as actualTotal,
|
|
|
|
|
+ o.product_nums as productNums,
|
|
|
|
|
+ o.hb_order_status as hbOrderStatus,
|
|
|
|
|
+ tsd.shop_name as shopName
|
|
|
|
|
+ from tz_order_refund refund
|
|
|
|
|
+ join tz_shop_detail tsd on refund.shop_id = tsd.shop_id
|
|
|
|
|
+ join tz_order o on refund.order_id = o.order_id
|
|
|
|
|
+ where refund.refund_id = #{refundId}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|