package com.eactive.eai.rms.bat.monitoring.count;

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

import org.springframework.stereotype.Repository;

import com.eactive.eai.rms.bat.monitoring.count.BatCountMonitorService.CountMapType;
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;

@Repository("batCountMonitorDao")
@SuppressWarnings({ "deprecation", "unchecked" })
public class BatCountMonitorDao extends SqlMapClientTemplateDao {

	public List<Map<String, Object>> selectList(HashMap<String, Object> param) throws Exception {
		return (List<Map<String, Object>>) template.queryForList("BatCountMonitor.selectList", param);
	}

	public Integer selectCount(Map<String, Object> paramMap, CountMapType type) throws Exception {
		switch(type) {
		case DD:
			return (Integer) template.queryForObject("BatCountMonitor.selectDDCount", paramMap);
		case FF:
			return (Integer) template.queryForObject("BatCountMonitor.selectFFCount", paramMap);
		default:
			throw new Exception("CountMapType을 지정해야 합니다.");
		}
	}

}