IMAccountOrderCheckingDetailMapper.xml
27.7 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<?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.IMWebAccountOrderCheckingDetailDao">
<resultMap type="com.sibu.orderHelper.integral.model.AccountOrderCheckingDetail" id="oneIMOrderDetailColumn">
<id column="order_id" property="orderId"/>
<result column="member_id" property="memberId"/>
<result column="main_order_code" property="mainOrderCode"/>
<result column="order_status" property="orderStatus"/>
<result column="order_from" property="orderFrom"/>
<result column="order_platform" property="orderPlatform"/>
<result column="contact" property="contact"/>
<result column="phone" property="phone"/>
<result column="province" property="province"/>
<result column="city" property="city"/>
<result column="area" property="area"/>
<result column="address" property="address"/>
<result column="zipcode" property="zipcode"/>
<result column="buyer_remark" property="buyerRemark"/>
<result column="seller_remark" property="sellerRemark"/>
<result column="total_integral" property="totalIntegral"/>
<result column="total_money" property="totalMoney"/>
<result column="freight" property="freight"/>
<result column="express_name" property="expressName"/>
<result column="express_code" property="expressCode"/>
<result column="express_code2" property="expressCode2"/>
<result column="create_dt" property="createDt"/>
<result column="pay_dt" property="payDt"/>
<result column="transaction_id" property="transactionId"/>
<result column="pay_type" property="payType"/>
<result column="open_id" property="openId"/>
<result column="buyer_username" property="buyerUsername"></result>
<result column="buyer_phone" property="buyerPhone"></result>
<result column="erp_import" property="erpImport"></result>
<result column="erp_import_dt" property="erpImportDt"></result>
<result column="ship_dt" property="shipDt"></result>
<result column="receive_dt" property="receiveDt"/>
<result column="user_coupon_money" property="userCouponMoney"/>
<result column="deduction_vb" property="deductionVb"/>
<result column="deduction_money" property="deductionMoney"/>
<result column="prerefund_original_order_status" property="prerefundOriginalOrderStatus"/>
<result column="share_member_id" property="shareMemberId"/>
<result column="share_order_money" property="shareOrderMoney"/>
<result column="platform_type" property="platformType"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
<collection property="order1s" column="order_id" ofType="com.sibu.orderHelper.integral.model.AccountOrderCheckingDetailDetail">
<result column="order1_id" property="order1Id"/>
<result column="product_id" property="productId"/>
<result column="purchase_quantity" property="purchaseQuantity"/>
<result column="shipped_quantity" property="shippedQuantity"/>
<result column="integral" property="integral"/>
<result column="line_integral" property="lineIntegral"/>
<result column="price" property="price"/>
<result column="line_price" property="linePrice"/>
<result column="order1_name" property="name"></result>
<result column="thumb_img" property="thumbImg"/>
<result column="spec_detail" property="specDetail"/>
<result column="discount_price" property="discountPrice"/>
<result column="discount_line_price" property="discountLinePrice"/>
<result column="deduction_product_vb_price" property="deductionProductVb"/>
<result column="deduction_line_vb_price" property="deductionLineVb"/>
<result column="erp_code" property="erpCode"/>
<result column="sku_id" property="skuId"/>
<result column="product_share_percentage" property="productSharePercentage"/>
</collection>
</resultMap>
<resultMap type="com.sibu.orderHelper.integral.vo.IMAccountOrderCheckingOrderExportBean" id="exportOrderList">
<id column="order1_id" property="order1Id"/>
<result column="purchase_quantity" property="purchaseQuantity"/>
<result column="shipped_quantity" property="shippedQuantity"/>
<result column="integral" property="integral"/>
<result column="line_integral" property="lineIntegral"/>
<result column="price" property="price"/>
<result column="line_price" property="linePrice"/>
<result column="name" property="productName"/>
<result column="erp_code" property="erpCode"/>
<result column="spec_detail" property="specDetail"/>
<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"/>
<association property="doingOrder" javaType="IMDoingOrderBean">
<id column="order_id" property="orderId"/>
<result column="member_id" property="memberId"/>
<result column="order_code" property="orderCode"/>
<result column="order_status" property="orderStatus"/>
<result column="order_from" property="orderFrom"/>
<result column="order_platform" property="orderPlatform"/>
<result column="contact" property="contact"/>
<result column="phone" property="phone"/>
<result column="address" property="address"/>
<result column="zipcode" property="zipcode"/>
<result column="total_integral" property="totalIntegral"/>
<result column="total_money" property="totalMoney"/>
<result column="freight" property="freight"/>
<result column="create_dt" property="createDt"/>
<result column="pay_dt" property="payDt"/>
<result column="transaction_id" property="transactionId"/>
<result column="pay_type" property="payType"/>
<result column="open_id" property="openId"/>
<result column="buyer_username" property="buyerUsername"></result>
<result column="buyer_phone" property="buyerPhone"></result>
<result column="erp_import" property="erpImport"></result>
<result column="erp_import_dt" property="erpImportDt"></result>
<result column="user_coupon_money" property="userCouponMoney"/>
<result column="deduction_vb" property="deductionVb"/>
<result column="deduction_money" property="deductionMoney"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
</association>
</resultMap>
<resultMap type="com.sibu.orderHelper.integral.model.AccountOrderCheckingDetail" id="oneIMOrderNotProduct">
<id column="order_id" property="orderId"/>
<result column="member_id" property="memberId"/>
<result column="order_code" property="orderCode"/>
<result column="order_status" property="orderStatus"/>
<result column="order_from" property="orderFrom"/>
<result column="order_platform" property="orderPlatform"/>
<result column="contact" property="contact"/>
<result column="phone" property="phone"/>
<result column="total_integral" property="totalIntegral"/>
<result column="total_money" property="totalMoney"></result>
<result column="freight" property="freight"/>
<result column="create_dt" property="createDt"/>
<result column="address" property="address"></result>
<result column="express_code" property="expressCode"></result>
<result column="express_code2" property="expressCode2"></result>
<result column="express_name" property="expressName"></result>
<result column="seller_remark" property="sellerRemark"></result>
<result column="buyer_remark" property="buyerRemark"></result>
<result column="province" property="province"></result>
<result column="city" property="city"></result>
<result column="area" property="area"></result>
<result column="address" property="address"></result>
<result column="zipcode" property="zipcode"></result>
<result column="buyer_remark" property="buyerRemark"></result>
<result column="buyer_username" property="buyerUsername"></result>
<result column="buyer_phone" property="buyerPhone"></result>
<result column="erp_import" property="erpImport"></result>
<result column="supplier_id" property="supplierId"></result>
<result column="supplier_name" property="supplierName"></result>
</resultMap>
<!-- 计算总条数 -->
<select id="countIMOrder" resultType="int" parameterType="map">
SELECT COUNT(1) AS num FROM acc_order_checking_detail
where delete_flag =1
<if test=" orderCode !=null and orderCode!='' ">
and order_code =#{orderCode}
</if>
<if test="startCreateDt != null and startCreateDt !=''">
and create_dt >= #{startCreateDt}
</if>
<if test="endCreateDt != null and endCreateDt != ''">
<![CDATA[
and create_dt <= #{endCreateDt}
]]>
</if>
<if test="orderFrom !=null and orderFrom!='' ">
and order_from =#{orderFrom}
</if>
<if test="phone !=null and phone!=''">
and phone =#{phone}
</if>
<if test="orderStatus != null and orderStatus !=''">
and order_status =#{orderStatus}
</if>
<if test="buyerUsername !=null and buyerUsername !=''">
and buyer_username like concat(#{buyerUsername},'%')
</if>
<if test="buyerPhone !=null and buyerPhone !=''">
and buyer_phone =#{buyerPhone}
</if>
<if test="erpImport !=null and erpImport !=''">
and erp_import=#{erpImport}
</if>
<if test="contact !=null and contact !=''">
and contact like concat(#{contact},'%')
</if>
<if test="supplierId !=null and supplierId !=''">
and supplier_id = #{supplierId}
</if>
<if test="orderCheckingId !=null and orderCheckingId !=''">
and order_checking_id = #{orderCheckingId}
</if>
</select>
<!-- 查询分页订单 -->
<select id="pagerOrders" parameterType="map" resultMap="oneIMOrderNotProduct">
select order_id,member_id,order_code,order_status,order_from,
order_platform,contact,phone,province,city,area,address,zipcode,
buyer_remark,total_integral,total_money,freight,express_name,supplier_id,supplier_name,
express_code,express_code2,create_dt,pay_type,buyer_username,buyer_phone,erp_import
from acc_order_checking_detail
where delete_flag=1
<if test=" orderCode !=null and orderCode!=''">
and order_code =#{orderCode}
</if>
<if test="startCreateDt != null and startCreateDt !=''">
and create_dt >= #{startCreateDt}
</if>
<if test="endCreateDt != null and endCreateDt != ''">
<![CDATA[
and create_dt <= #{endCreateDt}
]]>
</if>
<if test="orderFrom !=null and orderFrom!=''">
and order_from =#{orderFrom}
</if>
<if test="phone !=null and phone!=''">
and phone =#{phone}
</if>
<if test="orderStatus !=null and orderStatus !=''">
and order_status =#{orderStatus}
</if>
<if test="buyerUsername !=null and buyerUsername !=''">
and buyer_username like concat(#{buyerUsername},'%')
</if>
<if test="buyerPhone !=null and buyerPhone !=''">
and buyer_phone =#{buyerPhone}
</if>
<if test="erpImport !=null and erpImport !=''">
and erp_import=#{erpImport}
</if>
<if test="contact !=null and contact !=''">
and contact like concat(#{contact},'%')
</if>
<if test="orderCheckingId !=null and orderCheckingId !=''">
and order_checking_id = #{orderCheckingId}
</if>
ORDER BY create_dt desc
limit ${pageNow}, ${pageSize}
</select>
<!-- 检验订单 -->
<select id="verifyOrders" parameterType="String" resultMap="oneIMOrderNotProduct">
select order_code
from acc_order_checking_detail
where delete_flag=1 AND sign_pay_status=0 AND order_from=1
<if test="orderCheckingId !=null and orderCheckingId !=''">
and order_checking_id = #{orderCheckingId}
</if>
ORDER BY create_dt desc
</select>
<!-- 获取订单明细 -->
<select id="getIMOrderDetailOrderCode" parameterType="map" resultMap="oneIMOrderDetailColumn">
select
do.order_id,do.member_id,do.order_code,do.main_order_code,do.order_status,do.order_from,do.buyer_username,do.buyer_phone,
do.order_platform,do.contact,do.phone,do.province,do.city,do.area,do.address,do.zipcode,do.erp_import_dt,do.erp_import,
do.buyer_remark,do.seller_remark,do.total_integral,do.total_money,do.freight,do.express_name,do.transaction_id,do.pay_type,do.open_id,
do.express_code,do.express_code2,do.create_dt,do.receive_dt,do.pay_dt,do.user_coupon_money,do.deduction_vb,do.deduction_money,do1.order1_id,do1.product_id,do.ship_dt,
do.prerefund_original_order_status,do.share_member_id,do.share_order_money,do.platform_type,do.supplier_id,do.supplier_name,
do1.purchase_quantity,do1.integral,do1.line_integral,do1.price,do1.line_price,do1.name as
order1_name,do1.erp_code,do1.sku_id,do1.shipped_quantity,
do1.thumb_img,do1.spec_detail,do1.discount_price,do1.discount_line_price,do1.deduction_product_vb_price,do1.deduction_line_vb_price,
do1.product_share_percentage
from acc_order_checking_detail do left join acc_order_checking1_detail do1 on do.order_id=do1.order_id
where 1=1
<if test="orderCode !=null and orderCode !=''">
and do.order_code=#{orderCode}
</if>
<if test="orderId !=null and orderId !=''">
and do.order_id=#{orderId}
</if>
</select>
<!-- 获取订单详情(不包含产品) -->
<select id="getOrderByCode" parameterType="String" resultMap="oneIMOrderDetailColumn">
select order_id,member_id,order_code,main_order_code,order_status,order_from,express_name,express_code,express_code2,
order_platform,contact,phone,total_integral,freight,create_dt,pay_dt,total_money,buyer_username,buyer_phone,open_id,
erp_import,prerefund_original_order_status,share_member_id
from acc_order_checking_detail
where order_code=#{orderCode} AND delete_flag=1
</select>
<!-- 查询导出excel表订单 -->
<select id="exportOrderList" parameterType="map" resultMap="exportOrderList">
select do.order_id,do.order_code,do.order_status,do.order_from,
do.contact,do.phone,do.address,do.zipcode,do.total_integral,do.total_money,
do.freight,do.create_dt,do.pay_dt,do.pay_type,do.transaction_id,do.erp_import,do.supplier_id,do.supplier_name,
do.erp_import_dt,do.buyer_username,do.buyer_phone,do.open_id,do.user_coupon_money,do.deduction_vb,do.deduction_money,
do1.purchase_quantity,do1.shipped_quantity,do1.integral,do1.line_integral,do1.price,do1.line_price,
do1.name,do1.erp_code,do1.spec_detail,do1.order1_id,do1.discount_price,do1.discount_line_price,do1.deduction_product_vb,do1.deduction_line_vb
from acc_order_checking1_detail do1 left join acc_order_checking_detail do on do.order_id=do1.order_id
where do.delete_flag = 1
<if test="orderCode !=null and orderCode!=''">
and do.order_code =#{orderCode}
</if>
<if test="startCreateDt != null and startCreateDt !=''">
and create_dt >= #{startCreateDt}
</if>
<if test="endCreateDt != null and endCreateDt != ''">
<![CDATA[
and create_dt <= #{endCreateDt}
]]>
</if>
<if test="phone !=null and phone!=''">
and do.phone =#{phone}
</if>
<if test="orderStatus !=null and orderStatus !=''">
and do.order_status =#{orderStatus}
</if>
<if test="buyerUsername !=null and buyerUsername !=''">
and do.buyer_username like concat('%', #{buyerUsername},'%')
</if>
<if test="buyerPhone !=null and buyerPhone !=''">
and do.buyer_phone =#{buyerPhone}
</if>
<if test="erpImport !=null and erpImport !=''">
and do.erp_import=#{erpImport}
</if>
<if test="contact !=null and contact !=''">
and do.contact like concat('%', #{contact}, '%')
</if>
<if test="orderCheckingId != null and orderCheckingId != ''">
and do.order_checking_id = #{orderCheckingId}
</if>
ORDER BY create_dt
</select>
<resultMap type="com.sibu.orderHelper.integral.model.AccountOrderCheckingDetail" id="accountOrderCheckingDetail">
<id column="order_id" property="orderId"/>
<result column="member_id" property="memberId"/>
<result column="order_code" property="orderCode"/>
<result column="main_order_code" property="mainOrderCode"/>
<result column="order_status" property="orderStatus"/>
<result column="order_from" property="orderFrom"/>
<result column="order_platform" property="orderPlatform"/>
<result column="prerefund_original_order_status" property="prerefundOriginalOrderStatus"/>
<result column="contact" property="contact"/>
<result column="phone" property="phone"/>
<result column="province" property="province"/>
<result column="city" property="city"/>
<result column="area" property="area"/>
<result column="address" property="address"/>
<result column="zipcode" property="zipcode"/>
<result column="buyer_remark" property="buyerRemark"/>
<result column="seller_remark" property="sellerRemark"/>
<result column="total_integral" property="totalIntegral"/>
<result column="user_coupon_id" property="userCouponId"/>
<result column="total_money" property="totalMoney"/>
<result column="freight" property="freight"/>
<result column="express_name" property="expressName"/>
<result column="express_code" property="expressCode"/>
<result column="express_code2" property="expressCode2"/>
<result column="create_dt" property="createDt"/>
<result column="pay_dt" property="payDt"/>
<result column="transaction_id" property="transactionId"/>
<result column="pay_type" property="payType"/>
<result column="open_id" property="openId"/>
<result column="buyer_username" property="buyerUsername"></result>
<result column="buyer_phone" property="buyerPhone"></result>
<result column="erp_import" property="erpImport"></result>
<result column="erp_import_dt" property="erpImportDt"></result>
<result column="ship_dt" property="shipDt"></result>
<result column="receive_dt" property="receiveDt"/>
<result column="erp_download" property="erpDownload"/>
<result column="erp_downloadDt" property="erpDownloadDt"/>
<result column="user_coupon_money" property="userCouponMoney"/>
<result column="deduction_vb" property="deductionVb"/>
<result column="deduction_money" property="deductionMoney"/>
<result column="discount_total_money" property="discountTotalMoney"/>
<result column="share_member_id" property="shareMemberId"/>
<result column="share_order_money" property="shareOrderMoney"/>
<result column="delete_flag" property="deleteFlag"/>
<result column="platform_type" property="platformType"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
<result column="erp_orderCode" property="erpOrderCode"/>
<result column="gift_coupon_id" property="giftCouponId"/>
<result column="receive_remark" property="receiveRemark"/>
<result column="sign_pay_status" property="signPayStatus"/>
<result column="if_evaluate" property="ifEvaluate"/>
<result column="operator_id" property="operatorId"/>
<result column="operator_name" property="operatorName"/>
<result column="operator_date" property="operatorDate"/>
<collection property="order1s" column="order_id" ofType="com.sibu.orderHelper.integral.model.AccountOrderCheckingDetailDetail">
<result column="order1_id" property="order1Id"/>
<result column="product_id" property="productId"/>
<result column="oid" property="orderId"/>
<result column="mid" property="memberId"/>
<result column="sort_index" property="sortIndex"/>
<result column="is_evaluate" property="isEvaluate"/>
<result column="erp_code" property="erpCode"/>
<result column="market_price" property="marketPrice"/>
<result column="purchase_quantity" property="purchaseQuantity"/>
<result column="shipped_quantity" property="shippedQuantity"/>
<result column="integral" property="integral"/>
<result column="line_integral" property="lineIntegral"/>
<result column="price" property="price"/>
<result column="line_price" property="linePrice"/>
<result column="order1_name" property="name"></result>
<result column="thumb_img" property="thumbImg"/>
<result column="spec_detail" property="specDetail"/>
<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="deduction_product_vb_price" property="deductionProductVbPrice"></result>
<result column="deduction_line_vb_price" property="deductionLineVbPrice"></result>
<result column="deduction_product_coupon_price" property="deductionProductCouponPrice"></result>
<result column="deduction_line_coupon_price" property="deductionLineCouponPrice"></result>
<result column="erp_code" property="erpCode"/>
<result column="sku_id" property="skuId"/>
<result column="product_share_percentage" property="productSharePercentage"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
<result column="name" property="name"/>
<result column="refund_status" property="refundStatus"/>
<result column="product_share_percentage" property="productSharePercentage"/>
</collection>
</resultMap>
<!-- 查询需要对账的订单信息(已发货,按发货时间计算)-->
<select id="pagerOrdersCheckingByShipments" parameterType="map" resultMap="accountOrderCheckingDetail">
select * from
<foreach collection="tableNames" open="(" close=")" separator=" UNION ALL " item="orderTable">
SELECT
do.order_id,do.member_id,do.order_code,do.main_order_code,do.order_status,do.prerefund_original_order_status,do.order_platform,do.contact,do.phone,do.order_from,
do.province,do.city,do.area,do.address,do.zipcode,do.total_integral,do.total_money,do.freight,do.buyer_remark,do.seller_remark,do.pay_dt,
do.ship_dt,do.express_name,do.express_code,do.express_code2,do.receive_dt,do.receive_remark,do.erp_download,do.erp_download_dt,do.erp_import,
do.erp_import_dt,do.create_dt,do.delete_flag,do.erp_order_code,do.transaction_id,do.open_id,do.pay_type,do.buyer_username,do.buyer_phone,do.if_evaluate,
do.user_coupon_id,do.user_coupon_money,do.deduction_vb,do.deduction_money,do.discount_total_money,do.share_member_id,do.share_order_money,do.gift_coupon_id,
do.supplier_id,do.supplier_name,do.platform_type,do.sign_pay_status,do.operator_id,do.operator_name,do.operator_date,
do1.order1_id,do1.member_id mId,do1.order_id oid,do1.sort_index,do1.product_id,do1.purchase_quantity,do1.shipped_quantity,do1.integral,do1.line_integral,do1.price,do1.line_price,do1.is_evaluate,
do1.sku_id,do1.erp_code,do1.spec_detail,do1.name,do1.thumb_img,do1.market_price,do1.discount_line_price,do1.deduction_product_vb,do1.deduction_line_vb,do1.discount_price,
do1.deduction_product_vb_price,do1.deduction_line_vb_price,do1.deduction_product_coupon_price,do1.deduction_line_coupon_price,do1.refund_status,do1.product_share_percentage
FROM ${orderTable[0]} do
LEFT JOIN ${orderTable[1]} do1 ON do.order_id = do1.order_id
where do.delete_flag=1 and (do.order_status IN (4,5,6,7,100)
and do.supplier_id =#{supplierId}
and do.ship_dt >= #{shipStartDt}
<![CDATA[
and do.ship_dt <= #{shipEndtDt}
]]>
)
</foreach>
as temp
ORDER BY temp.create_dt desc
</select>
<!-- 查询需要对账的订单信息(未发过货已付款且已退款成功(按支付时间计算)8 发货时间为空 有付款时间)-->
<select id="pagerOrdersCheckingByNotShipments" parameterType="map" resultMap="accountOrderCheckingDetail">
select * from
<foreach collection="tableNames" open="(" close=")" separator=" UNION ALL " item="orderTable">
SELECT
do.order_id,do.member_id,do.order_code,do.main_order_code,do.order_status,do.prerefund_original_order_status,do.order_platform,do.contact,do.phone,do.order_from,
do.province,do.city,do.area,do.address,do.zipcode,do.total_integral,do.total_money,do.freight,do.buyer_remark,do.seller_remark,do.pay_dt,
do.ship_dt,do.express_name,do.express_code,do.express_code2,do.receive_dt,do.receive_remark,do.erp_download,do.erp_download_dt,do.erp_import,
do.erp_import_dt,do.create_dt,do.delete_flag,do.erp_order_code,do.transaction_id,do.open_id,do.pay_type,do.buyer_username,do.buyer_phone,do.if_evaluate,
do.user_coupon_id,do.user_coupon_money,do.deduction_vb,do.deduction_money,do.discount_total_money,do.share_member_id,do.share_order_money,do.gift_coupon_id,
do.supplier_id,do.supplier_name,do.platform_type,do.sign_pay_status,do.operator_id,do.operator_name,do.operator_date,
do1.order1_id,do1.sort_index,do1.member_id mId,do1.order_id oid,do1.product_id,do1.purchase_quantity,do1.shipped_quantity,do1.integral,do1.line_integral,do1.price,do1.line_price,do1.is_evaluate,
do1.sku_id,do1.erp_code,do1.spec_detail,do1.name,do1.thumb_img,do1.market_price,do1.discount_line_price,do1.deduction_product_vb,do1.deduction_line_vb,do1.discount_price,
do1.deduction_product_vb_price,do1.deduction_line_vb_price,do1.deduction_product_coupon_price,do1.deduction_line_coupon_price,do1.refund_status,do1.product_share_percentage
FROM ${orderTable[0]} do
LEFT JOIN ${orderTable[1]} do1 ON do.order_id = do1.order_id
where do.delete_flag=1 and do.order_status = 7 AND do.ship_dt IS NULL
and do.supplier_id =#{supplierId}
and do.pay_dt >= #{payStartDt}
<![CDATA[
and do.pay_dt <= #{payEndDt}
]]>
</foreach>
as temp
ORDER BY temp.create_dt desc
</select>
</mapper>