<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="adGroupScheduleSqlMapper">
	<sql id="base_column">
		id ,
		adgroup_id as adGroupId ,
		startdate as beginDate,
		enddate as sEndDate,
		dehours,
		daily_impression as dailyImpression,
		daily_click as dailyClick,
		updated 
	</sql>
	
	<insert  id="batchAdd" parameterType="map">
	    insert into t_adgroup_schedule  (adgroup_id,startdate,enddate,dehours,updated)
          values    <foreach collection="scheduleList" item="schedule" index="index" separator=",">
    					(#{schedule.adGroupId},#{schedule.beginDate},#{schedule.sEndDate},#{schedule.dehours},
    					#{schedule.updated})
    			    </foreach> 
	</insert>
	
	<delete id="deleteByAdGroupId" parameterType="long">
		delete from t_adgroup_schedule where adgroup_id = #{adGroupId}
	</delete>
	
</mapper>