package com.sckw.fleet.repository;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sckw.core.model.base.BaseModel;
import com.sckw.fleet.dao.KwfDriverScoreMapper;
import com.sckw.fleet.model.KwfDriverScore;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;


/**
 * @author PC
 * 司机评分
 */
@Repository
public class KwfDriverScoreRepository extends ServiceImpl<KwfDriverScoreMapper, KwfDriverScore> {

    public KwfDriverScore findDriverScoreByEntIds(Long proEntId, Long logEntId, Long driverId) {
        return getOne(Wrappers.<KwfDriverScore>lambdaQuery()
                .eq(KwfDriverScore::getDelFlag,0)
                .eq(KwfDriverScore::getProviderEntId,proEntId)
                .eq(KwfDriverScore::getLogisticsEntId,logEntId)
                .eq(KwfDriverScore::getDriverId,driverId)
                .last("limit 1"));
    }

}
