package com.ruoyi.ss.userAddress.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ss.userAddress.domain.UserAddress;
import com.ruoyi.ss.userAddress.mapper.UserAddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.userAddress.service.IUserAddressService;

/**
 * 用户地址Service业务层处理
 *
 * @author qzz
 * @date 2024-11-09
 */
@Service
public class UserAddressServiceImpl implements IUserAddressService
{
    @Autowired
    private UserAddressMapper eUserAddressMapper;

    /**
     * 查询用户地址
     *
     * @param id 用户地址主键
     * @return 用户地址
     */
    @Override
    public UserAddress selectEUserAddressById(Long id)
    {
        return eUserAddressMapper.selectEUserAddressById(id);
    }

    /**
     * 查询用户地址列表
     *
     * @param eUserAddress 用户地址
     * @return 用户地址
     */
    @Override
    public List<UserAddress> selectEUserAddressList(UserAddress eUserAddress)
    {
        return eUserAddressMapper.selectEUserAddressList(eUserAddress);
    }

    /**
     * 新增用户地址
     *
     * @param eUserAddress 用户地址
     * @return 结果
     */
    @Override
    public int insertEUserAddress(UserAddress eUserAddress)
    {
        eUserAddress.setCreateTime(DateUtils.getNowDate());
        return eUserAddressMapper.insertEUserAddress(eUserAddress);
    }

    /**
     * 修改用户地址
     *
     * @param eUserAddress 用户地址
     * @return 结果
     */
    @Override
    public int updateEUserAddress(UserAddress eUserAddress)
    {
        eUserAddress.setUpdateTime(DateUtils.getNowDate());
        return eUserAddressMapper.updateEUserAddress(eUserAddress);
    }

    /**
     * 批量删除用户地址
     *
     * @param ids 需要删除的用户地址主键
     * @return 结果
     */
    @Override
    public int deleteEUserAddressByIds(Long[] ids)
    {
        return eUserAddressMapper.deleteEUserAddressByIds(ids);
    }

    /**
     * 删除用户地址信息
     *
     * @param id 用户地址主键
     * @return 结果
     */
    @Override
    public int deleteEUserAddressById(Long id)
    {
        return eUserAddressMapper.deleteEUserAddressById(id);
    }
}
