package com.ruoyi.model.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppletAddressMapper;
import com.ruoyi.model.domain.AppletAddress;
import com.ruoyi.model.service.IAppletAddressService;

/**
 * 地址信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class AppletAddressServiceImpl extends ServiceImpl<AppletAddressMapper, AppletAddress> implements IAppletAddressService
{
    @Autowired
    private AppletAddressMapper appletAddressMapper;

    /**
     * 查询地址信息
     * 
     * @param id 地址信息主键
     * @return 地址信息
     */
    @Override
    public AppletAddress selectAppletAddressById(Long id)
    {
        return appletAddressMapper.selectAppletAddressById(id);
    }

    /**
     * 查询地址信息列表
     * 
     * @param appletAddress 地址信息
     * @return 地址信息
     */
    @Override
    public List<AppletAddress> selectAppletAddressList(AppletAddress appletAddress)
    {
        return appletAddressMapper.selectAppletAddressList(appletAddress);
    }

    /**
     * 新增地址信息
     * 
     * @param appletAddress 地址信息
     * @return 结果
     */
    @Override
    public int insertAppletAddress(AppletAddress appletAddress)
    {
        appletAddress.setCreateTime(DateUtils.getNowDate());
        return appletAddressMapper.insertAppletAddress(appletAddress);
    }

    /**
     * 修改地址信息
     * 
     * @param appletAddress 地址信息
     * @return 结果
     */
    @Override
    public int updateAppletAddress(AppletAddress appletAddress)
    {
        appletAddress.setUpdateTime(DateUtils.getNowDate());
        return appletAddressMapper.updateAppletAddress(appletAddress);
    }

    /**
     * 批量删除地址信息
     * 
     * @param ids 需要删除的地址信息主键
     * @return 结果
     */
    @Override
    public int deleteAppletAddressByIds(Long[] ids)
    {
        return appletAddressMapper.deleteAppletAddressByIds(ids);
    }

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