package com.sckw.fleet.repository;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sckw.fleet.dao.KwfDriverAssociatedTruckMapper;
import com.sckw.fleet.model.KwfDriverAssociatedTruck;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @author PC
 * 车辆轴数接口
 */
@Repository
public class KwfDriverAssociatedTruckRepository extends ServiceImpl<KwfDriverAssociatedTruckMapper, KwfDriverAssociatedTruck> {

    public List<KwfDriverAssociatedTruck> queryByEntIdAndDriverId(Long entId, Long driverId) {
        return list(Wrappers.<KwfDriverAssociatedTruck>lambdaQuery()
                .eq(KwfDriverAssociatedTruck::getEntId, entId)
                .eq(KwfDriverAssociatedTruck::getDriverId, driverId)
                .eq(KwfDriverAssociatedTruck::getDelFlag, 0)
                .orderByDesc(KwfDriverAssociatedTruck::getCreateTime));

    }

}
