package com.sckw.usual.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.usual.entity.KwOrder;
import com.sckw.usual.entity.LogisticsCountVo;
import com.sckw.usual.entity.req.OrderListParam;
import com.sckw.usual.entity.res.KwOrderRes;
import com.sckw.usual.entity.res.KwOrderDetailRes;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @desc:
 * @author: lt
 * @date: 2024/3/28 10:11
 */
@Mapper
public interface OrderGeneralTransportMapper extends BaseMapper<KwOrder> {

    List<KwOrderRes> orderList(@Param("orderListParam") OrderListParam orderListParam);

    KwOrderDetailRes orderDetailbyId(@Param("orderId") String orderId);

    List<KwOrder> findLogisticsOrder(Map params);

    LogisticsCountVo findLogisticsOrderCount(Map<String, Object> params);

    List<Map<String, Object>> countByStatus();

    @MapKey("waybillCount")
    int finishWaybillCount(String orderId);

    @MapKey("loadAmount")
    BigDecimal finishOrderSum(String orderId);
}
