package com.cloudcross.ssp.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.cloudcross.ssp.base.service.IGenericService;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.AdGroup;


/**
 * 投放服务接口定义
 * @author chenyou
 *
 */
public interface IAdGroupService extends IGenericService<AdGroup> {
	//根据活动id得到它有几个投放
	List<AdGroup> findByCampaignId(Long campaignId);
	
	/**
	 * 新增投放信息
	 * @param adGroup
	 * @param targetParamsMap
	 * @return 
	 */
	boolean save(AdGroup adGroup, Map<String, Object> targetParamsMap);
	
	/**
	 * 编辑投放信息
	 * @param adGroup
	 * @param targetParamsMap
	 * @return
	 */
	boolean edit(AdGroup adGroup,Map<String, Object> targetParamsMap);
	public void front2dbplace(String str,AdGroup adGroup);
	boolean updatedAdgroupSupdated(Long id);
	
	List<AdGroup> findByParams(Map<String, Object> paramMap);
	
	List<Long>findAllAdGroudByAdvertiserId(Long advertiserId);
	public boolean updateSupdatedByAdvertiserId(List<Long> advertiserIdList, Date date);
	public boolean updateSupdatedByOrderId(List<Long> orderIdList, Date date);
	public boolean updateSupdatedByCampaignId(List<Long> campaignIdList,Date date);
	public boolean updateStatusByAdvertiserId(List<Long> AdvertiseIdList, int status);
	public boolean updateStatusByOrderId(List<Long> AdvertiseIdList, int status);
	public boolean updateStatusByCampaignId(List<Long> campaignIdList, int status);
	public boolean updateStatusAll(List<Long> adGroupIdList, int status);
	
	public int countByParamsBack(Map<String, Object> paramMap);
	public List<AdGroup> findByParamsBack(Map<String, Object> paramMap, Pager pager);
	public Map findAreasBack(Long adGroupId);
	
	//媒体自投保存
	public boolean saveAll(AdGroup adGroup, Map<String,Object> condition);
	
}
