package cn.nhyw.gysgl.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.gysgl.dao.NhywgysglryxxDao;

@Service("nhywgysglryxxService")
public class NhywgysglryxxService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywgysglryxxService.class);
	
	@Autowired
	private NhywgysglryxxDao nhywgysglryxxDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywgysglryxx(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywgysglryxxDao.insert_Nhywgysglryxx(map);
	}
	

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywgysglryxx(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywgysglryxxDao.update_Nhywgysglryxx(map);
	}
	
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywgysglryxx(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywgysglryxxDao.delete_Nhywgysglryxx(map);
	}
	
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywgysglryxx(Map map) throws SQLException{
		return nhywgysglryxxDao.batch_delete_Nhywgysglryxx(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	public Integer count_Nhywgysglryxx(Map map) throws SQLException{
		return nhywgysglryxxDao.count_Nhywgysglryxx(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywgysglryxx(Map map) throws SQLException{
		return nhywgysglryxxDao.query_Nhywgysglryxx(map);
	}
	
	
	/**
	 * 查询一条
	 */
	public Map get_Nhywgysglryxx(Map map) throws SQLException{
		return nhywgysglryxxDao.get_Nhywgysglryxx(map);
	}
	
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywgysglryxx(Map map) throws SQLException{
		return this.listNhywgysglryxxByPage(map);
	}
	*/
	
	/**
	 * Nhywgysglryxx 分页
	 */
	public Map listNhywgysglryxxByPage(Map map) throws SQLException {
		List<Map> list = nhywgysglryxxDao.query_Nhywgysglryxx(map);
		Integer totalCount = nhywgysglryxxDao.count_Nhywgysglryxx(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	
}
