@@ -203,6 +203,7 @@ public interface ProductDao extends CrudDao<Product> {
void deleteSkus(Integer productID);
List<CmSku> findSkuList(Integer productID);
+ List<CmSku> findSkuListProduct(Integer productID);
List<CmLadderPrice> findLadderPriceBySku(Integer skuId);
@@ -672,7 +672,7 @@ public class ProductService extends CrudService<ProductDao, Product> {
}
public List<CmSku> findSkuList(Integer productID) {
- List<CmSku> skus = productDao.findSkuList(productID);
+ List<CmSku> skus = productDao.findSkuListProduct(productID);
skus.forEach(s -> {
s.ladderPriceList(productDao.findLadderPriceBySku(s.skuId()));
});
@@ -2041,6 +2041,25 @@
left join cm_svip_product_sku csps on cs.skuId = csps.skuId
where cs.productId = #{productID}
</select>
+ <select id="findSkuListProduct" resultType="com.caimei.modules.product.entity.CmSku">
+ select cs.skuId,
+ cs.productId,
+ unit,
+ normalPrice,
+ stock,
+ costCheckFlag,
+ costProportional,
+ costPrice,
+ price,
+ ladderPriceFlag,
+ minBuyNumber,
+ csps.discount,
+ csps.discountPrice,
+ csps.priceType
+ from cm_sku cs
+ left join cm_svip_product_sku csps on cs.skuId = csps.skuId
+ where cs.productId = #{productID}
+ </select>
<select id="findLadderPriceBySku" resultType="com.caimei.modules.product.entity.CmLadderPrice">
select skuId, productId, userType, ladderNum, buyNum, buyPrice, delFlag
FROM product_ladder_price