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.AppFeedingFoodTypeMapper;
import com.ruoyi.model.domain.AppFeedingFoodType;
import com.ruoyi.model.service.IAppFeedingFoodTypeService;

/**
 * 喂养食品类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-08
 */
@Service
public class AppFeedingFoodTypeServiceImpl implements IAppFeedingFoodTypeService 
{
    @Autowired
    private AppFeedingFoodTypeMapper appFeedingFoodTypeMapper;

    /**
     * 查询喂养食品类型
     * 
     * @param feedingFoodTypeId 喂养食品类型主键
     * @return 喂养食品类型
     */
    @Override
    public AppFeedingFoodType selectAppFeedingFoodTypeByFeedingFoodTypeId(Long feedingFoodTypeId)
    {
        return appFeedingFoodTypeMapper.selectAppFeedingFoodTypeByFeedingFoodTypeId(feedingFoodTypeId);
    }

    /**
     * 查询喂养食品类型列表
     * 
     * @param appFeedingFoodType 喂养食品类型
     * @return 喂养食品类型
     */
    @Override
    public List<AppFeedingFoodType> selectAppFeedingFoodTypeList(AppFeedingFoodType appFeedingFoodType)
    {
        return appFeedingFoodTypeMapper.selectAppFeedingFoodTypeList(appFeedingFoodType);
    }

    /**
     * 新增喂养食品类型
     * 
     * @param appFeedingFoodType 喂养食品类型
     * @return 结果
     */
    @Override
    public int insertAppFeedingFoodType(AppFeedingFoodType appFeedingFoodType)
    {
        appFeedingFoodType.setCreateTime(DateUtils.getNowDate());
        return appFeedingFoodTypeMapper.insertAppFeedingFoodType(appFeedingFoodType);
    }

    /**
     * 修改喂养食品类型
     * 
     * @param appFeedingFoodType 喂养食品类型
     * @return 结果
     */
    @Override
    public int updateAppFeedingFoodType(AppFeedingFoodType appFeedingFoodType)
    {
        appFeedingFoodType.setUpdateTime(DateUtils.getNowDate());
        return appFeedingFoodTypeMapper.updateAppFeedingFoodType(appFeedingFoodType);
    }

    /**
     * 批量删除喂养食品类型
     * 
     * @param feedingFoodTypeIds 需要删除的喂养食品类型主键
     * @return 结果
     */
    @Override
    public int deleteAppFeedingFoodTypeByFeedingFoodTypeIds(Long[] feedingFoodTypeIds)
    {
        return appFeedingFoodTypeMapper.deleteAppFeedingFoodTypeByFeedingFoodTypeIds(feedingFoodTypeIds);
    }

    /**
     * 删除喂养食品类型信息
     * 
     * @param feedingFoodTypeId 喂养食品类型主键
     * @return 结果
     */
    @Override
    public int deleteAppFeedingFoodTypeByFeedingFoodTypeId(Long feedingFoodTypeId)
    {
        return appFeedingFoodTypeMapper.deleteAppFeedingFoodTypeByFeedingFoodTypeId(feedingFoodTypeId);
    }

    /**
     * 查询喂养食品类型列表
     *
     * @return 喂养食品类型集合
     */
    @Override
    public List<AppFeedingFoodType> getAppFeedingFoodTypeList(){
        return appFeedingFoodTypeMapper.getAppFeedingFoodTypeList();
    }
}
