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

@Service("ywvideotaskbysetlistService")
public class YwvideotaskbysetlistService extends BaseService {
	
	private static Log log = LogFactory.getLog(YwvideotaskbysetlistService.class);
	
	@Autowired
	private YwvideotaskbysetlistDao ywvideotaskbysetlistDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Ywvideotaskbysetlist(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ywvideotaskbysetlistDao.insert_Ywvideotaskbysetlist(map);
	}
	public void batch_insert_Ywvideotaskbysetlist(List l) throws SQLException{
		ywvideotaskbysetlistDao.batch_insert_Ywvideotaskbysetlist(l);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Ywvideotaskbysetlist(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ywvideotaskbysetlistDao.update_Ywvideotaskbysetlist(map);
	}
	public Integer batch_update_Ywvideotaskbysetlist(Map map) throws SQLException{
		return ywvideotaskbysetlistDao.batch_update_Ywvideotaskbysetlist(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Ywvideotaskbysetlist(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ywvideotaskbysetlistDao.delete_Ywvideotaskbysetlist(map);
	}
	
	/**
	 * 批处理删除记录
	 */
	public Integer batch_delete_Ywvideotaskbysetlist(Map map) throws SQLException{
		return ywvideotaskbysetlistDao.batch_delete_Ywvideotaskbysetlist(map);
	}
	
	/**
	 * 查询总数
	 */
	public Integer count_Ywvideotaskbysetlist(Map map) throws SQLException{
		return ywvideotaskbysetlistDao.count_Ywvideotaskbysetlist(map);
	}
	
	/**
	 * 查询列表记录SELECT
	 */
	public List<Map> query_Ywvideotaskbysetlist(Map map) throws SQLException{
		return ywvideotaskbysetlistDao.query_Ywvideotaskbysetlist(map);
	}
	
	/**
	 * 查询一条
	 */
	 
	public Map get_Ywvideotaskbysetlist(Map map) throws SQLException{
		return ywvideotaskbysetlistDao.get_Ywvideotaskbysetlist(map);
	}
	
	/**
	 * 导出EXCEL
	 */
	 /*
	public Map exportYwvideotaskbysetlist(Map map) throws SQLException{
		return this.listYwvideotaskbysetlistByPage(map);
	}*/
	
	/**
	 * Ywvideotaskbysetlist 分页
	 */
	public Map listYwvideotaskbysetlistByPage(Map map) throws SQLException {
		List<Map> list = ywvideotaskbysetlistDao.query_Ywvideotaskbysetlist(map);
		Integer totalCount = ywvideotaskbysetlistDao.count_Ywvideotaskbysetlist(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
	public Map listYwvideotaskbysetlistByPage_task(Map map) throws SQLException {
		List<Map> list = ywvideotaskbysetlistDao.query_Ywvideotaskbysetlist_task(map);
		Integer totalCount = ywvideotaskbysetlistDao.count_Ywvideotaskbysetlist_task(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
