<?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="com.winsun.mapper.SchoolMapper">


    <select id="querySchoolMap" parameterType="String" resultType="HashMap">
        select * from hhr_school where sub_name = #{subName} and  school_name = #{schoolName}
    </select>

    <insert id="insertSchoolMap">
        INSERT INTO hhr_school
        (sub_name,school_name,status,lz_user,lzgh,network_code,network_name,app_id,app_key)
        VALUES (#{a},#{b},0,#{c},#{d},#{e},#{f},#{g},#{h})
    </insert>

    <update id="updateSchoolMap">
        update hhr_school set
        <if test="c != null and c != ''">
            lz_user = #{c},
        </if>
        <if test="d != null and d != ''">
            lzgh = #{d},
        </if>
        <if test="e != null and e != ''">
            network_code = #{e},
        </if>
        <if test="f != null and f != ''">
            network_name = #{f},
        </if>
        <if test="g != null and g != ''">
            app_id = #{g},
        </if>
        <if test="h != null and h != ''">
            app_key = #{h},
        </if>
        sub_name = #{a},school_name = #{b}
        where
        sub_name = #{a}
        and
        school_name = #{b}
    </update>


    <insert id="insertNetworkInfo">
        INSERT INTO hhr_network_info (area_name,school_name,network_code,network_name)
        VALUES (#{a},#{b},#{e},#{f})
    </insert>
</mapper>