package com.seer.teach.pay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.seer.teach.pay.entity.PayOrderExtensionEntity;
import com.seer.teach.pay.mapper.PayOrderExtensionMapper;
import com.seer.teach.pay.service.IPayOrderExtensionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * <p>
 * 支付订单 服务实现类
 * </p>
 *
 * @author Wang
 * @since 2025-09-11 14:04:02
 */
@Service
public class PayOrderExtensionServiceImpl extends ServiceImpl<PayOrderExtensionMapper, PayOrderExtensionEntity> implements IPayOrderExtensionService {

    @Override
    public Optional<PayOrderExtensionEntity> getOneByOrderId(Integer orderId) {
        PayOrderExtensionEntity entity = super.getOne(new LambdaQueryWrapper<>(PayOrderExtensionEntity.class).eq(PayOrderExtensionEntity::getOrderId, orderId));
        return Optional.ofNullable(entity);
    }
}
