<?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="adgroupWifigroupSqlMapper">
	<!-- 批量插入 -->
	<insert id="addAdgroupWifigroupBatch" parameterType="java.util.Map">
		insert into t_adgroup_wifigroup
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="adgroupId != null">
				adgroup_id,
			</if>
			<if test="wifigroupId != null">
				wifigroup_id,
			</if>
			<if test="status != null">
				status,
			</if>
			<if test="supdated != null">
				supdated
			</if>
		</trim>
		<foreach collection="wifigroupIdList" item="wifigroupId" index="index" separator=",">
        <trim prefix="values (" suffix=")" suffixOverrides=",">
        		<if test="adgroupId != null">
					#{adgroupWifigroup.adgroupId},
				</if>
				<if test="wifigroupId != null">
					#{wifigroupId},
				</if>
				<if test="status != null">
					#{adgroupWifigroup.status},
				</if>
				<if test="supdated != null">
					#{adgroupWifigroup.supdated}
				</if>
        </trim>
        </foreach>
	</insert>
	
	<insert id="addAdgroupWifigroup" parameterType="com.cloudcross.ssp.model.AdgroupWifigroup">
		insert into t_adgroup_wifigroup (adgroup_id,wifigroup_id,status,supdated) 
		values (#{adgroupId},#{wifigroupId},#{status},#{supdated})
	</insert>

	<update id="updateAdgroupWifigroup" parameterType="java.util.Map">
		update t_adgroup_wifigroup set status = -1, supdated = #{supdated} where adgroup_id = #{adgroupId}
	</update>

</mapper>