package com.ruoyi.model.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppFeedingFoodMapper;
import com.ruoyi.model.domain.AppFeedingFood;
import com.ruoyi.model.service.IAppFeedingFoodService;

/**
 * 喂养要求Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-08
 */
@Service
public class AppFeedingFoodServiceImpl implements IAppFeedingFoodService 
{
    @Autowired
    private AppFeedingFoodMapper appFeedingFoodMapper;

    /**
     * 查询喂养要求
     * 
     * @param feedingFoodId 喂养要求主键
     * @return 喂养要求
     */
    @Override
    public AppFeedingFood selectAppFeedingFoodByFeedingFoodId(Long feedingFoodId)
    {
        return appFeedingFoodMapper.selectAppFeedingFoodByFeedingFoodId(feedingFoodId);
    }

    /**
     * 查询喂养要求列表
     * 
     * @param appFeedingFood 喂养要求
     * @return 喂养要求
     */
    @Override
    public List<AppFeedingFood> selectAppFeedingFoodList(AppFeedingFood appFeedingFood)
    {
        return appFeedingFoodMapper.selectAppFeedingFoodList(appFeedingFood);
    }

    /**
     * 新增喂养要求
     * 
     * @param appFeedingFood 喂养要求
     * @return 结果
     */
    @Override
    public int insertAppFeedingFood(AppFeedingFood appFeedingFood)
    {
        return appFeedingFoodMapper.insertAppFeedingFood(appFeedingFood);
    }

    /**
     * 修改喂养要求
     * 
     * @param appFeedingFood 喂养要求
     * @return 结果
     */
    @Override
    public int updateAppFeedingFood(AppFeedingFood appFeedingFood)
    {
        return appFeedingFoodMapper.updateAppFeedingFood(appFeedingFood);
    }

    /**
     * 批量删除喂养要求
     * 
     * @param feedingFoodIds 需要删除的喂养要求主键
     * @return 结果
     */
    @Override
    public int deleteAppFeedingFoodByFeedingFoodIds(Long[] feedingFoodIds)
    {
        return appFeedingFoodMapper.deleteAppFeedingFoodByFeedingFoodIds(feedingFoodIds);
    }

    /**
     * 删除喂养要求信息
     * 
     * @param feedingFoodId 喂养要求主键
     * @return 结果
     */
    @Override
    public int deleteAppFeedingFoodByFeedingFoodId(Long feedingFoodId)
    {
        return appFeedingFoodMapper.deleteAppFeedingFoodByFeedingFoodId(feedingFoodId);
    }

    /**
     * 查询服务记录中所有的喂养要求及其食品列表
     *
     * @return 喂养要求集合
     */
    @Override
    public List<AppFeedingFood> getAppFeedingFoodList(){
        return appFeedingFoodMapper.getAppFeedingFoodList();
    }
}
