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.AppletPetTypeMapper;
import com.ruoyi.model.domain.AppletPetType;
import com.ruoyi.model.service.IAppletPetTypeService;

/**
 * 个人宠物类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class AppletPetTypeServiceImpl implements IAppletPetTypeService 
{
    @Autowired
    private AppletPetTypeMapper appletPetTypeMapper;

    /**
     * 查询个人宠物类型
     * 
     * @param id 个人宠物类型主键
     * @return 个人宠物类型
     */
    @Override
    public AppletPetType selectAppletPetTypeById(Long id)
    {
        return appletPetTypeMapper.selectAppletPetTypeById(id);
    }

    /**
     * 查询个人宠物类型列表
     * 
     * @param appletPetType 个人宠物类型
     * @return 个人宠物类型
     */
    @Override
    public List<AppletPetType> selectAppletPetTypeList(AppletPetType appletPetType)
    {
        return appletPetTypeMapper.selectAppletPetTypeList(appletPetType);
    }

    /**
     * 新增个人宠物类型
     * 
     * @param appletPetType 个人宠物类型
     * @return 结果
     */
    @Override
    public int insertAppletPetType(AppletPetType appletPetType)
    {
        appletPetType.setCreateTime(DateUtils.getNowDate());
        return appletPetTypeMapper.insertAppletPetType(appletPetType);
    }

    /**
     * 修改个人宠物类型
     * 
     * @param appletPetType 个人宠物类型
     * @return 结果
     */
    @Override
    public int updateAppletPetType(AppletPetType appletPetType)
    {
        appletPetType.setUpdateTime(DateUtils.getNowDate());
        return appletPetTypeMapper.updateAppletPetType(appletPetType);
    }

    /**
     * 批量删除个人宠物类型
     * 
     * @param ids 需要删除的个人宠物类型主键
     * @return 结果
     */
    @Override
    public int deleteAppletPetTypeByIds(Long[] ids)
    {
        return appletPetTypeMapper.deleteAppletPetTypeByIds(ids);
    }

    /**
     * 删除个人宠物类型信息
     * 
     * @param id 个人宠物类型主键
     * @return 结果
     */
    @Override
    public int deleteAppletPetTypeById(Long id)
    {
        return appletPetTypeMapper.deleteAppletPetTypeById(id);
    }
}
