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.KwfTruckDispatchCoefficientMapper;
import com.sckw.fleet.model.KwfTruckDispatchCoefficient;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Objects;

/**
 * @desc 司机行为规则 Repository接口
 * @author donglang
 * @date 2025-12-04
 */
@Repository
public class KwfTruckDispatchCoefficientRepository extends ServiceImpl<KwfTruckDispatchCoefficientMapper, KwfTruckDispatchCoefficient> {

    public KwfTruckDispatchCoefficient findAutoTruckDispatchByEntId(Long entId) {
        return getOne(Wrappers.<KwfTruckDispatchCoefficient>lambdaQuery()
                .eq(Objects.nonNull(entId), KwfTruckDispatchCoefficient::getEntId, entId));
    }


    public List<KwfTruckDispatchCoefficient> findAutoTruckDispatchByEntIds(List<Long> entIds) {
        return list(Wrappers.<KwfTruckDispatchCoefficient>lambdaQuery()
                .in(Objects.nonNull(entIds), KwfTruckDispatchCoefficient::getEntId, entIds));
    }

}
