package com.ruoyi.mall.service;

import java.util.List;
import com.ruoyi.mall.domain.MallOrderGoods;
import com.ruoyi.mall.domain.vo.MallOrderGoodsVO;
import org.apache.ibatis.annotations.Param;

/**
 * 订单商品Service接口
 *
 * @author chang
 * @date 2021-11-25
 */
public interface IMallOrderGoodsService
{
    /**
     * 查询订单商品
     *
     * @param id 订单商品主键
     * @return 订单商品
     */
    public MallOrderGoods selectMallOrderGoodsById(Long id);

    /**
     * 查询订单商品列表
     *
     * @param mallOrderGoods 订单商品
     * @return 订单商品集合
     */
    public List<MallOrderGoods> selectMallOrderGoodsList(MallOrderGoods mallOrderGoods);

    /**
     * 订单商品客户购买数量统计
     *
     * @param mallOrderGoods 订单商品
     * @return 订单商品集合
     */
    public List<MallOrderGoods> selectMallOrderGoodsTotal(MallOrderGoods mallOrderGoods);

    /**
     * 新增订单商品
     *
     * @param mallOrderGoods 订单商品
     * @return 结果
     */
    public int insertMallOrderGoods(MallOrderGoods mallOrderGoods);

    /**
     * 修改订单商品
     *
     * @param mallOrderGoods 订单商品
     * @return 结果
     */
    public int updateMallOrderGoods(MallOrderGoods mallOrderGoods);

    /**
     * 批量删除订单商品
     *
     * @param ids 需要删除的订单商品主键集合
     * @return 结果
     */
    public int deleteMallOrderGoodsByIds(Long[] ids);

    /**
     * 删除订单商品信息
     *
     * @param id 订单商品主键
     * @return 结果
     */
    public int deleteMallOrderGoodsById(Long id);


    public List<MallOrderGoodsVO> selectMallOrderGoodsByOrderId(Long id);

    /**
     * 查询订单商品列表
     *
     * @param mallOrderGoods 订单商品
     * @return 订单商品集合
     */
    public List<MallOrderGoods> getOrderBackList(MallOrderGoods mallOrderGoods);

    /**
     * 更改订单商品退货状态
     *
     * @param orderId 订单ID
     * @param returnStatus 退货状态：0-未退货，1-退货中，2-已退货，3-已拒绝，4-取消退货
     * @return 结果
     */
    public int updateMallOrderGoodsReturnStatus(@Param("orderId") Long orderId, @Param("returnStatus") String returnStatus);

    public int updateMallOrderGoodsByOrderIdAndGoodsId(Long orderId,Long goodsId,String returnStatus,String returnTotal,String returnableQuantity);

    MallOrderGoodsVO selectMallOrderGoodsByOrderIdAndGoodsId(@Param("orderId") Long orderId,@Param("goodsId") Long goodsId);
}
