|
@@ -21,12 +21,16 @@
|
|
|
p.includedTax,
|
|
|
p.invoiceType,
|
|
|
if(csp.id is not null, 1, 0) as svipProductFlag,
|
|
|
- csp.priceType as svipPriceType,
|
|
|
- csp.discount as svipDiscount,
|
|
|
- csp.discountPrice as svipDiscountPrice,
|
|
|
+ ccs.priceType as svipPriceType,
|
|
|
+ ccs.discount as svipDiscount,
|
|
|
+ ccs.discountPrice as svipDiscountPrice,
|
|
|
p.productType
|
|
|
from product p
|
|
|
left join cm_svip_product csp on p.productID = csp.productId
|
|
|
+ left join (select priceType,discount,discountPrice,csps.productId from cm_svip_product_sku csps
|
|
|
+ left join cm_sku cs on csps.skuId=cs.skuId
|
|
|
+ where csps.productId=#{productId}
|
|
|
+ order by cs.price asc limit 1) ccs on ccs.productId=p.productId
|
|
|
where p.productID = #{productId}
|
|
|
</select>
|
|
|
<select id="getListPriceByProductIds" resultType="com.caimei365.commodity.model.vo.PriceVo">
|
|
@@ -40,9 +44,18 @@
|
|
|
p.invoiceType,
|
|
|
p.taxPoint as taxRate,
|
|
|
if(csp.id is not null,1,0) as svipProductFlag,
|
|
|
- csp.priceType as svipPriceType,
|
|
|
- csp.discount as svipDiscount,
|
|
|
- csp.discountPrice as svipDiscountPrice,
|
|
|
+ (select priceType from cm_svip_product_sku csps
|
|
|
+ left join cm_sku cs on csps.skuId=cs.skuId
|
|
|
+ where csps.productId=p.productID
|
|
|
+ order by cs.price asc limit 1) as svipPriceType,
|
|
|
+ (select discount from cm_svip_product_sku csps
|
|
|
+ left join cm_sku cs on csps.skuId=cs.skuId
|
|
|
+ where csps.productId=p.productID
|
|
|
+ order by cs.price asc limit 1) as svipDiscount,
|
|
|
+ (select discountPrice from cm_svip_product_sku csps
|
|
|
+ left join cm_sku cs on csps.skuId=cs.skuId
|
|
|
+ where csps.productId=p.productID
|
|
|
+ order by cs.price asc limit 1) as svipDiscountPrice,
|
|
|
p.productType,
|
|
|
p.newvalidFlag
|
|
|
from product p
|
|
@@ -235,4 +248,9 @@
|
|
|
ORDER BY price ASC
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
+ <select id="getVipSku" resultType="com.caimei365.commodity.model.dto.VipSkuPriceDto">
|
|
|
+ select priceType,discountPrice,discount,productId,skuId
|
|
|
+ from cm_svip_product_sku
|
|
|
+ where skuId = #{skuId}
|
|
|
+ </select>
|
|
|
</mapper>
|