package com.sckw.system.repository;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sckw.system.dao.KwsWeighbridgeDiffConfigDao;
import com.sckw.system.model.KwsWeighbridgeDiffConfig;
import org.springframework.stereotype.Repository;

/**
 * 地磅差异化配置仓储。
 */
@Repository
public class KwsWeighbridgeDiffConfigRepository extends ServiceImpl<KwsWeighbridgeDiffConfigDao, KwsWeighbridgeDiffConfig> {

    public KwsWeighbridgeDiffConfig findByEntId(Long entId) {
        return getOne(Wrappers.<KwsWeighbridgeDiffConfig>lambdaQuery()
                .eq(KwsWeighbridgeDiffConfig::getEntId, entId)
                .eq(KwsWeighbridgeDiffConfig::getDelFlag, 0)
                .last("limit 1"));
    }
}
