package com.brilliance.isc.common.api.gid.service.impl;

import com.brilliance.isc.common.api.gid.service.GidService;
import com.brilliance.isc.mda.dao.GidMapper;
import com.brilliance.isc.mda.dao.NidMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Objects;

@Service
public class GidServiceImpl implements GidService {

    @Autowired
    private GidMapper gidMapper;

    @Autowired
    private NidMapper nidMapper;
    @Override
    public int updateFlwstaByObjinr(String objtyp, String inr) {
       if(Objects.equals(objtyp,"GID")){
           return gidMapper.updateFlwstaByinr("R",inr);
       }else if(Objects.equals(objtyp,"NID")){
            return nidMapper.updateFlwstaByinr("R",inr);
       }
       return 0;
    }
}
