<?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="wifiGroupInfoSqlMapper">
	<sql id="column">
		id,name,status,updated,operator_id as operatorId
	</sql>
	<insert id="addWifiGroupInfo" parameterType="com.cloudcross.ssp.model.WifiGroupInfo">
		insert into t_wifi_group_info
		 <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="name != null">
                name,
            </if>
            <if test="status != null">
                status,
            </if>
            <if test="updated != null">
                updated,
            </if>
            <if test="operatorId != null">
            	operator_id
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="name != null">
                #{name},
            </if>
            <if test="status != null">
                #{status},
            </if>
            <if test="updated != null">
                #{updated},
            </if>
            <if test="operatorId != null">
            	#{operatorId}
            </if>
        </trim>
	</insert>
	
	<!-- operatorId查询分组信息 -->
	<select id="queryGroupNames" resultType="com.cloudcross.ssp.model.WifiGroupInfo">
		select id,name from t_wifi_group_info where status != -1 and operator_id = #{operatorId}
	</select>
	
	<select id="queryWifiGroupInfoByCondition" parameterType="java.util.Map" resultType="com.cloudcross.ssp.model.WifiGroupInfo">
		select <include refid="column"/> from t_wifi_group_info where operator_id = #{operatorId} and name = #{name} and status != -1
	</select>
</mapper>