|
@@ -134,10 +134,12 @@
|
|
|
from repeat_purchase_price r
|
|
|
left join product p on p.productID = r.productId
|
|
|
left join cm_sku cs on r.skuId = cs.skuId
|
|
|
+ LEFT JOIN cm_organize_product_info copi ON copi.productId = p.productId
|
|
|
where r.skuId = #{skuId}
|
|
|
and cs.organizeId = 0
|
|
|
+ and copi.organizeId = 0
|
|
|
and userId = #{userId}
|
|
|
- and ((cs.costCheckFlag = 1 and r.currentPrice <![CDATA[ >= ]]> cs.costPrice) or cs.costCheckFlag = 2)
|
|
|
+ and ((copi.costCheckFlag = 1 and r.currentPrice <![CDATA[ >= ]]> cs.costPrice) or copi.costCheckFlag = 2)
|
|
|
and cs.price <![CDATA[ >= ]]> r.currentPrice
|
|
|
and r.delFlag = 0
|
|
|
</select>
|
|
@@ -210,7 +212,7 @@
|
|
|
normalPrice,
|
|
|
costPrice,
|
|
|
ifnull(ladderPriceFlag, 0) as ladderPriceFlag,
|
|
|
- costCheckFlag,
|
|
|
+ (SELECT costCheckFlag FROM cm_organize_product_info WHERE productId = cs.productId AND organizeId = cs.organizeId ) AS costCheckFlag,
|
|
|
shopPercent as costProportional,
|
|
|
ifnull(stock, 0) as stock,
|
|
|
unit,
|
|
@@ -268,7 +270,7 @@
|
|
|
<select id="findSkusOutOfPrice" resultType="com.caimei365.commodity.model.dto.Sku">
|
|
|
select skuId,
|
|
|
ifnull(ladderPriceFlag, 0) as ladderPriceFlag,
|
|
|
- costCheckFlag,
|
|
|
+ (SELECT costCheckFlag FROM cm_organize_product_info WHERE productId = cs.productId AND organizeId = cs.organizeId ) AS costCheckFlag,
|
|
|
shopPercent as costProportional,
|
|
|
ifnull(stock, 0) as stock,
|
|
|
unit,
|