package com.ghy.order.mapper;

import com.ghy.order.domain.OrderGoods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单商品
 *
 * @author HH 2022/5/17
 */
public interface OrderGoodsMapper {

    /**
     * @param orderGoods 订单商品属性
     */
    int insertOrderGoods(OrderGoods orderGoods);

    /**
     * @param orderGoods 订单商品属性
     */
    int updateOrderGoods(OrderGoods orderGoods);

    /**
     * @param orderGoods 订单商品入参
     */
    List<OrderGoods> selectOrderGoodsList(OrderGoods orderGoods);

    /**
     * @param orderGoodsId 订单商品id
     * @return 订单商品
     */
    OrderGoods selectById(Long orderGoodsId);

    List<OrderGoods> selectByOrderId(@Param("orderId") Long orderId);

    /**
     * 根据主订单ID集合批量查询订单商品
     *
     * @param orderMasterIds 主订单ID集合
     * @return 订单商品集合
     */
    List<OrderGoods> selectByOrderMasterIds(@Param("orderMasterIds") List<Long> orderMasterIds);

    List<OrderGoods> selectByOrderDetailId(@Param("orderDetailId") Long orderDetailId);

    int deleteByOrderDetailId(@Param("orderDetailId") Long orderDetailId);

    /**
     * 批量删除订单商品信息
     *
     * @param orderGoodsIds 需要删除的数据ID
     */
    int deleteOrderGoodsByIds(Long[] orderGoodsIds);

    /**
     * 根据订单id集合信息进行批量数据查询
     *
     * @param orderIdList 订单Id集合信息。
     * @return OrderGoods实体集合信息。
     */
    List<OrderGoods> getByOrderIdList(@Param("orderIdList") List<Long> orderIdList);
}
