package com.bonus.zlpt.system.service.impl;

import com.bonus.zlpt.system.api.domain.BaseAddress;

import com.bonus.zlpt.system.mapper.BaseAddressMapper;
import com.bonus.zlpt.system.service.BaseAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class BaseAddressServiceImpl implements BaseAddressService {

    @Autowired
    private BaseAddressMapper baseAddressMapper;


    @Override
    public List<BaseAddress> selectAddress(BaseAddress baseAddress) {

        if (baseAddress == null || baseAddress.getCode() == null) {
            return baseAddressMapper.selectEconomizeAddress();
        }

        return baseAddressMapper.selectAddress(baseAddress);
    }
}
