package com.ruoyi.dk.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.dk.domain.BorrowStatus;
import com.ruoyi.dk.mapper.BorrowStatusMapper;
import com.ruoyi.dk.service.BorrowStatusService;
import org.springframework.stereotype.Service;

@Service
public class BorrowStatusServiceImpl extends ServiceImpl<BorrowStatusMapper, BorrowStatus> implements BorrowStatusService {
    @Override
    public BorrowStatus getByCode(String borrowStatusCode) {
        return this.getOne(Wrappers.lambdaQuery(BorrowStatus.class).eq(BorrowStatus::getBorrowCode, borrowStatusCode)
                .last("limit 1"));
    }
}
