package com.eactive.eai.rms.bap.manage.comm.server;

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

import org.springframework.stereotype.Repository;

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

@Repository("bapServerDao")
@SuppressWarnings({ "deprecation", "unchecked" })
public class BapServerDao extends SqlMapClientTemplateDao {

	public int selectListCount(HashMap<String, Object> param) throws Exception {
    	return (Integer)template.queryForObject("BapServer.selectListCount", param);
    }	
	public List<Map<String, Object>> selectList(HashMap<String, Object> param) throws Exception {
    	return template.queryForList("BapServer.selectList", param);
    }	
	
    public HashMap<String, Object> selectDetail(HashMap<String, String> param) throws Exception {
    	return (HashMap<String, Object>)template.queryForObject("BapServer.selectDetail", param);
    }	

    public List<Map<String, Object>> getEaiServerIpPort(HashMap<String, String> param) throws Exception {
    	return (List<Map<String, Object>>)template.queryForList("BapServer.getEaiServerIpPort", param);
    }	
    public HashMap<String, Object> getEaiServerIpPortForActiveStandby(HashMap<String, String> param) throws Exception {
    	return (HashMap<String, Object>)template.queryForObject("BapServer.getEaiServerIpPortForActiveStandby", param);
    }	
    
    public void insert(HashMap<String, Object> paramMap) throws Exception{
        this.template.insert("BapServer.insert", paramMap);
    }      
    public void update(HashMap<String, Object> paramMap) throws Exception{
        this.template.update("BapServer.update", paramMap);
    }      
    public void delete(HashMap<String, Object> paramMap) throws Exception{
        this.template.delete("BapServer.delete", paramMap);
    }

    public void deleteNotMatchedBP03(Map<String, Object> paramMap) {
        template.queryForObject("BapServer.deleteNotMatchedBP03", paramMap);
    }
    public void upsertServerListBP03(Map<String, Object> paramMap) {
        template.queryForObject("BapServer.upsertServerListBP03", paramMap);
    }
}