package com.leromro.core.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leromro.core.domain.Address;
import com.leromro.core.mapper.AddressMapper;
import com.leromro.core.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 受服务地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-08
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService
{
    @Autowired
    private AddressMapper addressMapper;

    /**
     * 查询受服务地址
     * 
     * @param addressId 受服务地址主键
     * @return 受服务地址
     */
    @Override
    public Address selectLAddressByAddressId(Long addressId)
    {
        return addressMapper.selectLAddressByAddressId(addressId);
    }

    /**
     * @param userId 受服务地址
     * @return
     */
    @Override
    public List<Address> selectLAddressList(Long userId) {

        return addressMapper.selectByUserId(userId);
    }


    /**
     * 新增受服务地址
     * 
     * @param address 受服务地址
     * @return 结果
     */
    @Override
    public Boolean insertLAddress(Address address)
    {
        return this.save(address);
    }

    /**
     * 修改受服务地址
     * 
     * @param address 受服务地址
     * @return 结果
     */
    @Override
    public Boolean updateLAddress(Address address)
    {
        return this.updateById(address);
    }

    /**
     * 批量删除受服务地址
     * 
     * @param addressIds 需要删除的受服务地址主键
     * @return 结果
     */
    @Override
    public int deleteLAddressByAddressIds(Long[] addressIds)
    {
        return addressMapper.deleteLAddressByAddressIds(addressIds);
    }

    /**
     * 删除受服务地址信息
     * 
     * @param addressId 受服务地址主键
     * @return 结果
     */
    @Override
    public int deleteLAddressByAddressId(Long addressId)
    {
        return addressMapper.deleteLAddressByAddressId(addressId);
    }
}
