package com.sckw.contract.repository;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sckw.contract.dao.KwcContractLogisticsScoreMapper;
import com.sckw.contract.model.entity.KwcContractLogisticsScore;
import org.springframework.stereotype.Repository;

/**
 * @author :chenXiaoFei
 * @version :1.0
 * @description : 物流合同企业评分接口
 * @create :2025-11-06 10:24:00
 */
@Repository
public class KwcContractLogisticsScoreRepository extends ServiceImpl<KwcContractLogisticsScoreMapper, KwcContractLogisticsScore> {

    public KwcContractLogisticsScore findLogisticsScoreByEntId(Long proEntId, Long logEntId) {
        return getOne(Wrappers.<KwcContractLogisticsScore>lambdaQuery()
                .eq(KwcContractLogisticsScore::getProviderEntId, proEntId)
                .eq(KwcContractLogisticsScore::getLogisticsEntId, logEntId)
                .last("LIMIT 1"));
    }


}
