package com.sckw.transport.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sckw.mongo.model.TableTops;
import com.sckw.transport.model.KwtWaybillOrder;
import com.sckw.transport.model.dto.OrderCarDTO;
import com.sckw.transport.model.dto.WayBillDetailDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface KwtWaybillOrderMapper extends BaseMapper<KwtWaybillOrder> {
    int deleteByPrimaryKey(Long id);

    int insert(KwtWaybillOrder record);

    int insertSelective(KwtWaybillOrder record);

    KwtWaybillOrder selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(KwtWaybillOrder record);

    int updateByPrimaryKey(KwtWaybillOrder record);

    List<OrderCarDTO> selectWaybillOrderCarList(@Param("id") String id, @Param("page") int page, @Param("pageSize") int pageSize);

    Long selectWaybillOrderCarCount(@Param("id") String id);

    /**
     * 根据司机id+定义状态统计
     *
     * @param id
     * @param status
     * @return
     */
    TableTops statistics(@Param("id") Long id, @Param("status") List<Long> status);

    /**
     * 根据司机id+运单状态获取物流订单id
     *
     * @param id
     * @param status
     * @return
     */
    List<Long> selectDriverOrder(@Param("id") Long id, @Param("status") List<Long> status);

    /**
     * 根基运单ID查询关联数据
     *
     * @param id
     * @return
     */
    WayBillDetailDTO selectWaybillRelate(@Param("id") Long id);

    /**
     * 通过物流订单id+车辆运单状态查询是否存在处理中的数据
     *
     * @param id
     * @param statusList
     * @return
     */
    int selectDataByLorderId(@Param("id") String id, @Param("statusList") List<Integer> statusList);
}