IIMWebOrderCheckingMapper.xml
5.1 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
<?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.IIMWebOrderCheckingDao">
<insert id="addOrderChecking">
INSERT INTO acc_order_checking(id,order_checking_id,supplier_id,supplier_name,settle_start_date,settle_end_date,business_money,reality_business_money,
coupon_money,refund_money,service_charge,receivable_service_charge,discount_rate,profits,audit_status,create_sys_user_id,create_dt,deduction_vb,deduction_vb_price,
refund_vb_price,refund_vb)
VALUES
<foreach collection="list" item="c" separator=",">
(#{c.id},#{c.orderCheckingId},#{c.supplierId},#{c.supplierName},#{c.settleStartDate},#{c.settleEndDate},#{c.businessMoney},#{c.realityBusinessMoney},
#{c.couponMoney},#{c.refundMoney},#{c.serviceCharge},#{c.receivableServiceCharge},#{c.discountRate},#{c.profits},#{c.auditStatus},#{c.createSysUserId},#{c.createDt},#{c.deductionVb},#{c.deductionVbPrice},
#{c.refundVbPrice},#{c.refundVb}
)
</foreach>
</insert>
<insert id="addOrderCheckingDetail">
INSERT INTO acc_order_checking_detail(order_checking_detail_id,order_id,member_id,order_code,main_order_code,order_status,prerefund_original_order_status,order_from,order_platform,contact,phone,
province,city,area,address,zipcode,total_integral,total_money,freight,buyer_remark,seller_remark,pay_dt,ship_dt,express_name,express_code,express_code2,receive_dt,erp_download,
erp_download_dt,erp_import,erp_import_dt,create_dt,delete_flag,erp_order_code,transaction_id,open_id,pay_type,buyer_username,buyer_phone,if_evaluate,receive_remark,user_coupon_id,
user_coupon_money,deduction_vb,deduction_money,discount_total_money,share_member_id,share_order_money,gift_coupon_id,supplier_id,supplier_name,platform_type,order_checking_id,sign_pay_status,
operator_id,operator_name,operator_date)
VALUES
<foreach collection="list" item="c" separator=",">
(#{c.id},#{c.orderId},#{c.memberId},#{c.orderCode},#{c.mainOrderCode},#{c.orderStatus},#{c.prerefundOriginalOrderStatus},#{c.orderFrom},#{c.orderPlatform},#{c.contact},#{c.phone},
#{c.province},#{c.city},#{c.area},#{c.address},#{c.zipcode},#{c.totalIntegral},#{c.totalMoney},#{c.freight},#{c.buyerRemark},#{c.sellerRemark},#{c.payDt},#{c.shipDt},#{c.expressName},#{c.expressCode},#{c.expressCode2},#{c.receiveDt},#{c.erpDownload},
#{c.erpDownloadDt},#{c.erpImport},#{c.erpImportDt},#{c.createDt},#{c.deleteFlag},#{c.erpOrderCode},#{c.transactionId},#{c.openId},#{c.payType},#{c.buyerUsername},#{c.buyerPhone},#{c.ifEvaluate},#{c.receiveRemark},#{c.userCouponId},
#{c.userCouponMoney},#{c.deductionVb},#{c.deductionMoney},#{c.discountTotalMoney},#{c.shareMemberId},#{c.shareOrderMoney},#{c.giftCouponId},#{c.supplierId},#{c.supplierName},#{c.platformType},#{c.orderCheckingId},#{c.signPayStatus},
#{c.operatorId},#{c.operatorName},#{c.operatorDate})
</foreach>
</insert>
<insert id="addOrderChecking1Detail">
INSERT INTO acc_order_checking1_detail(order_checking1_detail_id,order1_id,member_id,order_id,sort_index,product_id,purchase_quantity,shipped_quantity,integral,line_integral,price,line_price,is_evaluate,sku_id,erp_code,spec_detail,name,thumb_img,market_price,
discount_price,discount_line_price,deduction_product_vb_price,deduction_line_vb_price,deduction_product_coupon_price,deduction_line_coupon_price,refund_status,product_share_percentage,order_checking_id,supplier_id,supplier_name,deduction_product_vb,deduction_line_vb,service_charge_rate)
VALUES
<foreach collection="list" item="c" separator=",">
(#{c.id},#{c.order1Id},#{c.memberId},#{c.orderId},#{c.sortIndex},#{c.productId},#{c.purchaseQuantity},#{c.shippedQuantity},#{c.integral},#{c.lineIntegral},#{c.price},#{c.linePrice},#{c.isEvaluate},#{c.skuId},#{c.erpCode},#{c.specDetail},#{c.name},#{c.thumbImg},#{c.marketPrice},
#{c.discountPrice},#{c.discountLinePrice},#{c.deductionProductVbPrice},#{c.deductionLineVbPrice},#{c.deductionProductCouponPrice},#{c.deductionLineCouponPrice},#{c.refundStatus},#{c.productSharePercentage},#{c.orderCheckingId},#{c.supplierId},#{c.supplierName},#{c.deductionProductVb},#{c.deductionLineVb},#{c.serviceChargeRate})
</foreach>
</insert>
<resultMap id="accountOrderChecking" type="com.sibu.orderHelper.integral.model.AccountOrderChecking">
<result column="order_checking_id" property="orderCheckingId" />
</resultMap>
<select id="checkOrderCheckingByDate" parameterType="com.sibu.orderHelper.integral.request.OrderCheckingRequest" resultMap="accountOrderChecking">
SELECT * FROM acc_order_checking WHERE
(
(
<![CDATA[
settle_start_date <= #{settleStartDate}
]]>
and settle_end_date >= #{settleStartDate}
)
OR
(
<![CDATA[
settle_start_date <= #{settleEndDate}
]]>
and settle_end_date >= #{settleEndDate}
)
OR
(
settle_start_date >= #{settleStartDate}
and
<![CDATA[
settle_end_date <= #{settleEndDate}
]]>
)
)
<if test="supplierId != null and supplierId !=''">
and supplier_id = #{supplierId}
</if>
AND audit_status != '2'
</select>
</mapper>