package com.ym.mec.biz.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ym.mec.biz.dal.dao.GoodsDao;
import com.ym.mec.biz.dal.entity.Goods;
import com.ym.mec.biz.service.GoodsService;
import com.ym.mec.common.dal.BaseDAO;
import com.ym.mec.common.service.impl.BaseServiceImpl;

import java.util.List;

@Service
public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implements GoodsService {
	
	@Autowired
	private GoodsDao goodsDao;

	@Override
	public BaseDAO<Integer, Goods> getDAO() {
		return goodsDao;
	}

	@Override
	public List<Goods> findGoodsBySubId(Integer subjectId,Integer goodsCategoryId) {
		return goodsDao.findGoodsBySubId(subjectId,goodsCategoryId);
	}

	public int findGoodsNumByCategoryId(Integer goodsCategoryId){
		return goodsDao.findGoodsNumByCategoryId(goodsCategoryId);
	}
}