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.PetTypeMapper;
import com.ruoyi.model.domain.PetType;
import com.ruoyi.model.service.IPetTypeService;

/**
 * 宠物类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-05
 */
@Service
public class PetTypeServiceImpl implements IPetTypeService 
{
    @Autowired
    private PetTypeMapper petTypeMapper;

    /**
     * 查询宠物类型
     * 
     * @param petTypeId 宠物类型主键
     * @return 宠物类型
     */
    @Override
    public PetType selectPetTypeByPetTypeId(Long petTypeId)
    {
        return petTypeMapper.selectPetTypeByPetTypeId(petTypeId);
    }

    /**
     * 查询宠物类型列表
     * 
     * @param petType 宠物类型
     * @return 宠物类型
     */
    @Override
    public List<PetType> selectPetTypeList(PetType petType)
    {
        return petTypeMapper.selectPetTypeList(petType);
    }

    /**
     * 新增宠物类型
     * 
     * @param petType 宠物类型
     * @return 结果
     */
    @Override
    public int insertPetType(PetType petType)
    {
        petType.setCreateTime(DateUtils.getNowDate());
        return petTypeMapper.insertPetType(petType);
    }

    /**
     * 修改宠物类型
     * 
     * @param petType 宠物类型
     * @return 结果
     */
    @Override
    public int updatePetType(PetType petType)
    {
        petType.setUpdateTime(DateUtils.getNowDate());
        return petTypeMapper.updatePetType(petType);
    }

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

    /**
     * 删除宠物类型信息
     * 
     * @param petTypeId 宠物类型主键
     * @return 结果
     */
    @Override
    public int deletePetTypeByPetTypeId(Long petTypeId)
    {
        return petTypeMapper.deletePetTypeByPetTypeId(petTypeId);
    }

    /**
     * 查询宠物类型列表
     *
     * @return 宠物类型集合
     */
    @Override
    public List<PetType> getPetTypeList() {
        return petTypeMapper.getPetTypeList();
    }
}
