package com.sckw.transport.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.transport.model.KwtLogisticsOrderAddress;
import com.sckw.transport.model.KwtLogisticsOrderAmount;
import com.sckw.transport.model.vo.LogisticsOrderCancelAmountVo;
import com.sckw.transport.model.vo.LogisticsOrderFinishAmountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zk
 * @desc 物流订单-装卸货地址运量信息
 * @date 2024/3/1 0001
 */
@Mapper
public interface KwtLogisticsOrderAmountMapper extends BaseMapper<KwtLogisticsOrderAmount> {

    List<KwtLogisticsOrderAmount> findByAddress(KwtLogisticsOrderAddress params);

    KwtLogisticsOrderAmount findByLAddressId(@Param("lAddressId") Long lAddressId);

    List<KwtLogisticsOrderAmount> findByLOrderId(@Param("lOrderId") Long lOrderId);

    /**
     * 订单完结统计装货量卸货量
     * @param id
     * @param addressType
     * @return
     */
    List<LogisticsOrderFinishAmountVo> countAddressAmount(@Param("id") Long id,@Param("addressType") Integer addressType);


    /**
     * 查询订单本身的量
     * @param id
     * @param addressType
     * @return
     */
    List<LogisticsOrderCancelAmountVo> cancelOrderToAmountByOrderId(@Param("orderId") Long id, @Param("addressType") Integer addressType);
}
