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

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

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

	public HashMap<String, Object> selectDetail(HashMap<String, Object> param) throws Exception {
    	return (HashMap<String, Object>)template.queryForObject("BatSchedule.selectDetail", param);
    }	

	public List<Map<String, Object>> scheduleInterfaceList(HashMap<String, Object> param) throws Exception {
    	return (List<Map<String, Object>>)template.queryForList("BatSchedule.scheduleInterfaceList", param);
    }	

	public String getScheduleID(HashMap<String, Object> paramMap) throws Exception{
    	Object obj = this.template.queryForObject("BatSchedule.selectScheID", paramMap);
    	return ((String) obj).toString();
    }


    public void insert(HashMap<String, Object> paramMap) throws Exception{
        this.template.insert("BatSchedule.insert", paramMap);
    }      

    
    public void update(HashMap<String, Object> paramMap) throws Exception{
        this.template.update("BatSchedule.update", paramMap);
    }

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

    public void insertMapping(HashMap<String, Object> paramMap) throws Exception{
        this.template.insert("BatSchedule.insertInterface", paramMap);
    }      

    public void deleteMapping(HashMap<String, Object> paramMap) throws Exception{
        this.template.delete("BatSchedule.deleteInterface", paramMap);
    }

	public List<String> selectInterfacesByScheduleId(Map<String, Object> paramMap) {
		return this.template.queryForList("BatSchedule.selectInterfacesByScheduleId", paramMap);
	}

	public List<Map<String, Object>> selectSchedulesByInterfaceId(Map<String, Object> paramMap) {
		return this.template.queryForList("BatSchedule.selectSchedulesByInterfaceId", paramMap);
	}

}