package cn.bsystem.ptuserrole.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;

import cn.base.dao.BaseSqlMapDAO;

@Repository("sbtdjqqxDao")
public class SbtdjqqxDao  extends BaseSqlMapDAO{


	/**
	 * 增加记录
	 * @param map
	 */
	public void insert_Sbtdjqqx(Map map) throws SQLException{
		this.insert("insert_Sbtdjqqx",map);
	}
	
	/**
	 * 批处理增加记录
	 * @param batch
	 */
	public void batch_insert_Sbtdjqqx(List batch) throws SQLException{
		this.insert("batch_insert_Sbtdjqqx",batch);
	}

	/**
	 * 修改记录
	 * @param map
	 * @return Integer
	 */
	public Integer update_Sbtdjqqx(Map map) throws SQLException{
		return this.update("update_Sbtdjqqx",map);
	}

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

	
	/**
	 * 查询总数
	 * 
	 * @param map
	 * @return Integer
	 */
	public Integer count_Sbtdjqqx(Map map) throws SQLException{
		return (Integer)this.getSqlMapClientTemplate().queryForObject("count_Sbtdjqqx",map);
	}
	
	/**
	 * 查询列表记录
	 * 
	 * @param map
	 * @return List
	 */
	public List<Map> query_Sbtdjqqx(Map map) throws SQLException{
		return this.queryForPage("query_Sbtdjqqx",map);
	}
	
	/**
	 * 查询列表记录
	 * 
	 * @param map
	 * @return List
	 */
	public Map get_Sbtdjqqx(Map map) throws SQLException{
		return (Map) this.queryForObject("query_Sbtdjqqx",map);
	}
	 
	public Integer count_Sbtdjqqx_ByUserRolePage(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Sbtdjqqx_userrole",map);
	}
	
	public List<Map> query_Sbtdjqqx_ByUserRolePage(Map map) throws SQLException{
		return this.queryForPage("query_Sbtdjqqx_userrole",map);
	}
	
	public Integer count_Sbtdjqqx_bybmbh(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_Sbtdjqqx_bybmbh",map);
	}
	
	public Integer update_bmbh_Sbtdjqqx_bysbtd(Map map) throws SQLException{
		return this.update("update_bmbh_Sbtdjqqx_bysbtd",map);
	}
	

	public Integer update_Sbtdjqqx_qx(Map map) throws SQLException{
		return this.update("update_Sbtdjqqx_qx",map);
	}
	
	/**
	 * 查询客户通配权限
	 * @param map
	 * @return List
	 */
	public List<Map> query_Xtkhtptdqx(Map map) throws SQLException{
		return this.queryForList("query_Xtkhtptdqx",map);
	}
	
	/**
	 * 查询列表记录
	 * 
	 * @param map
	 * @return List
	 */
	public List<Map> query_kh_jqtd_right(Map map) throws SQLException{
		return this.queryForPage("query_kh_jqtd_right",map);
	}
	
	/**
	 * 查询总数
	 * 
	 * @param map
	 * @return Integer
	 */
	public Integer count_kh_jqtd_right(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_kh_jqtd_right",map);
	}
	
	/**
	 * 查询列表记录
	 * 
	 * @param map
	 * @return List
	 */
	public List<Map> query_jg_jqtd_right(Map map) throws SQLException{
		return this.queryForPage("query_jg_jqtd_right",map);
	}
	
	/**
	 * 查询总数
	 * 
	 * @param map
	 * @return Integer
	 */
	public Integer count_jg_jqtd_right(Map map) throws SQLException{
		return (Integer)this.queryForObject("count_jg_jqtd_right",map);
	}
}
