package com.sckw.transport.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.transport.api.model.dto.vo.LogisticsOrderDTO;
import com.sckw.transport.api.model.dto.vo.LogisticsOrderVO;
import com.sckw.transport.model.KwtLogisticsOrder;
import com.sckw.transport.model.param.DriverParam;
import com.sckw.transport.model.param.LogisticsOrderParam;
import com.sckw.transport.model.vo.DriverListVo;
import com.sckw.transport.model.vo.OrderFinishVO;
import com.sckw.transport.model.vo.SubcontractConsignmentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface KwtLogisticsOrderMapper extends BaseMapper<KwtLogisticsOrder> {
    /**
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Long id);

    int insert(KwtLogisticsOrder record);

    int insertSelective(KwtLogisticsOrder record);

    KwtLogisticsOrder selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(KwtLogisticsOrder record);

    int updateByPrimaryKey(KwtLogisticsOrder record);

    void removeById(KwtLogisticsOrder logisticsOrder);

    /**
     * 查询物流订单数据
     *
     * @param logisticsOrderParam 查询参数
     * @param dictId              字典id
     * @return
     */
    List<LogisticsOrderDTO> selectLogisticOrderData(@Param("logisticsOrderParam") LogisticsOrderParam logisticsOrderParam, @Param("dictId") Long dictId);


    /**
     * 销售订单-采购订单-托运详情
     *
     * @param id
     * @return
     */
    List<com.sckw.transport.model.dto.LogisticsOrderDTO> selectOrderList(@Param("id") String id,@Param("page") int page,@Param("pageSize") int pageSize);

    /**
     *
     * @param id
     * @return
     */
    Long selectOrderCount(@Param("id") String id);

    /**
     * @param logisticsOrderParam
     * @param dictId
     * @return
     */
    Long selectLogisticOrderCount(@Param("logisticsOrderParam") LogisticsOrderParam logisticsOrderParam, @Param("dictId") Long dictId);

    Map<String, String> getRejectReason(@Param("id") String id,@Param("status") String status);

    /**
     * 根据承运订单id查看分包数据列表
     * @param lOrderId
     * @param page
     * @param pageSize
     * @return
     */
    List<SubcontractConsignmentVO> getSubcontractConsignment(@Param("lOrderId") String lOrderId, @Param("page") Integer page, @Param("pageSize") Integer pageSize);

    List<Map> countSubcontractConsignmentById(@Param("lOrderId") String lOrderId);

    /**
     * 通过物流订单查看单据下运力司机数据
     * @param driverParam
     * @return
     */
    List<DriverListVo> selectDriverListById(@Param("driverParam") DriverParam driverParam);

    /**
     *
     * @param ids
     * @return
     */
    List<LogisticsOrderVO> selectLogisticOrderList(@Param("ids") List<String> ids);

    /**
     * 通过物流订单id获取统计数据
     * @param orderId
     * @return
     */
    OrderFinishVO selectOrderFinishData(@Param("orderId") String orderId);
}