...
|
...
|
@@ -84,10 +84,13 @@ |
|
|
where skup = #{skup,jdbcType=INTEGER} and status = 2
|
|
|
</update>
|
|
|
<select id="selectLeastPrice" resultMap="BaseResultMap">
|
|
|
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
|
|
|
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
|
|
|
</select>
|
|
|
<select id="selectPreSaleLeastPrice" resultMap="BaseResultMap">
|
|
|
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
|
|
|
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
|
|
|
</select>
|
|
|
<select id="selectHKLeastPrice" resultMap="BaseResultMap">
|
|
|
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
|
|
|
</select>
|
|
|
<select id="selectByStorageIds" resultMap="BaseResultMap">
|
|
|
select id, skup, storage_id, price, status
|
...
|
...
|
@@ -112,7 +115,7 @@ |
|
|
<select id="selectInStockLeastPriceByProductId" resultType="java.math.BigDecimal">
|
|
|
select min(price) as price
|
|
|
from storage_price
|
|
|
where status = 1 and storage_id = #{storageId} and is_hide = 0 and pre_sale_flag=0
|
|
|
where status = 1 and storage_id = #{storageId} and is_hide = 0 and pre_sale_flag=0 and region=0
|
|
|
</select>
|
|
|
|
|
|
<select id="selectBySkupList" resultMap="BaseResultMap">
|
...
|
...
|
@@ -176,7 +179,7 @@ |
|
|
storage_id in
|
|
|
<foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
|
|
#{storageId, jdbcType=INTEGER}
|
|
|
</foreach> and status = 1 and is_hide = 0 and pre_sale_flag=0
|
|
|
</foreach> and status = 1 and is_hide = 0 and pre_sale_flag=0 and region=0
|
|
|
group by storage_id
|
|
|
</select>
|
|
|
|
...
|
...
|
@@ -185,7 +188,16 @@ |
|
|
storage_id in
|
|
|
<foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
|
|
#{storageId, jdbcType=INTEGER}
|
|
|
</foreach> and status = 1 and is_hide = 0 and pre_sale_flag=1
|
|
|
</foreach> and status = 1 and is_hide = 0 and pre_sale_flag=1 and region=0
|
|
|
group by storage_id
|
|
|
</select>
|
|
|
|
|
|
<select id="selectBatchHKLeastPrice" resultMap="BaseResultMap">
|
|
|
select storage_id , min(price) as price from storage_price where
|
|
|
storage_id in
|
|
|
<foreach item="storageId" index="index" collection="skuList" open="(" separator="," close=")">
|
|
|
#{storageId, jdbcType=INTEGER}
|
|
|
</foreach> and status = 1 and is_hide = 0 and pre_sale_flag=0 and region=1
|
|
|
group by storage_id
|
|
|
</select>
|
|
|
|
...
|
...
|
@@ -208,7 +220,7 @@ |
|
|
from storage_price
|
|
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0
|
|
|
<if test="secondType != null and secondType !=''">
|
|
|
and pre_sale_flag in (${secondType})
|
|
|
and pre_sale_flag in (${secondType}) and region=0
|
|
|
</if>
|
|
|
order by ${orderBy}
|
|
|
limit #{start},#{limit}
|
...
|
...
|
@@ -219,18 +231,18 @@ |
|
|
from storage_price
|
|
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0
|
|
|
<if test="secondType != null and secondType !=''">
|
|
|
and pre_sale_flag in (${secondType})
|
|
|
and pre_sale_flag in (${secondType}) and region=0
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSecondHandType" resultType="java.lang.Integer">
|
|
|
select distinct pre_sale_flag from storage_price
|
|
|
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
|
|
|
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
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSecondHandCount" resultType="java.lang.Integer">
|
|
|
select count(*) from storage_price
|
|
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0 and pre_sale_flag in (5,6)
|
|
|
where storage_id =#{storageId} and status in(1,100) and is_hide = 0 and pre_sale_flag in (5,6) and region=0
|
|
|
</select>
|
|
|
|
|
|
|
...
|
...
|
|