package cn.nhyw.xxpzgl.service;

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

 import cn.datasource.DS;
 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.xxpzgl.dao.NhywxmglwdxxDao;

@Service("nhywxmglwdxxService")
public class NhywxmglwdxxService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywxmglwdxxService.class);
	
	@Autowired
	private NhywxmglwdxxDao nhywxmglwdxxDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywxmglwdxx(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywxmglwdxxDao.insert_Nhywxmglwdxx(map);
	}
	

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywxmglwdxx(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywxmglwdxxDao.update_Nhywxmglwdxx(map);
	}
	
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywxmglwdxx(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywxmglwdxxDao.delete_Nhywxmglwdxx(map);
	}
	
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywxmglwdxx(Map map) throws SQLException{
		return nhywxmglwdxxDao.batch_delete_Nhywxmglwdxx(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	public Integer count_Nhywxmglwdxx(Map map) throws SQLException{
		return nhywxmglwdxxDao.count_Nhywxmglwdxx(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywxmglwdxx(Map map) throws SQLException{
		return nhywxmglwdxxDao.query_Nhywxmglwdxx(map);
	}
	
	
	/**
	 * 查询一条
	 */
	public Map get_Nhywxmglwdxx(Map map) throws SQLException{
		return nhywxmglwdxxDao.get_Nhywxmglwdxx(map);
	}
	
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywxmglwdxx(Map map) throws SQLException{
		return this.listNhywxmglwdxxByPage(map);
	}
	*/
	
	/**
	 * Nhywxmglwdxx 分页
	 */
	@DS("datasource1")
	public Map listNhywxmglwdxxByPage(Map map) throws SQLException {
		List<Map> list = nhywxmglwdxxDao.query_Nhywxmglwdxx(map);
		Integer totalCount = nhywxmglwdxxDao.count_Nhywxmglwdxx(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	
}
