IMWebAccountOrderCheckingRefundMapper.xml
11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?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.sibu.orderHelper.integral.web.dao.IMWebAccountOrderCheckingRefundDao">
<resultMap type="com.sibu.orderHelper.integral.model.AccountOrderCheckingRefund" id="refundOrderItemResultMap">
<id column="refund_id" jdbcType="VARCHAR" property="refundId"/>
<result column="refund_code" jdbcType="VARCHAR" property="refundCode"/>
<result column="order_id" jdbcType="VARCHAR" property="orderId"/>
<result column="order_code" jdbcType="VARCHAR" property="orderCode"/>
<result column="order_from" jdbcType="TINYINT" property="orderFrom"/>
<result column="member_id" jdbcType="VARCHAR" property="memberId"/>
<result column="refund_type" jdbcType="INTEGER" property="refundType"/>
<result column="refund_goods_status" jdbcType="INTEGER" property="refundGoodsStatus"/>
<result column="refund_reason_id" jdbcType="INTEGER" property="refundReasonId"/>
<result column="refund_reason" jdbcType="VARCHAR" property="refundReason"/>
<result column="refund_money" jdbcType="DECIMAL" property="refundMoney"/>
<result column="order_money" jdbcType="DECIMAL" property="orderMoney"/>
<result column="refund_remark" jdbcType="VARCHAR" property="refundRemark"/>
<result column="refund_status" jdbcType="INTEGER" property="refundStatus"/>
<result column="refund_status_last_update_dt" jdbcType="TIMESTAMP" property="refundStatusLastUpdateDt"/>
<result column="apply_date" jdbcType="TIMESTAMP" property="applyDate"/>
<result column="refund_money_success_flag" jdbcType="BIT" property="refundMoneySuccessFlag"/>
<result column="refund_date" jdbcType="TIMESTAMP" property="refundDate"/>
<result column="buyer_username" jdbcType="VARCHAR" property="buyerUsername"/>
<result column="buyer_phone" jdbcType="VARCHAR" property="buyerPhone"/>
<result column="refund_seller_phone" jdbcType="VARCHAR" property="refundSellerPhone"/>
<result column="refund_seller_address" jdbcType="VARCHAR" property="refundSellerAddress"/>
<result column="refund_seller_name" jdbcType="VARCHAR" property="refundSellerName"/>
<result column="finish_date" jdbcType="TIMESTAMP" property="finishDate"/>
<result column="refund_integral" jdbcType="BIGINT" property="refundIntegral"/>
<result column="refund_goods_deliver_id" jdbcType="TINYINT" property="refundGoodsDeliverId"/>
<result column="refund_goods_deliver_name" jdbcType="VARCHAR" property="refundGoodsDeliverName"/>
<result column="refund_goods_waybill" jdbcType="VARCHAR" property="refundGoodsWaybill"/>
<result column="refund_goods_remark" jdbcType="VARCHAR" property="refundGoodsRemark"/>
<result column="refund_tips" jdbcType="VARCHAR" property="refundTips"/>
<result column="receive_goods_flag" jdbcType="BIT" property="receiveGoodsFlag"/>
<result column="receive_goods_dt" jdbcType="TIMESTAMP" property="receiveGoodsDt"/>
<result column="deduction_product_vb" jdbcType="INTEGER" property="deductionProductVb"/>
<result column="deduction_product_vb_refund_status" jdbcType="TINYINT" property="deductionProductVbRefundStatus"/>
<result column="deduction_product_vb_refund_dt" jdbcType="TIMESTAMP" property="deductionProductVbRefundDt"/>
<result column="profit_refund_status" jdbcType="TINYINT" property="profitRefundStatus"/>
<result column="profit_refund_dt" jdbcType="TIMESTAMP" property="profitRefundDt"/>
<result column="refund_freight" jdbcType="DECIMAL" property="refundFreight"/>
<result column="refund_to_account_type" jdbcType="TINYINT" property="refundToAccountType"/>
<result column="refund_alipay_account" jdbcType="VARCHAR" property="refundAlipayAccount"/>
<result column="refund_alipay_account_real_name" jdbcType="VARCHAR" property="refundAlipayAccountRealName"/>
<result column="refund_bank_account" jdbcType="VARCHAR" property="refundBankAccount"/>
<result column="refund_bank_account_real_name" jdbcType="VARCHAR" property="refundBankAccountRealName"/>
<result column="refund_bank_branch_full_name" jdbcType="VARCHAR" property="refundBankBranchFullName"/>
<result column="change_goods_waybill" jdbcType="VARCHAR" property="changeGoodsWaybill"/>
<result column="change_goods_deliver_name" jdbcType="VARCHAR" property="changeGoodsDeliverName"/>
<result column="change_goods_finish_flag" jdbcType="INTEGER" property="changeGoodsFinishFlag"/>
<collection property="accountOrderCheckingRefundDetailList" column="refund_id" ofType="com.sibu.orderHelper.integral.model.AccountOrderCheckingRefundDetail">
<result column="id" property="id"/>
<result column="rid" property="refundId"/>
<result column="oid" property="orderId"/>
<result column="order1_id" property="order1Id"/>
<result column="mid" property="memberId"/>
<result column="sort_index" property="sortIndex"/>
<result column="product_id" property="productId"/>
<result column="quantity" property="quantity"/>
<result column="integral" property="integral"/>
<result column="line_integral" property="lineIntegral"/>
<result column="price" property="price"/>
<result column="line_price" property="linePrice"/>
<result column="sku_id" property="skuId"/>
<result column="erp_code" property="erpCode"/>
<result column="spec_detail" property="specDetail"/>
<result column="name" property="name"/>
<result column="thumb_img" property="thumbImg"/>
<result column="market_price" property="marketPrice"/>
<result column="discount_price" property="discountPrice"/>
<result column="discount_line_price" property="discountLinePrice"/>
<result column="deduction_product_vb" property="deductionProductVb"/>
<result column="deduction_line_vb" property="deductionLineVb"/>
<result column="order_checking_id" property="orderCheckingId"/>
</collection>
</resultMap>
<resultMap type="com.sibu.orderHelper.integral.vo.IMCheckingOrderRefundExportBean" id="refundExportResultMap">
<id column="refund_id" jdbcType="VARCHAR" property="refundId"/>
<result column="refund_code" jdbcType="VARCHAR" property="refundCode"/>
<result column="order_id" jdbcType="VARCHAR" property="orderId"/>
<result column="order_code" jdbcType="VARCHAR" property="orderCode"/>
<result column="order_from" jdbcType="TINYINT" property="orderFrom"/>
<result column="member_id" jdbcType="VARCHAR" property="memberId"/>
<result column="refund_type" jdbcType="INTEGER" property="refundType"/>
<result column="refund_goods_status" jdbcType="INTEGER" property="refundGoodsStatus"/>
<result column="refund_reason_id" jdbcType="INTEGER" property="refundReasonId"/>
<result column="refund_reason" jdbcType="VARCHAR" property="refundReason"/>
<result column="refund_money" jdbcType="DECIMAL" property="refundMoney"/>
<result column="order_money" jdbcType="DECIMAL" property="orderMoney"/>
<result column="refund_remark" jdbcType="VARCHAR" property="refundRemark"/>
<result column="refund_status" jdbcType="INTEGER" property="refundStatus"/>
<result column="refund_status_last_update_dt" jdbcType="TIMESTAMP" property="refundStatusLastUpdateDt"/>
<result column="apply_date" jdbcType="TIMESTAMP" property="applyDate"/>
<result column="refund_money_success_flag" jdbcType="BIT" property="refundMoneySuccessFlag"/>
<result column="refund_date" jdbcType="TIMESTAMP" property="refundDate"/>
<result column="buyer_username" jdbcType="VARCHAR" property="buyerUsername"/>
<result column="buyer_phone" jdbcType="VARCHAR" property="buyerPhone"/>
<result column="refund_seller_phone" jdbcType="VARCHAR" property="refundSellerPhone"/>
<result column="refund_seller_address" jdbcType="VARCHAR" property="refundSellerAddress"/>
<result column="refund_seller_name" jdbcType="VARCHAR" property="refundSellerName"/>
<result column="finish_date" jdbcType="TIMESTAMP" property="finishDate"/>
<result column="refund_integral" jdbcType="BIGINT" property="refundIntegral"/>
<result column="refund_goods_deliver_id" jdbcType="TINYINT" property="refundGoodsDeliverId"/>
<result column="refund_goods_deliver_name" jdbcType="VARCHAR" property="refundGoodsDeliverName"/>
<result column="refund_goods_waybill" jdbcType="VARCHAR" property="refundGoodsWaybill"/>
<result column="refund_goods_remark" jdbcType="VARCHAR" property="refundGoodsRemark"/>
<result column="refund_tips" jdbcType="VARCHAR" property="refundTips"/>
<result column="receive_goods_flag" jdbcType="BIT" property="receiveGoodsFlag"/>
<result column="receive_goods_dt" jdbcType="TIMESTAMP" property="receiveGoodsDt"/>
</resultMap>
<!--分页获取退单-->
<select id="pagerOrders" resultMap="refundOrderItemResultMap" parameterType="java.util.Map">
select * from acc_order_refund
where 1=1
<if test="refundCode != null and refundCode != ''">
and refund_code =#{refundCode}
</if>
<if test="orderCode != null and orderCode != ''">
and order_code = #{orderCode}
</if>
<if test="refundType == 1 or refundType == 2 or refundType == 3 or refundType==4">
and refund_type =#{refundType}
</if>
<if test="refundStatus != -1 and refundStatus != null and refundStatus != ''">
and refund_status = #{refundStatus}
</if>
<if test="orderCheckingId != null and orderCheckingId != ''">
and order_checking_id = #{orderCheckingId}
</if>
<if test="startCreateDt != null and startCreateDt !=''">
and refund_status_last_update_dt >= #{startCreateDt}
</if>
<if test="endCreateDt != null and endCreateDt != ''">
<![CDATA[
and refund_status_last_update_dt <= #{endCreateDt}
]]>
</if>
ORDER BY refund_status_last_update_dt DESC
LIMIT ${pageNow}, ${pageSize}
</select>
<!--获取退单数量-->
<select id="countOrders" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(1) from acc_order_refund r
where 1=1
<if test="refundCode != null and refundCode != ''">
and refund_code =#{refundCode}
</if>
<if test="orderCode != null and orderCode != ''">
and order_code = #{orderCode}
</if>
<if test="refundType == 1 or refundType == 2 or refundType == 3 or refundType==4">
and refund_type =#{refundType}
</if>
<if test="refundStatus != -1 and refundStatus != null and refundStatus != ''">
and refund_status = #{refundStatus}
</if>
<if test="orderCheckingId != null and orderCheckingId != ''">
and order_checking_id = #{orderCheckingId}
</if>
<if test="startCreateDt != null and startCreateDt !=''">
and refund_status_last_update_dt >= #{startCreateDt}
</if>
<if test="endCreateDt != null and endCreateDt != ''">
<![CDATA[
and refund_status_last_update_dt <= #{endCreateDt}
]]>
</if>
</select>
<!--根据id获取退单详情-->
<select id="getRefundDetailById" resultMap="refundOrderItemResultMap" parameterType="java.util.Map">
select *
from acc_order_refund r
LEFT JOIN acc_refund_order_item r1 ON r.refund_id = r1.refund_id
where 1=1
AND r.refund_id = #{refundId}
</select>
<!--导出退单记录-->
<select id="getOrderRefundTemplateExcelData" resultMap="refundExportResultMap" parameterType="java.util.Map">
select * from acc_order_refund
where 1=1
<if test="refundCode != null and refundCode != ''">
and refund_code =#{refundCode}
</if>
<if test="orderCode != null and orderCode != ''">
and order_code = #{orderCode}
</if>
<if test="refundType == 1 or refundType == 2 or refundType == 3">
and refund_type =#{refundType}
</if>
<if test="refundStatus != -1 and refundStatus != null and refundStatus != ''">
and refund_status = #{refundStatus}
</if>
<if test="orderCheckingId != null and orderCheckingId != ''">
and order_checking_id = #{orderCheckingId}
</if>
<if test="startCreateDt != null and startCreateDt !=''">
and refund_status_last_update_dt >= #{startCreateDt}
</if>
<if test="endCreateDt != null and endCreateDt != ''">
<![CDATA[
and refund_status_last_update_dt <= #{endCreateDt}
]]>
</if>
ORDER BY refund_status_last_update_dt DESC
</select>
</mapper>