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

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
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;
import com.eactive.eai.rms.common.util.CamelCaseUtil;



/**
 * <pre>
 *     1. 기능 : 업무별 일별 거래현황 통계 화면의 컨트롤러 
 * </pre>
 * 
 * @author : music75
 * @version : $Revision: 1.3 $
 * @since : rts 1.0
 */
@Controller
public class EaiSvcNameYearlyController extends BaseController  {
	
    @Autowired
    @Qualifier("eaiSvcNameYearlyService")
    private EaiSvcNameYearlyService service ;
    
	@RequestMapping(value= "/onl/statistics/eaisvcname/eaiSvcNameYearlyMan.view")
	private String viewList(HttpServletRequest request, @RequestParam(value = "cmd", required = false ) String cmd ) throws Exception {
		if (cmd == null || "LIST".equals(cmd.toUpperCase())){
			cmd = "";
		}else {
			cmd = CamelCaseUtil.converCamelCase(cmd);
		}
		String path = request.getServletPath();
		return path.split("[.]")[0]+cmd;
	}      
    
    
    

	@RequestMapping(value= "/onl/statistics/eaisvcname/eaiSvcNameYearlyMan.view",params = "cmd=LIST")
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response,@RequestParam HashMap<String,Object> paramMap) throws Exception {
		
		List list = service.selectByEaiSvcNameYearly(paramMap);
		
		HashMap<String, Object> map = new HashMap<String,Object>();
		map.put("rows", list);
		ModelAndView modelAndView = new ModelAndView("jsonView",map);		
		return modelAndView;
	}
}
