package com.ruoyi.model.service.impl;

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.AppPetsMapper;
import com.ruoyi.model.domain.AppPets;
import com.ruoyi.model.service.IAppPetsService;

/**
 * 宠物信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-08
 */
@Service
public class AppPetsServiceImpl implements IAppPetsService 
{
    @Autowired
    private AppPetsMapper appPetsMapper;

    /**
     * 查询宠物信息
     * 
     * @param petId 宠物信息主键
     * @return 宠物信息
     */
    @Override
    public AppPets selectAppPetsByPetId(Long petId)
    {
        return appPetsMapper.selectAppPetsByPetId(petId);
    }

    /**
     * 查询宠物信息列表
     * 
     * @param appPets 宠物信息
     * @return 宠物信息
     */
    @Override
    public List<AppPets> selectAppPetsList(AppPets appPets)
    {
        return appPetsMapper.selectAppPetsList(appPets);
    }

    /**
     * 新增宠物信息
     * 
     * @param appPets 宠物信息
     * @return 结果
     */
    @Override
    public int insertAppPets(AppPets appPets)
    {
        appPets.setCreateTime(DateUtils.getNowDate());
        return appPetsMapper.insertAppPets(appPets);
    }

    /**
     * 修改宠物信息
     * 
     * @param appPets 宠物信息
     * @return 结果
     */
    @Override
    public int updateAppPets(AppPets appPets)
    {
        appPets.setUpdateTime(DateUtils.getNowDate());
        return appPetsMapper.updateAppPets(appPets);
    }

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

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

    /**
     * 查询宠物信息列表
     *
     * @return 宠物信息集合
     */
    @Override
    public List<AppPets> getAppPetsList(){
        return appPetsMapper.getAppPetsList();
    }
}
