package com.jkcredit.invoice.service.selfCar.impl;

import com.jkcredit.invoice.mapper.customer.CustomerCarRecMapper;
import com.jkcredit.invoice.model.entity.customer.CustomerCarRec;
import com.jkcredit.invoice.service.lowerService.CustomeLowerService;
import com.jkcredit.invoice.service.lowerService.SelfCarServiceL;
import com.jkcredit.invoice.service.selfCar.SelfCarService;
import com.jkcredit.invoice.util.RespR;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service
public class SelfCarServiceImpl implements SelfCarService{
    @Autowired
    SelfCarServiceL selfCarService;
    @Autowired
    CustomerCarRecMapper customerCarRecMapper;
    @Override
    public RespR selfCarUnBind(String cardId) {
        CustomerCarRec customerCarRec = customerCarRecMapper.selectByETC(cardId);
        if(customerCarRec.getRecStatus()!=1){
            return new RespR(false,"无需解绑");
        }
        List<CustomerCarRec> customerCarRecs = new ArrayList<>();
        customerCarRecs.add(customerCarRec);
        return  selfCarService.customerCarUnRec(customerCarRecs);
    }
}
