package com.palmnest.service.virtfood.impl;

import com.palmnest.application.bean.Page;
import com.palmnest.dao.virtfood.VirtFoodDao;
import com.palmnest.model.ScopeEntity;
import com.palmnest.model.virtfood.VirtFood;
import com.palmnest.service.impl.GenericManagerImpl;
import com.palmnest.service.virtfood.VirtFoodManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("virtFoodManager")
public class VirtFoodManagerImpl extends GenericManagerImpl<VirtFood, Long> implements VirtFoodManager {
	private VirtFoodDao virtFoodDao;

	@Autowired
	public void setVirtFoodDao(VirtFoodDao virtFoodDao) {
		this.virtFoodDao = virtFoodDao;
		this.dao = virtFoodDao;
	}

	@Override
	public Page findPageBy(Map<String, Object> params, int pageSize, int pageNo) {

		return virtFoodDao.findPageBy(params, pageSize, pageNo);
	}

	@Override
	public Integer insertFoodOrg(Long food_id, Long org_id) {

		return virtFoodDao.insertFoodOrg(food_id, org_id);
	}

	@Override
	public Integer updateEnable(VirtFood food) {

		return virtFoodDao.updateEnable(food);
	}

	@Override
	public Page getProjects(int pageSize, int pageNo, String projectName) {

		return virtFoodDao.getProjects(pageSize, pageNo, projectName);
	}

	@Override
	public VirtFood getBySpid(String spid) {

		return virtFoodDao.getBySpid(spid);
	}

	@Override
	public List<VirtFood> findAll(Map<String, Object> params) {

		return virtFoodDao.findAll(params);
	}

	@Override
	public String getFoodIdByOrgId(String orgId) {

		return virtFoodDao.getFoodIdByOrgId(orgId);
	}

	@Override
	public Integer deleteFoodOrg(Long food_id, Long org_id) {

		return virtFoodDao.deleteFoodOrg(food_id, org_id);
	}

	@Override
	public Page getProjectsOfLate(ScopeEntity scopeEntity, int pageSize, int pageNo) {

		return virtFoodDao.getProjectsOfLate(scopeEntity, pageSize, pageNo);
	}

}
