package com.trade.service.tradingplatform.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.trade.service.tradingplatform.mapper.TradingPlatformQualificationMapper;
import com.trade.service.tradingplatform.domain.TradingPlatformQualification;
import com.trade.service.tradingplatform.service.TradingPlatformQualificationBaseService;
import org.springframework.stereotype.Service;

/**
 * 贸易平台资质基础服务实现类
 *
 * @author hlb
 * @since 2024-06-05 17:00:04
 */
@Service("tradingPlatformQualificationBaseService")
public class TradingPlatformQualificationBaseServiceImpl extends ServiceImpl<TradingPlatformQualificationMapper, TradingPlatformQualification> implements TradingPlatformQualificationBaseService {
    @Override
    public TradingPlatformQualification findByPlatformId(Long platformId) {
        return this.lambdaQuery()
                .eq(TradingPlatformQualification::getPlatformId, platformId)
                .orderByDesc(TradingPlatformQualification::getGmtModified)
                .last("limit 1")
                .one();
    }
}

