package cn.yw.video.videotask.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.video.videotask.dao.YwvideotaskruleDao;

@Service("ywvideotaskruleService")
public class YwvideotaskruleService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwvideotaskruleService.class);
	
	@Autowired
	private YwvideotaskruleDao ywvideotaskruleDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Ywvideotaskrule(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywvideotaskruleDao.insert_Ywvideotaskrule(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Ywvideotaskrule(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywvideotaskruleDao.update_Ywvideotaskrule(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Ywvideotaskrule(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywvideotaskruleDao.delete_Ywvideotaskrule(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	
	public Integer batch_delete_Ywvideotaskrule(Map map) throws SQLException{
		return ywvideotaskruleDao.batch_delete_Ywvideotaskrule(map);
	}
	
	
	/**
	 * 查询总数
	 */
	
	public Integer count_Ywvideotaskrule(Map map) throws SQLException{
		return ywvideotaskruleDao.count_Ywvideotaskrule(map);
	}
	
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Ywvideotaskrule(Map map) throws SQLException{
		return ywvideotaskruleDao.query_Ywvideotaskrule(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Ywvideotaskrule(Map map) throws SQLException{
		return ywvideotaskruleDao.get_Ywvideotaskrule(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 
	/*
	public Map exportYwvideotaskrule(Map map) throws SQLException{
		return this.listYwvideotaskruleByPage(map);
	}
	*/
	
	/**
	 * Ywvideotaskrule 分页
	 */
	public Map listYwvideotaskruleByPage(Map map) throws SQLException {
		List<Map> list = ywvideotaskruleDao.query_Ywvideotaskrule(map);
		Integer totalCount = ywvideotaskruleDao.count_Ywvideotaskrule(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
