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

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.eactive.eai.rms.common.spring.BaseController;

@Controller
public class EaiSvcNameDailySituationController extends BaseController {

	private EaiSvcNameDailyService service;

	@Autowired
	public EaiSvcNameDailySituationController(EaiSvcNameDailyService service) {
		this.service = service;
	}

	@RequestMapping(value = "/onl/statistics/eaisvcname/eaiSvcNameDailySituation.view")
	public String viewList() {
		return "/onl/statistics/eaisvcname/eaiSvcNameDailySituation";
	}

	@RequestMapping(value = "/onl/statistics/eaisvcname/eaiSvcNameDailySituation.json", params = "cmd=LIST")
	public ModelAndView handleRequest(@RequestParam Map<String, Object> paramMap) throws Exception {

		Map<String, Object> map = service.selectByEaiSvcNameDailySituation(paramMap);

		Map<String, Object> resultMap = new HashMap<>();
		resultMap.put("rows", map.get("list"));
		resultMap.put("totalSum", map.get("totalSum"));

		return new ModelAndView("jsonView", resultMap);

	}

}