IMRefundOrderItemMapper.xml
4.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?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.IMRefundOrderItemDao">
<resultMap id="BaseResultMap" type="com.sibu.orderHelper.integral.model.IMRefundOrderItem">
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="refund_id" jdbcType="VARCHAR" property="refundId"/>
<result column="order_id" jdbcType="VARCHAR" property="orderId"/>
<result column="order1_id" jdbcType="VARCHAR" property="order1Id"/>
<result column="member_id" jdbcType="VARCHAR" property="memberId"/>
<result column="sort_index" jdbcType="INTEGER" property="sortIndex"/>
<result column="product_id" jdbcType="VARCHAR" property="productId"/>
<result column="quantity" jdbcType="INTEGER" property="quantity"/>
<result column="integral" jdbcType="BIGINT" property="integral"/>
<result column="line_integral" jdbcType="BIGINT" property="lineIntegral"/>
<result column="price" jdbcType="DECIMAL" property="price"/>
<result column="line_price" jdbcType="DECIMAL" property="linePrice"/>
<result column="sku_id" jdbcType="VARCHAR" property="skuId"/>
<result column="erp_code" jdbcType="VARCHAR" property="erpCode"/>
<result column="spec_detail" jdbcType="VARCHAR" property="specDetail"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="thumb_img" jdbcType="VARCHAR" property="thumbImg"/>
<result column="market_price" jdbcType="DECIMAL" property="marketPrice"/>
<result column="discount_price" jdbcType="DECIMAL" property="discountPrice"/>
<result column="discount_line_price" jdbcType="DECIMAL" property="discountLinePrice"/>
<result column="deduction_product_vb" jdbcType="INTEGER" property="deductionProductVb"/>
<result column="deduction_line_vb" jdbcType="INTEGER" property="deductionLineVb"/>
</resultMap>
<insert id="insert" parameterType="com.sibu.orderHelper.integral.model.IMRefundOrderItem">
INSERT INTO `im_refund_order_item`
(`id`,
`refund_id`,
`order_id`,
`order1_id`,
`member_id`,
`sort_index`,
`product_id`,
`quantity`,
`integral`,
`line_integral`,
`price`,
`line_price`,
`sku_id`,
`erp_code`,
`spec_detail`,
`name`,
`thumb_img`,
`market_price`,
`discount_price`,
`discount_line_price`,
`deduction_product_vb`,
`deduction_line_vb`)
VALUES
(#{id},
#{refundId},
#{orderId},
#{order1Id},
#{memberId},
#{sortIndex},
#{productId},
#{quantity},
#{integral},
#{lineIntegral},
#{price},
#{linePrice},
#{skuId},
#{erpCode},
#{specDetail},
#{name},
#{thumbImg},
#{marketPrice},
#{discountPrice},
#{discountLinePrice},
#{deductionProductVb},
#{deductionLineVb});
</insert>
<sql id="Base_Column_List">
id, refund_id, order_id, order1_id, member_id, sort_index, product_id, quantity,
integral, line_integral, price, line_price, sku_id, erp_code, spec_detail, name,
thumb_img, market_price, discount_price, discount_line_price, deduction_product_vb,
deduction_line_vb
</sql>
<select id="findByRefundId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from im_refund_order_item where refund_id = #{refundId}
</select>
<select id="findAlreadyRefundItemQuantityByOrderId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from im_refund_order_item where
order_id = #{orderId} and
refund_id in (
select refund_id from im_order_refund where order_id = #{orderId} and refund_status not in (100,101)
)
</select>
<delete id="removeByRefundId">
delete from im_refund_order_item where refund_id = #{refundId}
</delete>
</mapper>