package com.eactive.eai.rms.bat.manage.rule.batchSystemInfo;

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.bat.common.base.BatBaseService;

@Service("batSystemInfoService")
public class BatSystemInfoService extends BatBaseService {

	@Autowired
	@Qualifier("batSystemInfoDao")
	private BatSystemInfoDao dao;

	public HashMap<String, Object> selectList(int startNum,int endNum, HashMap<String,Object> paramap) throws Exception {
 
		// 전체 목록수 얻기
		int totalCount = dao.selectListCount(paramap);

		paramap.put("startNum" , startNum);// 시작 record
		paramap.put("endNum"   , endNum);// 끝 record

		List<Map<String, Object>> list = dao.selectList(paramap);

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

		map.put("totalCount", totalCount);

		map.put("list", list);

		return map;
	}	

	public HashMap<String, Object> selectDetail(String envRdvs, String systemCd, String batchType, String useYN) throws Exception {

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("envRdvs", envRdvs);
		paramMap.put("systemCd", systemCd);
		paramMap.put("batchType", batchType);
		paramMap.put("useYN", useYN);

		HashMap<String, Object>   detail   = dao.selectDetail(paramMap);
		
		HashMap<String, Object> map = new HashMap<String, Object>();

		map.put("detail"   , detail);

		return map;

	}	

	public void insert(HashMap<String, Object> paramMap, HashMap<String, Object>[] list) throws Exception {
		
		dao.insert(paramMap);
		
	}

	public void update(HashMap<String, Object> paramMap, HashMap<String, Object>[] list) throws Exception {
		dao.update(paramMap);
	
	}	

	public void delete(HashMap<String, Object> paramMap) throws Exception {
	
		dao.delete(paramMap);
	}


	
	
}
