<?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="wifiGroupSqlMapper">
	<!-- 批量插入 -->
	<insert id="addWifiGroupBatch" parameterType="java.util.Map">
		insert into t_wifi_group(wifi_id,group_id,status,supdated) values
			<foreach collection="wifiIdList" item="wifiId" index="index" separator=",">
	              ( #{wifiId},#{wifiGroup.groupId}, #{wifiGroup.status}, #{wifiGroup.supdated})
            </foreach>	
	</insert>
	
	<!-- 将wifi移除分组 -->
	<update id="updateWifiGroupStatus" parameterType="java.util.Map">
		update t_wifi_group 
			set status = #{status},supdated = #{supdated}
			where t_wifi_group.wifi_id in
			<foreach item="id" collection="idList"
		      open="(" separator="," close=")">
		        #{id}
			</foreach>
	</update>
	
	<!-- 根据分组名将wifi移除分组 -->
	<select id="updateStatusById" parameterType="java.util.Map">
		update t_wifi_group 
			set status = #{status},supdated = #{supdated}
			where t_wifi_group.group_id = #{id}
	</select>
	
	<select id="queryWifiIdByGroupId" parameterType="java.lang.Long" resultType="com.cloudcross.ssp.model.WifiGroup">
		select wifi_id as wifiId from t_wifi_group where group_id = #{groupId}
	</select>
</mapper>