package cn.im.trafficalarm.dao;

import java.sql.SQLException;
import java.util.HashMap;
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;

import cn.im.trafficalarm.model.TrafficdevicemessagelogBean;

@Repository("trafficdevicemessagelogDao")
public class TrafficdevicemessagelogDao  extends SqlMapClientDaoSupport{

	@Autowired 
    private SqlMapClient sqlMapClient;  
      
	@PostConstruct          
    public  void initSqlMapClient(){  
    	super.setSqlMapClient(sqlMapClient);      
    }
	
	
	/**
	 * 增加记录
	 */
	
	public void insert_Trafficdevicemessagelog(Map map) throws SQLException{
		this.getSqlMapClientTemplate().insert("insert_Trafficdevicemessagelog",map);
	}
	
	/**
	 * 增加记录
	 * @param pDto
	 */
	public Map insert_TrafficDeviceMessageLog(TrafficdevicemessagelogBean obj) {
		Map map = new HashMap();
		try{			
			this.getSqlMapClientTemplate().insert("insert_Trafficdevicemessagelog",obj);
			map.put("msg", "数据新增成功");
			map.put("success", new Boolean(true));			
		}catch(Exception e){
		}
		return map;
	}
	
	/**
	 * 批处理增加记录
	 */
	/*
	public void batch_insert_Trafficdevicemessagelog(List batch) throws SQLException{
		this.getSqlMapClientTemplate().insert("batch_insert_Trafficdevicemessagelog",batch);
	}
	*/
	 
	/**
	 * 修改记录
	 */
	/*
	public Integer update_Trafficdevicemessagelog(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().update("update_Trafficdevicemessagelog",map);
	}
	*/
	
	/**
	 * 删除记录
	 */
	/*
	public Integer delete_Trafficdevicemessagelog(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().delete("delete_Trafficdevicemessagelog",map);
	}
	*/
	
	/**
	 * 批处理删除记录
	 */
	
	/*
	public Integer batch_delete_Trafficdevicemessagelog(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().delete("batch_delete_Trafficdevicemessagelog",map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	/*
	public Integer count_Trafficdevicemessagelog(Map map) throws SQLException{
		return (Integer)this.getSqlMapClientTemplate().queryForObject("count_Trafficdevicemessagelog",map);
	}
	*/
	
	/**
	 * 查询列表记录
	 */
	
	/*
	public List<Map> query_Trafficdevicemessagelog(Map map) throws SQLException{
		return this.getSqlMapClientTemplate().queryForList("query_Trafficdevicemessagelog",map);
	}
	*/
	
	/**
	 * 查询列表记录
	 */
	/*
	public Map get_Trafficdevicemessagelog(Map map) throws SQLException{
		return (Map) this.getSqlMapClientTemplate().queryForObject("query_Trafficdevicemessagelog",map);
	}
	*/
}
