package cn.com.countrygarden.bi.main.dao.mediaResource;

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

import javax.transaction.Transactional;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import cn.com.countrygarden.bi.main.core.Mapper;
import cn.com.countrygarden.bi.main.dto.AdvertisingResourcesDto;
import cn.com.countrygarden.bi.main.dto.ReserveMediaDto;
import cn.com.countrygarden.bi.main.model.mediaResource.AdvertisingResources;
import cn.com.countrygarden.bi.main.model.mediaResource.MediaCycle;
import cn.com.countrygarden.bi.main.model.mediaResource.MediaCycleLog;
import cn.com.countrygarden.bi.main.model.mediaResource.MediaOrder;
import cn.com.countrygarden.bi.main.model.mediaResource.MediaOrderBill;
import cn.com.countrygarden.bi.main.model.mediaResource.MediaOrderParam;
@Repository
@Transactional
public interface AdvertistingReserveMapper extends Mapper<MediaCycle>{
	
	List<MediaOrderParam> findAdvertisingPage(AdvertisingResourcesDto dto);
	
	long findAdvertisingCount(AdvertisingResourcesDto dto);

	int  insertOrderBillDetail(MediaOrderBill orderBill);
	
	int getMaxSort();
	
	int getMaxOrderSort();

	int insertOrderInfo(MediaOrder orderInfo);

	int insertCycle(MediaCycle cycle);

	int cancelOrder(AdvertisingResourcesDto obj);

	MediaOrderParam getCancelOrderInfo(AdvertisingResourcesDto dto);

	int insertCycleLog(MediaCycleLog log);

	int getMaxLogSort();

	int delOrderBillDetail(AdvertisingResourcesDto obj);

	List<Map<String, Object>> findMediaOutPage(AdvertisingResourcesDto dto);

	List<Map<String, Object>> findOrderListOutPage(AdvertisingResourcesDto dto);

	List<String> findCycleTime(@Param("mediaIds")String[] mediaIds);

	List<String> findCycleTimeOne(@Param("mediaId")Long mediaId);

	Map<String, Object> getMediaStatus( MediaCycle cycle);

	List<MediaOrderParam> getCancelOrderListForPrint(AdvertisingResourcesDto dto);

	List<String> getOverDateCycle();

	int checkInSchdule(MediaCycle cycleParm);

	int checkMediaCycle(MediaOrderParam cycle);

	//int getOrderBillCount(AdvertisingResourcesDto dto);

	int updateOrderStatus(AdvertisingResourcesDto obj);

	int updateOrderBillStatus(AdvertisingResourcesDto obj);

	int delCycleMedia(AdvertisingResourcesDto obj);

	List<MediaCycleLog> getOrderBillDetail(AdvertisingResourcesDto obj);

	List<Map<String, String>> getMediaType();

	List<Map<String,String>> getDicItem();

	List<String> findOrderLockResource();

	int delOrderBillList(@Param("ids")List<String> lockOrderNotLockRes);

	int delCycle(@Param("billId")String i);

	int queryTimeQuantum(@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("mediaId")Long mediaId);

	List<String> findOrderCode(@Param("beginDate")String startDate,@Param("endDate")String endDate,@Param("mediaId")Long long1);

}
