UfoStoragePriceMapper.xml
9.28 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
<?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.yoho.search.dal.UfoStoragePriceMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ufo_product.StoragePrice">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="product_id" property="productId" jdbcType="INTEGER"/>
<result column="skup" property="skup" jdbcType="INTEGER"/>
<result column="goods_id" property="goodsId" jdbcType="INTEGER"/>
<result column="storage_id" property="storageId" jdbcType="SMALLINT"/>
<result column="depot_num" property="depotNum" jdbcType="INTEGER"/>
<result column="seller_uid" property="sellerUid" jdbcType="INTEGER"/>
<result column="price" property="price" jdbcType="DECIMAL"/>
<result column="status" property="status" jdbcType="INTEGER"/>
<result column="update_time" property="updateTime" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="INTEGER"/>
<result column="is_hide" property="isHide" jdbcType="INTEGER"/>
<result column="pre_sale_flag" property="preSaleFlag" jdbcType="INTEGER"/>
<result column="region" property="region" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="UfoStorageMinPriceMap" type="com.yoho.search.base.bo.UfoStorageMinPrice">
<id column="storage_id" property="storageId" jdbcType="INTEGER"/>
<result column="availableNowPrice" property="availableNowPrice" jdbcType="DECIMAL"/>
</resultMap>
<sql id="Base_Column_List">
id,skup, product_id, goods_id, storage_id, depot_num, seller_uid, price, status, update_time,
create_time,is_hide,pre_sale_flag,region
</sql>
<select id="selectCount" resultType="java.lang.Integer" timeout="20000">
select count(*) from storage_price
</select>
<select id="selectPageList" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from storage_price
order by id
limit #{offset},#{pageSize}
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from storage_price
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectStoragePriceIdBySkup" resultType="java.lang.Integer" parameterType="java.lang.Integer">
select id from storage_price where skup = #{skup,jdbcType=INTEGER} limit 1
</select>
<select id="selectListByPrimaryKeys" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from storage_price
where id in
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from storage_price
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insertSelective" parameterType="com.yoho.search.dal.model.ufo_product.StoragePrice">
insert into storage_price
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="skup != null">
skup,
</if>
<if test="productId != null">
product_id,
</if>
<if test="goodsId != null">
goods_id,
</if>
<if test="storageId != null">
storage_id,
</if>
<if test="depotNum != null">
depot_num,
</if>
<if test="sellerUid != null">
seller_uid,
</if>
<if test="price != null">
price,
</if>
<if test="status != null">
status,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="isHide != null">
is_hide,
</if>
<if test="preSaleFlag != null">
pre_sale_flag,
</if>
<if test="region != null">
region,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="skup != null">
#{skup,jdbcType=INTEGER},
</if>
<if test="productId != null">
#{productId,jdbcType=INTEGER},
</if>
<if test="goodsId != null">
#{goodsId,jdbcType=INTEGER},
</if>
<if test="storageId != null">
#{storageId,jdbcType=INTEGER},
</if>
<if test="depotNum != null">
#{depotNum,jdbcType=INTEGER},
</if>
<if test="sellerUid != null">
#{sellerUid,jdbcType=INTEGER},
</if>
<if test="price != null">
#{price,jdbcType=DECIMAL},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
<if test="isHide != null">
#{isHide,jdbcType=INTEGER},
</if>
<if test="preSaleFlag != null">
#{preSaleFlag,jdbcType=INTEGER},
</if>
<if test="region != null">
#{region,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ufo_product.StoragePrice">
update storage_price
<set>
<if test="skup != null">
skup = #{skup,jdbcType=INTEGER},
</if>
<if test="productId != null">
product_id = #{productId,jdbcType=INTEGER},
</if>
<if test="goodsId != null">
goods_id = #{goodsId,jdbcType=INTEGER},
</if>
<if test="storageId != null">
storage_id = #{storageId,jdbcType=SMALLINT},
</if>
<if test="depotNum != null">
depot_num = #{depotNum,jdbcType=INTEGER},
</if>
<if test="sellerUid != null">
seller_uid = #{sellerUid,jdbcType=INTEGER},
</if>
<if test="price != null">
price = #{price,jdbcType=DECIMAL},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="isHide != null">
is_hide = #{isHide,jdbcType=INTEGER},
</if>
<if test="preSaleFlag != null">
pre_sale_flag = #{preSaleFlag,jdbcType=INTEGER},
</if>
<if test="region != null">
region = #{region,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ufo_product.StoragePrice" >
update storage_price
set skup = #{skup,jdbcType=INTEGER},
product_id = #{productId,jdbcType=INTEGER},
goods_id = #{goodsId,jdbcType=INTEGER},
storage_id = #{storageId,jdbcType=INTEGER},
depot_num = #{depotNum,jdbcType=INTEGER},
seller_uid = #{sellerUid,jdbcType=INTEGER},
price = #{price,jdbcType=DECIMAL},
status = #{status,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=INTEGER},
is_hide = #{isHide,jdbcType=INTEGER},
pre_sale_flag = #{preSaleFlag,jdbcType=INTEGER},
region = #{region,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByProductIdList" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from storage_price
where
product_id in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectStorageMinPriceList" resultMap="UfoStorageMinPriceMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from storage_price
where
storage_id in
<foreach item="item" index="index" collection="storageIds"
open="(" separator="," close=")">
#{item}
</foreach>
and pre_sale_flag not in(5,6)
and status = 1
and is_hide = 0
</select>
</mapper>