package cn.yw.nhyw.nhywjtsbbhgl.service;

 import cn.yw.nhyw.nhywjtsbbhgl.dao.NhywjtsbbhglDao;

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("nhywjtsbbhglService")
public class NhywjtsbbhglService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywjtsbbhglService.class);
	
	@Autowired
	private NhywjtsbbhglDao nhywjtsbbhglDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywjtsbbhgl(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywjtsbbhglDao.insert_Nhywjtsbbhgl(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywjtsbbhgl(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywjtsbbhglDao.update_Nhywjtsbbhgl(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywjtsbbhgl(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywjtsbbhglDao.delete_Nhywjtsbbhgl(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywjtsbbhgl(Map map) throws SQLException{
		return nhywjtsbbhglDao.batch_delete_Nhywjtsbbhgl(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	/*
	public Integer count_Nhywjtsbbhgl(Map map) throws SQLException{
		return nhywjtsbbhglDao.count_Nhywjtsbbhgl(map);
	}
	*/
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywjtsbbhgl(Map map) throws SQLException{
		return nhywjtsbbhglDao.query_Nhywjtsbbhgl(map);
	}
	
	/**
	 * 查询一条
	 */
	public Map get_Nhywjtsbbhgl(Map map) throws SQLException{
		return nhywjtsbbhglDao.get_Nhywjtsbbhgl(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywjtsbbhgl(Map map) throws SQLException{
		return this.listNhywjtsbbhglByPage(map);
	}
	*/
	
	/**
	 * Nhywjtsbbhgl 分页
	 */
	public Map listNhywjtsbbhglByPage(Map map) throws SQLException {
		List<Map> list = nhywjtsbbhglDao.query_Nhywjtsbbhgl(map);
		Integer totalCount = nhywjtsbbhglDao.count_Nhywjtsbbhgl(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
