SellerOrderGoodsMapper.xml
6.52 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
<?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.yohoufo.order.dal.SellerOrderGoodsMapper">
<resultMap id="BaseResultMap" type="com.yohoufo.order.dal.model.SellerOrderGoods">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="product_id" jdbcType="INTEGER" property="productId" />
<result column="product_name" jdbcType="VARCHAR" property="productName" />
<result column="storage_id" jdbcType="INTEGER" property="storageId" />
<result column="depot_no" jdbcType="INTEGER" property="depotNo" />
<result column="size_id" jdbcType="INTEGER" property="sizeId" />
<result column="size_name" jdbcType="VARCHAR" property="sizeName" />
<result column="goods_id" jdbcType="INTEGER" property="goodsId" />
<result column="color_id" jdbcType="SMALLINT" property="colorId" />
<result column="color_name" jdbcType="VARCHAR" property="colorName" />
<result column="goods_price" jdbcType="DECIMAL" property="goodsPrice" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="image_url" jdbcType="VARCHAR" property="imageUrl" />
</resultMap>
<sql id="Base_Column_List">
id, product_id, product_name, storage_id, depot_no, size_id, size_name, goods_id,
color_id, color_name, goods_price, status, image_url
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from seller_order_goods
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from seller_order_goods
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.order.dal.model.SellerOrderGoods" useGeneratedKeys="true">
insert into seller_order_goods (product_id, product_name, storage_id,
depot_no, size_id, size_name,
goods_id, color_id, color_name,
goods_price, status)
values (#{productId,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, #{storageId,jdbcType=INTEGER},
#{depotNo,jdbcType=INTEGER}, #{sizeId,jdbcType=INTEGER}, #{sizeName,jdbcType=VARCHAR},
#{goodsId,jdbcType=INTEGER}, #{colorId,jdbcType=SMALLINT}, #{colorName,jdbcType=VARCHAR},
#{goodsPrice,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.SellerOrderGoods" useGeneratedKeys="true">
insert into seller_order_goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productId != null">
product_id,
</if>
<if test="productName != null">
product_name,
</if>
<if test="storageId != null">
storage_id,
</if>
<if test="depotNo != null">
depot_no,
</if>
<if test="sizeId != null">
size_id,
</if>
<if test="sizeName != null">
size_name,
</if>
<if test="goodsId != null">
goods_id,
</if>
<if test="colorId != null">
color_id,
</if>
<if test="colorName != null">
color_name,
</if>
<if test="goodsPrice != null">
goods_price,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null">
#{productId,jdbcType=INTEGER},
</if>
<if test="productName != null">
#{productName,jdbcType=VARCHAR},
</if>
<if test="storageId != null">
#{storageId,jdbcType=INTEGER},
</if>
<if test="depotNo != null">
#{depotNo,jdbcType=INTEGER},
</if>
<if test="sizeId != null">
#{sizeId,jdbcType=INTEGER},
</if>
<if test="sizeName != null">
#{sizeName,jdbcType=VARCHAR},
</if>
<if test="goodsId != null">
#{goodsId,jdbcType=INTEGER},
</if>
<if test="colorId != null">
#{colorId,jdbcType=SMALLINT},
</if>
<if test="colorName != null">
#{colorName,jdbcType=VARCHAR},
</if>
<if test="goodsPrice != null">
#{goodsPrice,jdbcType=DECIMAL},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yohoufo.order.dal.model.SellerOrderGoods">
update seller_order_goods
<set>
<if test="productId != null">
product_id = #{productId,jdbcType=INTEGER},
</if>
<if test="productName != null">
product_name = #{productName,jdbcType=VARCHAR},
</if>
<if test="storageId != null">
storage_id = #{storageId,jdbcType=INTEGER},
</if>
<if test="depotNo != null">
depot_no = #{depotNo,jdbcType=INTEGER},
</if>
<if test="sizeId != null">
size_id = #{sizeId,jdbcType=INTEGER},
</if>
<if test="sizeName != null">
size_name = #{sizeName,jdbcType=VARCHAR},
</if>
<if test="goodsId != null">
goods_id = #{goodsId,jdbcType=INTEGER},
</if>
<if test="colorId != null">
color_id = #{colorId,jdbcType=SMALLINT},
</if>
<if test="colorName != null">
color_name = #{colorName,jdbcType=VARCHAR},
</if>
<if test="goodsPrice != null">
goods_price = #{goodsPrice,jdbcType=DECIMAL},
</if>
<if test="status != null">
status = #{status,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yohoufo.dal.order.model.SellerOrderGoods">
update seller_order_goods
set product_id = #{productId,jdbcType=INTEGER},
product_name = #{productName,jdbcType=VARCHAR},
storage_id = #{storageId,jdbcType=INTEGER},
depot_no = #{depotNo,jdbcType=INTEGER},
size_id = #{sizeId,jdbcType=INTEGER},
size_name = #{sizeName,jdbcType=VARCHAR},
goods_id = #{goodsId,jdbcType=INTEGER},
color_id = #{colorId,jdbcType=SMALLINT},
color_name = #{colorName,jdbcType=VARCHAR},
goods_price = #{goodsPrice,jdbcType=DECIMAL},
status = #{status,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>