浏览代码

fix 店铺最低价格

zoujiajian 2 年之前
父节点
当前提交
df0210d683
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopGoodsSkuMapper.java

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/mapper/shop/YhShopGoodsSkuMapper.java

@@ -23,7 +23,7 @@ public interface YhShopGoodsSkuMapper extends BaseMapper<YhShopGoodsSku> {
 	@Update("update yh_shop_goods_sku set status = 0 where sku_id = #{skuId} and price not between #{minPrice} and #{maxPrice}")
 	Integer setBelowPriceShopSkuDown(@Param("skuId") Long skuId, @Param("minPrice") BigDecimal minPrice, @Param("maxPrice") BigDecimal maxPrice);
 
-	@Select("select sku_id,price from yh_shop_goods_sku where yhs_id = #{yhsId} and goods_id = #{goodsId} and deleted is true and status is true order by price limit 1")
+	@Select("select sku_id,price from yh_shop_goods_sku ys where yhs_id = #{yhsId} and goods_id = #{goodsId} and deleted is true and status is true and exists(select 1 from goods_don_sku sku where sku.id = ys.sku_id and sku.status is true) order by price limit 1")
 	YhShopGoodsSku selectMinPriceSkuByYhsId(@Param("yhsId") Long yhsId, @Param("goodsId") Long goodsId);
 
 	@Select("select * from yh_shop_goods_sku where sku_id = #{skuId} and price not between #{minPrice} and #{maxPrice} and status = 1")