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

import com.ym.mec.biz.dal.dto.ConditionDto;
import com.ym.mec.common.exception.BizException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ym.mec.biz.dal.dao.VipGroupCategoryDao;
import com.ym.mec.biz.dal.entity.VipGroupCategory;
import com.ym.mec.biz.service.VipGroupCategoryService;
import com.ym.mec.common.dal.BaseDAO;
import com.ym.mec.common.service.impl.BaseServiceImpl;

import java.util.List;
import java.util.Objects;

@Service
public class VipGroupCategoryServiceImpl extends BaseServiceImpl<Integer, VipGroupCategory>  implements VipGroupCategoryService {
	
	@Autowired
	private VipGroupCategoryDao vipGroupCategoryDao;

	@Override
	public BaseDAO<Integer, VipGroupCategory> getDAO() {
		return vipGroupCategoryDao;
	}

	@Override
	public List<VipGroupCategory> findAllByOrgan(String organId) {
		return vipGroupCategoryDao.findAllByOrgan(organId);
	}

	@Override
	public List<VipGroupCategory> findTeacherSalary(Integer userId) {
		if(Objects.isNull(userId)){
			throw new BizException("请确定教师");
		}
		return vipGroupCategoryDao.findTeacherDefaultSalary(userId);
	}

	@Override
	public List<ConditionDto> findConditionCategorys() {
		return vipGroupCategoryDao.findConditionCategorys();
	}
}
