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.NhywgyssbyjdDao;

@Service("nhywgyssbyjdService")
public class NhywgyssbyjdService extends BaseService {
	
	private static Log log = LogFactory.getLog(NhywgyssbyjdService.class);
	
	@Autowired
	private NhywgyssbyjdDao nhywgyssbyjdDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Nhywgyssbyjd(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		nhywgyssbyjdDao.insert_Nhywgyssbyjd(map);
	}
	

	
	/**
	 * 修改记录
	 */
	public Integer update_Nhywgyssbyjd(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return nhywgyssbyjdDao.update_Nhywgyssbyjd(map);
	}
	
	
	/**
	 * 删除记录
	 */
	public Integer delete_Nhywgyssbyjd(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return nhywgyssbyjdDao.delete_Nhywgyssbyjd(map);
	}
	
	
	/**
	 * 批处理删除记录
	 */
	/*
	public Integer batch_delete_Nhywgyssbyjd(Map map) throws SQLException{
		return nhywgyssbyjdDao.batch_delete_Nhywgyssbyjd(map);
	}
	*/
	
	/**
	 * 查询总数
	 */
	public Integer count_Nhywgyssbyjd(Map map) throws SQLException{
		return nhywgyssbyjdDao.count_Nhywgyssbyjd(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Nhywgyssbyjd(Map map) throws SQLException{
		return nhywgyssbyjdDao.query_Nhywgyssbyjd(map);
	}
	
	
	/**
	 * 查询一条
	 */
	public Map get_Nhywgyssbyjd(Map map) throws SQLException{
		return nhywgyssbyjdDao.get_Nhywgyssbyjd(map);
	}
	
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportNhywgyssbyjd(Map map) throws SQLException{
		return this.listNhywgyssbyjdByPage(map);
	}
	*/
	
	/**
	 * Nhywgyssbyjd 分页
	 */
	public Map listNhywgyssbyjdByPage(Map map) throws SQLException {
		List<Map> list = nhywgyssbyjdDao.query_Nhywgyssbyjd(map);
		Integer totalCount = nhywgyssbyjdDao.count_Nhywgyssbyjd(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	
	// 查询移交单关联的电子集合设备信息 
	public List<Map> query_yjd_dzjh(Map map) throws SQLException{
		return nhywgyssbyjdDao.query_yjd_dzjh(map);
	}
	public Integer count_yjd_dzjh(Map map) throws SQLException{
		return nhywgyssbyjdDao.count_yjd_dzjh(map);
	}
}
