package cn.nhyw.khpj.dao;

import cn.base.dao.BaseSqlMapDAO;
import cn.base.util.CommUtils;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

@Repository("ywglbmkhDao")
public class YwglbmkhDao extends BaseSqlMapDAO{

	/**
	 * 增加记录
	 */
	public void insert_Ywglbmkh(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		this.insert("insert_Ywglbmkh",map);
	}


	/**
	 * 批处理增加记录
	 */
	public void batch_insert_Ywglbmkh(List batch) throws SQLException{
		this.insert("batch_insert_Ywglbmkh",batch);
	}


	/**
	 * 修改记录
	 */
	public Integer update_Ywglbmkh(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return this.update("update_Ywglbmkh",map);
	}


	/**
	 * 删除记录
	 */
	public Integer delete_Ywglbmkh(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return this.delete("delete_Ywglbmkh",map);
	}


	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Ywglbmkh(Map map) throws SQLException{
		return this.delete("batch_delete_Ywglbmkh",map);
	}


	/**
	 * 查询总数
	 */
	public Integer countYwglbmkh(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Ywglbmkh",map);
	}


	/**
	 * 查询列表记录
	 */
	public List<Map> queryYwglbmkh(Map map) throws SQLException{
		return this.queryForPage("query_Ywglbmkh",map);
	}


	/**
	 * 查询列表记录
	 */
	public Map get_Ywglbmkh(Map map) throws SQLException{
		return (Map) this.queryForObject("query_Ywglbmkh",map);
	}

}
