package cn.yw.repairmanage.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.repairmanage.dao.YwrepairjoboplogDao;

@Service("ywrepairjoboplogService")
public class YwrepairjoboplogService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwrepairjoboplogService.class);
	
	@Autowired
	private YwrepairjoboplogDao ywrepairjoboplogDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Ywrepairjoboplog(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywrepairjoboplogDao.insert_Ywrepairjoboplog(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Ywrepairjoboplog(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywrepairjoboplogDao.update_Ywrepairjoboplog(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Ywrepairjoboplog(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywrepairjoboplogDao.delete_Ywrepairjoboplog(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Ywrepairjoboplog(Map map) throws SQLException{
		return ywrepairjoboplogDao.batch_delete_Ywrepairjoboplog(map);
	}
	
	/**
	 * 查询总数
	 */
	public Integer count_Ywrepairjoboplog(Map map) throws SQLException{
		return ywrepairjoboplogDao.count_Ywrepairjoboplog(map);
	}
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Ywrepairjoboplog(Map map) throws SQLException{
		return ywrepairjoboplogDao.query_Ywrepairjoboplog(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Ywrepairjoboplog(Map map) throws SQLException{
		return ywrepairjoboplogDao.get_Ywrepairjoboplog(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportYwrepairjoboplog(Map map) throws SQLException{
		return this.listYwrepairjoboplogByPage(map);
	}
	*/
	
	/**
	 * Ywrepairjoboplog 分页
	 */
	public Map listYwrepairjoboplogByPage(Map map) throws SQLException {
		List<Map> list = ywrepairjoboplogDao.query_Ywrepairjoboplog(map);
		Integer totalCount = ywrepairjoboplogDao.count_Ywrepairjoboplog(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
