package cn.nhyw.yjjl.service;

 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;
import cn.nhyw.yjjl.dao.NhywgyssbyjjtsbDao;

@Service("nhywgyssbyjjtsbService")
public class NhywgyssbyjjtsbService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywgyssbyjjtsbService.class);
	
	@Autowired
	private NhywgyssbyjjtsbDao nhywgyssbyjjtsbDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywgyssbyjjtsb(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywgyssbyjjtsbDao.insert_Nhywgyssbyjjtsb(map);
	}
	

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywgyssbyjjtsb(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywgyssbyjjtsbDao.update_Nhywgyssbyjjtsb(map);
	}
	
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywgyssbyjjtsb(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywgyssbyjjtsbDao.delete_Nhywgyssbyjjtsb(map);
	}
	
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywgyssbyjjtsb(Map map) throws SQLException{
		return nhywgyssbyjjtsbDao.batch_delete_Nhywgyssbyjjtsb(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	public Integer count_Nhywgyssbyjjtsb(Map map) throws SQLException{
		return nhywgyssbyjjtsbDao.count_Nhywgyssbyjjtsb(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywgyssbyjjtsb(Map map) throws SQLException{
		return nhywgyssbyjjtsbDao.query_Nhywgyssbyjjtsb(map);
	}
	
	
	/**
	 * 查询一条
	 */
	public Map get_Nhywgyssbyjjtsb(Map map) throws SQLException{
		return nhywgyssbyjjtsbDao.get_Nhywgyssbyjjtsb(map);
	}
	
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywgyssbyjjtsb(Map map) throws SQLException{
		return this.listNhywgyssbyjjtsbByPage(map);
	}
	*/
	
	/**
	 * Nhywgyssbyjjtsb 分页
	 */
	public Map listNhywgyssbyjjtsbByPage(Map map) throws SQLException {
		List<Map> list = nhywgyssbyjjtsbDao.query_Nhywgyssbyjjtsb(map);
		Integer totalCount = nhywgyssbyjjtsbDao.count_Nhywgyssbyjjtsb(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	
}
