package cn.yw.alarmtaskmanage.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.alarmtaskmanage.dao.YwalarmrulelinksmsDao;

@Service("ywalarmrulelinksmsService")
public class YwalarmrulelinksmsService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwalarmrulelinksmsService.class);
	
	@Autowired
	private YwalarmrulelinksmsDao ywalarmrulelinksmsDao;
	
	/**
	 * 保存记录
	 */
	
	public void insert_Ywalarmrulelinksms(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywalarmrulelinksmsDao.insert_Ywalarmrulelinksms(map);
	}
	

	
	/**
	 * 修改记录
	 */
	
	public Integer update_Ywalarmrulelinksms(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywalarmrulelinksmsDao.update_Ywalarmrulelinksms(map);
	}
	
	
	/**
	 * 删除记录
	 */
	
	public Integer delete_Ywalarmrulelinksms(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywalarmrulelinksmsDao.delete_Ywalarmrulelinksms(map);
	}
	
	
	/**
	 * 批处理删除记录
	 */
	
	public Integer batch_delete_Ywalarmrulelinksms(Map map) throws SQLException{
		return ywalarmrulelinksmsDao.batch_delete_Ywalarmrulelinksms(map);
	}
	
	
	/**
	 * 查询总数
	 */
	
	public Integer count_Ywalarmrulelinksms(Map map) throws SQLException{
		return ywalarmrulelinksmsDao.count_Ywalarmrulelinksms(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	
	public List<Map> query_Ywalarmrulelinksms(Map map) throws SQLException{
		return ywalarmrulelinksmsDao.query_Ywalarmrulelinksms(map);
	}
	
	
	/**
	 * 查询一条
	 */
	 
	
	public Map get_Ywalarmrulelinksms(Map map) throws SQLException{
		return ywalarmrulelinksmsDao.get_Ywalarmrulelinksms(map);
	}
	
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportYwalarmrulelinksms(Map map) throws SQLException{
		return this.listYwalarmrulelinksmsByPage(map);
	}
	*/
	
	/**
	 * Ywalarmrulelinksms 分页
	 */
	
	public Map listYwalarmrulelinksmsByPage(Map map) throws SQLException {
		List<Map> list = ywalarmrulelinksmsDao.query_Ywalarmrulelinksms(map);
		Integer totalCount = ywalarmrulelinksmsDao.count_Ywalarmrulelinksms(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	
}
