package com.eactive.eai.rms.bap.manage.message.messageMeta;

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("bapMessageMetaDao")
@SuppressWarnings({"deprecation","unchecked"})
public class BapMessageMetaDao extends SqlMapClientTemplateDao {

	public int selectListCount(HashMap<String, Object> param) throws Exception {

		int totalcnt = (Integer)template.queryForObject("MessageMeta.count", param);

    	return totalcnt;
    }	

	public List<Map<String, Object>> selectList(HashMap<String, Object> param) throws Exception {

		return (List<Map<String, Object>>)template.queryForList("MessageMeta.list", param);
    }	

	public HashMap<String, Object> selectDetail(String msgMetaDstcd) throws Exception {
		HashMap<String, Object> param = new HashMap<String, Object>();

		param.put("msgMetaDstcd", msgMetaDstcd);
     	return (HashMap<String, Object>)template.queryForObject("MessageMeta.detail", param);
    }
	public List<Map<String, Object>> msgList(String msgMetaDstcd) throws Exception {
		HashMap<String, Object> param = new HashMap<String, Object>();

		param.put("msgMetaDstcd", msgMetaDstcd);
     	return (List<Map<String, Object>>)template.queryForList("MessageMeta.msgList" , param);
    }	
	
    public void insert(HashMap<String, Object> paramMap) throws Exception{

        this.template.insert("MessageMeta.insert_bm03", paramMap);

    }

    public void update(HashMap<String, Object> paramMap) throws Exception{

        this.template.update("MessageMeta.update_bm03", paramMap);

    }

    public void delete(HashMap<String, Object> paramMap) throws Exception{
        this.template.delete("MessageMeta.delete_bm03", paramMap);
 
    }
    public void insertList(HashMap<String, Object> paramMap) throws Exception{

        this.template.insert("MessageMeta.insert_bm02", paramMap);
    }

    public void deleteList(HashMap<String, Object> paramMap) throws Exception{
        this.template.delete("MessageMeta.delete_bm02", paramMap);
    }
}