package com.eactive.eai.rms.onl.manage.rule.aurora;

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

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

import com.eactive.eai.rms.common.base.OnlBaseService;

@Service("iocmRstService")
public class IocmRstService extends OnlBaseService {

	@Autowired
    @Qualifier("iocmRstDao")
	IocmRstDao dao;
	
	public List selectIocmRst(String searchApCode, String searchPkgNumber, String searchStartDate, String searchEndDate) throws Exception {
		Map params = new HashMap();
		params.put("searchApCode", searchApCode.toUpperCase());
		params.put("searchPkgNumber", searchPkgNumber.toUpperCase());
		params.put("searchStartDate", searchStartDate.replaceAll("-", ""));
		params.put("searchEndDate", searchEndDate.replaceAll("-", ""));
		return dao.selectIocmRst(params);
	}
	
	public List<Map> selectIocmFaultList(String yesterday, String today) throws Exception {
		Map params = new HashMap();
		params.put("yesterday", yesterday);
		params.put("today", today);
		return dao.selectIocmFaultList(params);
	}
}
