package com.yc.ship.module.trade.dal.mysql.order;


import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.module.trade.dal.dataobject.order.TradeOrderDispatchDO;
import com.yc.ship.module.trade.dal.dataobject.order.TradeOrderDispatchProductDO;
import com.yc.ship.module.trade.service.order.bo.TradeDispatchRefundBO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * 交易订单计调表 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface TradeOrderDispatchMapper extends BaseMapperX<TradeOrderDispatchDO> {

    List<TradeOrderDispatchProductDO> selectDispatchProductFromOrder(@Param("orderId") Long orderId, @Param("projectCodeList") List<String> projectCodeList);

    List<TradeOrderDispatchDO> selectDispatchFromOrder(@Param("orderId") Long orderId);

    Map<String, Long> selectDispatchCount(@Param("orderId") Long orderId);

    Map<String, Object> getDispatchDetail(@Param("dispatchId") String dispatchId);

    List<TradeDispatchRefundBO> selectDispatchDetailByRefund(@Param("refundId") Long refundId);

    List<TradeOrderDispatchDO> selectDispatchListByOrderId(@Param("orderId") Long orderId);

    List<Long> selectOrderIdListByDispatchId(@Param("dispatchId") String dispatchId, @Param("projectCode") String projectCode);

    List<Map<String, Object>> selectOrderDispatchStatus(@Param("orderIdList") Collection<Long> orderIdList);


    List<Long> selectDispatchProductBaseIdList(@Param("dispatchId") String dispatchId);

    void delOrderDispatch(@Param("dispatchId") String dispatchId, @Param("projectCode") String projectCode);
}