...
|
...
|
@@ -109,7 +109,7 @@ |
|
|
<select id="selectLeastPricesByProductId" resultMap="BaseResultMap">
|
|
|
select * from (
|
|
|
select id, skup, storage_id, price, status, pre_sale_flag, region
|
|
|
from storage_price
|
|
|
from storage_price force index (`idx_storage_id_price`)
|
|
|
where status = 1 and product_id = #{productId} and is_hide = 0
|
|
|
order by storage_id,price asc limit 1000000
|
|
|
) a group by storage_id, pre_sale_flag, region
|
...
|
...
|
@@ -272,11 +272,12 @@ |
|
|
</update>
|
|
|
|
|
|
<select id="selectInStockLeastPByProductId" resultMap="BaseResultMap">
|
|
|
select * from (
|
|
|
select id, skup, storage_id, price, status, pre_sale_flag, region
|
|
|
from storage_price
|
|
|
select t.id as id, t.skup as skup, t.storage_id as storage_id, t.price as price, t.status as status, t.pre_sale_flag as pre_sale_flag, t.region as region from storage_price t,
|
|
|
(select id from (select id ,storage_id
|
|
|
from storage_price FORCE INDEX (`idx_storage_id_price`)
|
|
|
where status = 1 and product_id = #{productId} and is_hide = 0 and region = 0 and pre_sale_flag = 0
|
|
|
order by storage_id,price asc limit 1000000
|
|
|
) a group by storage_id
|
|
|
order by storage_id,price asc limit 100000 )a
|
|
|
group by storage_id) b
|
|
|
where t.id = b.id
|
|
|
</select>
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|