|
@@ -84,10 +84,13 @@ |
|
@@ -84,10 +84,13 @@ |
84
|
where skup = #{skup,jdbcType=INTEGER} and status = 2
|
84
|
where skup = #{skup,jdbcType=INTEGER} and status = 2
|
85
|
</update>
|
85
|
</update>
|
86
|
<select id="selectLeastPrice" resultMap="BaseResultMap">
|
86
|
<select id="selectLeastPrice" resultMap="BaseResultMap">
|
87
|
- select price, skup, product_id from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 and is_hide = 0 and pre_sale_flag=0 order by price limit 1
|
87
|
+ select price, skup, product_id from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 and is_hide = 0 and pre_sale_flag=0 and region=0 order by price limit 1
|
88
|
</select>
|
88
|
</select>
|
89
|
<select id="selectPreSaleLeastPrice" resultMap="BaseResultMap">
|
89
|
<select id="selectPreSaleLeastPrice" resultMap="BaseResultMap">
|
90
|
- select price, skup from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 and is_hide = 0 and pre_sale_flag=1 order by price limit 1
|
90
|
+ select price, skup from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 and is_hide = 0 and pre_sale_flag=1 and region=0 order by price limit 1
|
|
|
91
|
+ </select>
|
|
|
92
|
+ <select id="selectHKLeastPrice" resultMap="BaseResultMap">
|
|
|
93
|
+ select price, skup from storage_price where storage_id = #{storageId,jdbcType=INTEGER} and status = 1 and is_hide = 0 and pre_sale_flag=1 and region=1 order by price limit 1
|
91
|
</select>
|
94
|
</select>
|
92
|
<select id="selectByStorageIds" resultMap="BaseResultMap">
|
95
|
<select id="selectByStorageIds" resultMap="BaseResultMap">
|
93
|
select id, skup, storage_id, price, status
|
96
|
select id, skup, storage_id, price, status
|
|
@@ -112,7 +115,7 @@ |
|
@@ -112,7 +115,7 @@ |
112
|
<select id="selectInStockLeastPriceByProductId" resultType="java.math.BigDecimal">
|
115
|
<select id="selectInStockLeastPriceByProductId" resultType="java.math.BigDecimal">
|
113
|
select min(price) as price
|
116
|
select min(price) as price
|
114
|
from storage_price
|
117
|
from storage_price
|
115
|
- where status = 1 and storage_id = #{storageId} and is_hide = 0 and pre_sale_flag=0
|
118
|
+ where status = 1 and storage_id = #{storageId} and is_hide = 0 and pre_sale_flag=0 and region=0
|
116
|
</select>
|
119
|
</select>
|
117
|
|
120
|
|
118
|
<select id="selectBySkupList" resultMap="BaseResultMap">
|
121
|
<select id="selectBySkupList" resultMap="BaseResultMap">
|
|
@@ -176,7 +179,7 @@ |
|
@@ -176,7 +179,7 @@ |
176
|
storage_id in
|
179
|
storage_id in
|
177
|
<foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
180
|
<foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
178
|
#{storageId, jdbcType=INTEGER}
|
181
|
#{storageId, jdbcType=INTEGER}
|
179
|
- </foreach> and status = 1 and is_hide = 0 and pre_sale_flag=0
|
182
|
+ </foreach> and status = 1 and is_hide = 0 and pre_sale_flag=0 and region=0
|
180
|
group by storage_id
|
183
|
group by storage_id
|
181
|
</select>
|
184
|
</select>
|
182
|
|
185
|
|
|
@@ -185,7 +188,16 @@ |
|
@@ -185,7 +188,16 @@ |
185
|
storage_id in
|
188
|
storage_id in
|
186
|
<foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
189
|
<foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
187
|
#{storageId, jdbcType=INTEGER}
|
190
|
#{storageId, jdbcType=INTEGER}
|
188
|
- </foreach> and status = 1 and is_hide = 0 and pre_sale_flag=1
|
191
|
+ </foreach> and status = 1 and is_hide = 0 and pre_sale_flag=1 and region=0
|
|
|
192
|
+ group by storage_id
|
|
|
193
|
+ </select>
|
|
|
194
|
+
|
|
|
195
|
+ <select id="selectBatchHKLeastPrice" resultMap="BaseResultMap">
|
|
|
196
|
+ select storage_id , min(price) as price from storage_price where
|
|
|
197
|
+ storage_id in
|
|
|
198
|
+ <foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
|
|
199
|
+ #{storageId, jdbcType=INTEGER}
|
|
|
200
|
+ </foreach> and status = 1 and is_hide = 0 and pre_sale_flag=0 and region=1
|
189
|
group by storage_id
|
201
|
group by storage_id
|
190
|
</select>
|
202
|
</select>
|
191
|
|
203
|
|
|
@@ -208,7 +220,7 @@ |
|
@@ -208,7 +220,7 @@ |
208
|
from storage_price
|
220
|
from storage_price
|
209
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0
|
221
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0
|
210
|
<if test="secondType != null and secondType !=''">
|
222
|
<if test="secondType != null and secondType !=''">
|
211
|
- and pre_sale_flag in (${secondType})
|
223
|
+ and pre_sale_flag in (${secondType}) and region=0
|
212
|
</if>
|
224
|
</if>
|
213
|
order by ${orderBy}
|
225
|
order by ${orderBy}
|
214
|
limit #{start},#{limit}
|
226
|
limit #{start},#{limit}
|
|
@@ -219,18 +231,18 @@ |
|
@@ -219,18 +231,18 @@ |
219
|
from storage_price
|
231
|
from storage_price
|
220
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0
|
232
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0
|
221
|
<if test="secondType != null and secondType !=''">
|
233
|
<if test="secondType != null and secondType !=''">
|
222
|
- and pre_sale_flag in (${secondType})
|
234
|
+ and pre_sale_flag in (${secondType}) and region=0
|
223
|
</if>
|
235
|
</if>
|
224
|
</select>
|
236
|
</select>
|
225
|
|
237
|
|
226
|
<select id="selectSecondHandType" resultType="java.lang.Integer">
|
238
|
<select id="selectSecondHandType" resultType="java.lang.Integer">
|
227
|
select distinct pre_sale_flag from storage_price
|
239
|
select distinct pre_sale_flag from storage_price
|
228
|
- where storage_id =#{storageId} and status in(1,100) and is_hide = 0 and pre_sale_flag in (5,6) order by pre_sale_flag
|
240
|
+ where storage_id =#{storageId} and status in(1,100) and is_hide = 0 and pre_sale_flag in (5,6) and region=0 order by pre_sale_flag
|
229
|
</select>
|
241
|
</select>
|
230
|
|
242
|
|
231
|
<select id="selectSecondHandCount" resultType="java.lang.Integer">
|
243
|
<select id="selectSecondHandCount" resultType="java.lang.Integer">
|
232
|
select count(*) from storage_price
|
244
|
select count(*) from storage_price
|
233
|
- where storage_id =#{storageId} and status in(1,100) and is_hide = 0 and pre_sale_flag in (5,6)
|
245
|
+ where storage_id =#{storageId} and status in(1,100) and is_hide = 0 and pre_sale_flag in (5,6) and region=0
|
234
|
</select>
|
246
|
</select>
|
235
|
|
247
|
|
236
|
|
248
|
|