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

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

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

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

    	return totalcnt;
    }	

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

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

	public HashMap<String, Object> selectDetail(String key) throws Exception {
		HashMap<String, Object> param = new HashMap<String, Object>();
		// key = bjobBzwkPrcssDstcd
		param.put("bjobBzwkPrcssDstcd", key);
     	return (HashMap<String, Object>)template.queryForObject("FlowRule.detail", param);
    }
	public List<Map<String, Object>> msgList(String key) throws Exception {
		HashMap<String, Object> param = new HashMap<String, Object>();
		// key = bjobBzwkPrcssDstcd
		param.put("bjobBzwkPrcssDstcd", key);
     	return (List<Map<String, Object>>)template.queryForList("FlowRule.stageList" , param);
    }	
	
    public void insert(HashMap<String, Object> paramMap) throws Exception{

        this.template.insert("FlowRule.insert_br04", paramMap);

    }

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

        this.template.update("FlowRule.update", paramMap);

    }

    public void delete(HashMap<String, Object> paramMap) throws Exception{
        this.template.delete("FlowRule.delete_br04", paramMap);
 
    }
    public void insertList(HashMap<String, Object> paramMap) throws Exception{
        this.template.insert("FlowRule.insert_br02", paramMap);
    }

    public void deleteList(HashMap<String, Object> paramMap) throws Exception{
        this.template.delete("FlowRule.delete_br02", paramMap);
    }
	public List<Map<String, Object>> getBjobStgeDstcd(HashMap<String,Object> map) throws Exception {
		
		return (List<Map<String, Object>>)template.queryForList("FlowRule.getBjobStgeDstcd",map);
    }	    
}