package com.ghy.order.service;

import com.ghy.order.domain.OrderGoods;

import java.util.List;
import java.util.Map;

/**
 * 订单商品属性
 *
 * @author HH 2022/5/17
 */
public interface OrderGoodsService {

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

    List<OrderGoods> selectByOrderMasterId(Long orderMasterId);

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

    List<OrderGoods> selectByOrderDetailId(Long orderDetailId);

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

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

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

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

    /**
     * 根据订单id集合信息进行查询封装成为map数据，
     *
     * @param orderIdList 订单Id集合信息数据
     * @return 键值队列数据， key-> 订单Id value-> 订单实体集合信息
     */
    Map<Long, List<OrderGoods>> byOrderIdInMap(List<Long> orderIdList);

    int deleteByOrderDetailId(Long orderDetailId);
}
