package cn.im.trafficplan.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository("trafficplanlinkagedeviceDao")
public class TrafficplanlinkagedeviceDao  extends SqlMapClientDaoSupport{

	@Autowired 
    private SqlMapClient sqlMapClient;  
      
	@PostConstruct          
    public  void initSqlMapClient(){  
    	super.setSqlMapClient(sqlMapClient);      
    }
	
	
	/**
	 * 增加记录
	 */
	public void insert_Trafficplanlinkagedevice(Map map) throws SQLException{
		this.getSqlMapClientTemplate().insert("insert_Trafficplanlinkagedevice",map);
	}

	/**
	 * 修改记录
	 */
	public Integer update_Trafficplanlinkagedevice(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().update("update_Trafficplanlinkagedevice",map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Trafficplanlinkagedevice(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().delete("delete_Trafficplanlinkagedevice",map);
	}
	
	/**
	 * 根据planID删除记录
	 */
	public Integer delete_TrafficplanlinkagedeviceByPlanID(String str) throws SQLException{
		return this.getSqlMapClientTemplate().delete("delete_TrafficplanlinkagedeviceByPlanID",str);
	}
	
	
	/**
	 * 查询总数
	 */
	public Integer count_Trafficplanlinkagedevice(Map map) throws SQLException{
		return (Integer)this.getSqlMapClientTemplate().queryForObject("count_Trafficplanlinkagedevice",map);
	}
	
	/**
	 * 查询列表记录
	 */
	public List<Map> query_Trafficplanlinkagedevice(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().queryForList("query_Trafficplanlinkagedevice",map);
	}
	public List<Map> getlinkageDeviceOrigin(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().queryForList("query_Trafficplanlinkagedevice_Origin",map);
	}
	
	
}
