ImsEweiShopGoodsMapper.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package zs.payment.mapper.primary;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import org.apache.ibatis.annotations.Mapper;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.apache.ibatis.annotations.Select;
  6. import zs.payment.entity.mysql.ImsEweiShopGoods;
  7. import zs.payment.req.order.AddressInfo;
  8. import zs.payment.req.order.SpuItem;
  9. import java.util.List;
  10. @Mapper
  11. public interface ImsEweiShopGoodsMapper extends BaseMapper<ImsEweiShopGoods> {
  12. /**
  13. * 根据订单编号查询下单的商品
  14. * @param ordersn
  15. * @return
  16. */
  17. List<SpuItem> findSpuByOrdersn(@Param("ordersn") String ordersn);
  18. /**
  19. * 根据订单编号查询下单地址
  20. * @param ordersn
  21. * @return
  22. */
  23. AddressInfo findAddressByOrdersn(@Param("ordersn")String ordersn);
  24. /**
  25. * 多规格商品:从option子查询更新goods的价格字段
  26. */
  27. void updateGoodsPriceByOption(@Param("goodsId") Long goodsId);
  28. /**
  29. * 检查商品是否存在订单记录
  30. * @param goodsId 商品ID
  31. * @return true-存在订单,false-不存在订单
  32. */
  33. @Select("SELECT COUNT(1) > 0 FROM ims_ewei_shop_order_goods WHERE goodsid = #{goodsId}")
  34. boolean existsOrderByGoodsId(@Param("goodsId") Long goodsId);
  35. }