package cn.yw.machinemanage.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.yw.machinemanage.dao.YwmachineharddiskDao;

@Service("ywmachineharddiskService")
public class YwmachineharddiskService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwmachineharddiskService.class);
	
	@Autowired
	private YwmachineharddiskDao ywmachineharddiskDao;
	
	/**
	 * 保存记录
	 */
	
	public void insert_Ywmachineharddisk(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywmachineharddiskDao.insert_Ywmachineharddisk(map);
	}
	

	
	/**
	 * 修改记录
	 */
	
	public Integer update_Ywmachineharddisk(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywmachineharddiskDao.update_Ywmachineharddisk(map);
	}
	
	
	/**
	 * 删除记录
	 */
	
	public Integer delete_Ywmachineharddisk(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywmachineharddiskDao.delete_Ywmachineharddisk(map);
	}
	
	
	/**
	 * 批处理删除记录
	 */
	
	public Integer batch_delete_Ywmachineharddisk(Map map) throws SQLException{
		return ywmachineharddiskDao.batch_delete_Ywmachineharddisk(map);
	}
	
	
	/**
	 * 查询总数
	 */
	
	public Integer count_Ywmachineharddisk(Map map) throws SQLException{
		return ywmachineharddiskDao.count_Ywmachineharddisk(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	
	public List<Map> query_Ywmachineharddisk(Map map) throws SQLException{
		return ywmachineharddiskDao.query_Ywmachineharddisk(map);
	}
	
	
	/**
	 * 查询一条
	 */
	 
	
	public Map get_Ywmachineharddisk(Map map) throws SQLException{
		return ywmachineharddiskDao.get_Ywmachineharddisk(map);
	}
	
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportYwmachineharddisk(Map map) throws SQLException{
		return this.listYwmachineharddiskByPage(map);
	}
	*/
	
	/**
	 * Ywmachineharddisk 分页
	 */
	
	public Map listYwmachineharddiskByPage(Map map) throws SQLException {
		List<Map> list = ywmachineharddiskDao.query_Ywmachineharddisk(map);
		Integer totalCount = ywmachineharddiskDao.count_Ywmachineharddisk(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	
	// 更新
	public Integer edit_Ywmachineharddisk(Map map) throws SQLException{
		return ywmachineharddiskDao.edit_Ywmachineharddisk(map);
	}
}
