package com.sckw.system.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.sckw.system.dao.ValidateLicensePlateMapper;
import com.sckw.system.model.ValidateLicensePlate;
import org.springframework.stereotype.Service;

/**
 * @Author: cxf
 * @CreateTime: 2026-01-21
 * @Description: 地磅过磅记录Service实现类
 * @Version: 1.0
 */
@Service
public class ValidateLicensePlateServiceImpl extends ServiceImpl<ValidateLicensePlateMapper, ValidateLicensePlate> implements ValidateLicensePlateService {

    @Override
    public ValidateLicensePlate queryByLicensePlate(String licensePlate, String uuid) {
        return getOne(Wrappers.<ValidateLicensePlate>lambdaQuery()
                .eq(ValidateLicensePlate::getLicensePlate, licensePlate)
                .eq(ValidateLicensePlate::getUuid, uuid)
                .eq(ValidateLicensePlate::getStatus, 0)
                .last("limit 1"));
    }

    @Override
    public ValidateLicensePlate queryByLicensePlate(String licensePlate) {
        return getOne(Wrappers.<ValidateLicensePlate>lambdaQuery()
                .eq(ValidateLicensePlate::getLicensePlate, licensePlate)
                .eq(ValidateLicensePlate::getStatus, 0)
                .last("limit 1"));
    }

}