package com.ruoyi.model.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppletPetMapper;
import com.ruoyi.model.domain.AppletPet;
import com.ruoyi.model.service.IAppletPetService;

/**
 * 宠物信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class AppletPetServiceImpl implements IAppletPetService 
{
    @Autowired
    private AppletPetMapper appletPetMapper;

    /**
     * 查询宠物信息
     * 
     * @param id 宠物信息主键
     * @return 宠物信息
     */
    @Override
    public AppletPet selectAppletPetById(Long id)
    {
        return appletPetMapper.selectAppletPetById(id);
    }

    /**
     * 查询宠物信息列表
     * 
     * @param appletPet 宠物信息
     * @return 宠物信息
     */
    @Override
    public List<AppletPet> selectAppletPetList(AppletPet appletPet)
    {
        return appletPetMapper.selectAppletPetList(appletPet);
    }

    @Override
    public List<AppletPet> selectAppletPetListByOrderId(Long orderId){
        return appletPetMapper.selectAppletPetListByOrderId(orderId);
    }
    /**
     * 新增宠物信息
     * 
     * @param appletPet 宠物信息
     * @return 结果
     */
    @Override
    public int insertAppletPet(AppletPet appletPet)
    {
//        appletPet.setCreateTime(new Date());
        return appletPetMapper.insertAppletPet(appletPet);
    }

    /**
     * 修改宠物信息
     * 
     * @param appletPet 宠物信息
     * @return 结果
     */
    @Override
    public int updateAppletPet(AppletPet appletPet)
    {
//        appletPet.setUpdateTime(new Date());
        return appletPetMapper.updateAppletPet(appletPet);
    }

    /**
     * 批量删除宠物信息
     * 
     * @param ids 需要删除的宠物信息主键
     * @return 结果
     */
    @Override
    public int deleteAppletPetByIds(Long[] ids)
    {
        return appletPetMapper.deleteAppletPetByIds(ids);
    }

    /**
     * 删除宠物信息信息
     * 
     * @param id 宠物信息主键
     * @return 结果
     */
    @Override
    public int deleteAppletPetById(Long id)
    {
        return appletPetMapper.deleteAppletPetById(id);
    }
}
