package com.sckw.payment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.payment.model.KwpLedgerLogistics;
import com.sckw.payment.model.dto.LedgerCarrierDto;
import com.sckw.payment.model.dto.LedgerLogisticsDto;
import com.sckw.payment.model.dto.LedgerShipperDto;
import com.sckw.payment.model.vo.req.LogisticsReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author xucaiqin
 * @date 2023-07-17 15:34:39
 */

@Mapper
public interface KwpLedgerLogisticsMapper extends BaseMapper<KwpLedgerLogistics> {

    /**
     * 托运方
     *
     * @param logisticsReq
     * @return
     */
    List<LedgerShipperDto> shipperSelect(@Param("logisticsReq") LogisticsReq logisticsReq);

    /**
     * 承运方 对账发起方，客户公司是托运方
     *
     * @param logisticsReq
     * @return
     */
    List<LedgerCarrierDto> carrierSelect(@Param("logisticsReq") LogisticsReq logisticsReq);

    /**
     * 统计订单数量
     *
     * @param logisticsReq
     * @return
     */
    Map<String, Long> countOrder(@Param("logisticsReq") LogisticsReq logisticsReq);

    LedgerLogisticsDto selectId(@Param("id") Long id, @Param("unitType") Integer unitType);


    List<LedgerShipperDto> selectShipperIds(@Param("ids") List<Long> ids);

    /**
     * 承运方
     * 1托运方、2承运方
     *
     * @param ids
     * @return
     */
    List<LedgerCarrierDto> selectCarrierIds(@Param("ids") List<Long> ids);


}