package cn.im.trafficdevice.service;

 import cn.im.trafficdevice.dao.SbtdspyzdDao;

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

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.base.bean.BaseService;
import cn.base.util.CommUtils;

@Service("sbtdspyzdService")
public class SbtdspyzdService extends BaseService {
	
	private static Log log = LogFactory.getLog(SbtdspyzdService.class);
	
	@Autowired
	private SbtdspyzdDao sbtdspyzdDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Sbtdspyzd(Map map) throws SQLException{
		
		sbtdspyzdDao.insert_Sbtdspyzd(map);
	}
	public void batchInsert(List list) throws SQLException{
		
		sbtdspyzdDao.batchInsert(list);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Sbtdspyzd(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		
		return sbtdspyzdDao.update_Sbtdspyzd(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Sbtdspyzd(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return sbtdspyzdDao.delete_Sbtdspyzd(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Sbtdspyzd(Map map) throws SQLException{
		return sbtdspyzdDao.batch_delete_Sbtdspyzd(map);
	}
	
	/**
	 * 查询总数
	 */
	public Integer count_Sbtdspyzd(Map map) throws SQLException{
		return sbtdspyzdDao.count_Sbtdspyzd(map);
	}
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Sbtdspyzd(Map map) throws SQLException{
		return sbtdspyzdDao.query_Sbtdspyzd(map);
	}
	public List<Map> getAll() throws SQLException{
		return sbtdspyzdDao.getAll();
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Sbtdspyzd(Map map) throws SQLException{
		return sbtdspyzdDao.get_Sbtdspyzd(map);
	}
	public Map get_SbtdspyzdOne(Map map) throws SQLException{
		return sbtdspyzdDao.get_SbtdspyzdOne(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportSbtdspyzd(Map map) throws SQLException{
		return this.listSbtdspyzdByPage(map);
	}
	*/
	
	/**
	 * Sbtdspyzd 分页
	 */
	public Map listSbtdspyzdByPage(Map map) throws SQLException {
		List<Map> list = sbtdspyzdDao.query_Sbtdspyzd(map);
		Integer totalCount = sbtdspyzdDao.count_Sbtdspyzd(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
