package com.eactive.eai.rms.onl.manage.adapter.adapter;

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

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

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

/**
 * 1. 기능 : 업무데이터로 부터 아래와 같은 특정 필드를 추출하기 위한 어댑터 정보 테이블에 대한 Data Access Object 이다.
 * 2. 처리 개요 : 어댑터 정보 테이블에 대한 Create, Read, Update, Delete 를 처리한다.
 *
 * 3. 주의사항
 *
 * @author :
 * @version : v 1.0.0
 * @see : AdapterQuery.java
 * @since :
 */
@Repository
public class AdapterDao extends SqlMapClientTemplateDao {

	/**
	 * Default Logger
	 */
	protected final Logger logger = Logger.getLogger(getClass());

	public int selectListCount(HashMap param) throws Exception {
		return (Integer) template.queryForObject("Adapter.selectListCount", param);
	}

	public List selectList(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectList", param);
	}

	public List selectListDetail(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectDetail", param);
	}

	public List<HashMap<String, String>> selectListForItsm(HashMap<String, String> param) {
		return template.queryForList("Adapter.selectListForItsm", param);
	}

	public HashMap selectDetail(HashMap param) throws Exception {
		return (HashMap) template.queryForObject("Adapter.selectDetail", param);
	}

	public List selectListCombo(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectListCombo", param);
	}

	public List selectChannelList(HashMap param) {
		return template.queryForList("Adapter.selectChannelList", param);
	}

	public void updateAdaptersForSimYn(HashMap paramMap) throws Exception {
		this.template.update("Adapter.updateAdaptersForSimYn", paramMap);
	}

	public List selectSocketAdapterGroup(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectSocketAdapterGroup", param);
	}

	public List selectListForSingleNode(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectListForSingleNode", param);
	}

	// SocketStatus화면에서 사용.
	public List selectListRealTimeGroup(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectListRealTimeGroup", param);
	}

	public List selectChgAdapterList(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectChgAdapterList", param);
	}

	public void updateChangeAdapter(HashMap paramMap) throws Exception {
		this.template.update("Adapter.updateChangeAdapter", paramMap);
	}

	public List selectadapterPortList(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectadapterPortList", param);
	}

	public List selectIsgAdapterPortList(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectIsgAdapterPortList", param);
	}

	public List selectAdptGrpNameByPort(HashMap param) throws Exception {
		return template.queryForList("Adapter.selectAdptGrpNameByPort", param);
	}

	public List<HashMap<String, Object>> selectChgCmdAdapterList(HashMap<String, Object> paramMap) {
		return template.queryForList("Adapter.selectChgCmdAdapterList", paramMap);
	}

}
