package com.eactive.eai.rms.onl.statistics.eaisvcname.daily;

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

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

@Service("eaiSvcNameDailyService")
public class EaiSvcNameDailyService {

	private EaiSvcNameDailyDAO dao;

	@Autowired
	public EaiSvcNameDailyService(EaiSvcNameDailyDAO dao) {
		this.dao = dao;
	}

	public Map<String, Object> selectByEaiSvcNameDaily(Map<String, Object> param) throws Exception {

		// 전체 목록수 얻기
		Map<String, Object> totalMap = dao.selectListCount(param);

		List<Map<String, Object>> list = dao.selectByEaiSvcNameDaily(param);

		Map<String, Object> map = new HashMap<>();

		map.put("totalSum", totalMap);
		map.put("list", list);

		return map;
	}
	
	public Map<String, Object> selectByEaiSvcNameDailySituation(Map<String, Object> param) throws Exception {

		// 전체 목록수 얻기
		Map<String, Object> totalMap = dao.selectSituationCount(param);

		List<Map<String, Object>> list = dao.selectByEaiSvcNameDailySituation(param);

		Map<String, Object> map = new HashMap<>();

		map.put("totalSum", totalMap);
		map.put("list", list);

		return map;
	}

}
