package com.fdkankan.pay.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fdkankan.pay.entity.AutopayPlan;
import com.fdkankan.pay.entity.Order;
import com.fdkankan.pay.mapper.IAutopayPlanMapper;
import com.fdkankan.pay.service.IAutopayPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
*
* 服务实现类
*
*
* @author
* @since 2023-10-27
*/
@Service
public class AutopayPlanServiceImpl extends ServiceImpl implements IAutopayPlanService {
@Override
public AutopayPlan getByOrder(Order order) {
LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AutopayPlan::getServeId,order.getServeId());
wrapper.eq(AutopayPlan::getOrderType,order.getOrderType());
wrapper.eq(AutopayPlan::getPayType,order.getPayType());
wrapper.eq(AutopayPlan::getOrderMoney,order.getOrderMoney());
wrapper.eq(AutopayPlan::getAutoPayTime,order.getAutoPayTime());
return this.getOne(wrapper);
}
public getAutopayPlan(Order order, String productId,String planId) {
if(order != null){
this.serveId = order.getServeId();
this.orderType = order.getOrderType();
this.payType = order.getPayType();
this.orderMoney = order.getOrderMoney();
this.autoPayTime = order.getAutoPayTime();
}
this.productId = productId;
this.planId = planId;
}
}