|
@@ -1215,8 +1215,9 @@
|
|
|
select productId
|
|
|
from cm_sku cs
|
|
|
where skuId = #{productId}
|
|
|
- #暂时写死0
|
|
|
- and cs.organizeId = 0 limit 1
|
|
|
+ #暂时写死0
|
|
|
+ and cs.organizeId = 0
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="toAddProductList" resultType="product">
|
|
@@ -2019,7 +2020,8 @@
|
|
|
stock,
|
|
|
(select costCheckFlag
|
|
|
from cm_organize_product_info
|
|
|
- where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ where productId = cs.productId
|
|
|
+ and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
shopPercent,
|
|
|
costPrice,
|
|
|
price,
|
|
@@ -2050,7 +2052,8 @@
|
|
|
stock,
|
|
|
(select costCheckFlag
|
|
|
from cm_organize_product_info
|
|
|
- where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ where productId = cs.productId
|
|
|
+ and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
shopPercent,
|
|
|
organizePercent,
|
|
|
cmPercent,
|
|
@@ -2078,8 +2081,9 @@
|
|
|
cs.stock,
|
|
|
(select costCheckFlag
|
|
|
from cm_organize_product_info
|
|
|
- where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
- cs.shopPercent as shopPercent,
|
|
|
+ where productId = cs.productId
|
|
|
+ and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ cs.shopPercent as shopPercent,
|
|
|
cs.costPrice,
|
|
|
cs.organizeCostPrice,
|
|
|
cs.cmCostPrice,
|
|
@@ -2133,11 +2137,12 @@
|
|
|
cs.stock,
|
|
|
(select costCheckFlag
|
|
|
from cm_organize_product_info
|
|
|
- where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ where productId = cs.productId
|
|
|
+ and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
cs.costPrice,
|
|
|
- ifnull(cs.shopPercent, 0) as shopPercent,
|
|
|
- ifnull(cs.organizePercent, 0) as organizePercent,
|
|
|
- ifnull(cs.cmPercent, 0) as cmPercent,
|
|
|
+ ifnull(cs.shopPercent, 0) as shopPercent,
|
|
|
+ ifnull(cs.organizePercent, 0) as organizePercent,
|
|
|
+ ifnull(cs.cmPercent, 0) as cmPercent,
|
|
|
chs.price
|
|
|
from cm_sku cs
|
|
|
left join cm_hehe_sku chs on cs.skuId = chs.skuId
|
|
@@ -2151,10 +2156,11 @@
|
|
|
</select>
|
|
|
<select id="findSku" resultType="com.caimei.modules.product.entity.CmSku">
|
|
|
select cs.price,
|
|
|
- ifnull(cs.costPrice, 0) as costPrice,
|
|
|
+ ifnull(cs.costPrice, 0) as costPrice,
|
|
|
(select costCheckFlag
|
|
|
from cm_organize_product_info
|
|
|
- where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ where productId = cs.productId
|
|
|
+ and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
cs.shopPercent,
|
|
|
cs.normalPrice
|
|
|
from cm_sku cs
|
|
@@ -2168,8 +2174,9 @@
|
|
|
ifnull(cs.costPrice, 0),
|
|
|
(select costCheckFlag
|
|
|
from cm_organize_product_info
|
|
|
- where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
- cs.shopPercent AS shopPercent,
|
|
|
+ where productId = cs.productId
|
|
|
+ and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ cs.shopPercent AS shopPercent,
|
|
|
cs.normalPrice,
|
|
|
cs.organizeId
|
|
|
FROM cm_sku cs
|
|
@@ -2184,7 +2191,8 @@
|
|
|
cs.costPrice,
|
|
|
(select costCheckFlag
|
|
|
from cm_organize_product_info
|
|
|
- where productId = cs.productId and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
+ where productId = cs.productId
|
|
|
+ and organizeId = cs.organizeId) as costCheckFlag,
|
|
|
cs.shopPercent,
|
|
|
cs.unit,
|
|
|
cs.organizeId
|
|
@@ -2220,4 +2228,10 @@
|
|
|
WHERE promotionsId = #{id}
|
|
|
and cs.organizeId = (SELECT SUBSTRING(groundMall, 1, 1) FROM product WHERE productID = cs.productId)
|
|
|
</select>
|
|
|
+ <select id="getTouchPriceByPromotions" resultType="java.lang.Double">
|
|
|
+ select touchPrice
|
|
|
+ from cm_promotion_sku
|
|
|
+ where skuId = #{skuId}
|
|
|
+ and promotionId = #{promotionsId}
|
|
|
+ </select>
|
|
|
</mapper>
|