<?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.goafanti.common.dao.BranchInformationMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.BranchInformation">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="platform_name" jdbcType="VARCHAR" property="platformName" />
    <result column="app_name" jdbcType="VARCHAR" property="appName" />
    <result column="platform_url" jdbcType="VARCHAR" property="platformUrl" />
    <result column="domain_name" jdbcType="VARCHAR" property="domainName" />
    <result column="icp" jdbcType="VARCHAR" property="icp" />
    <result column="server" jdbcType="VARCHAR" property="server" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    id, platform_name, app_name, platform_url, domain_name, icp, server
  </sql>
  <select id="selectByExample" parameterType="com.goafanti.common.model.BranchInformationExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from branch_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    select 
    <include refid="Base_Column_List" />
    from branch_information
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    delete from branch_information
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.BranchInformationExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    delete from branch_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.BranchInformation">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    insert into branch_information (id, platform_name, app_name, 
      platform_url, domain_name, icp, 
      server)
    values (#{id,jdbcType=VARCHAR}, #{platformName,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, 
      #{platformUrl,jdbcType=VARCHAR}, #{domainName,jdbcType=VARCHAR}, #{icp,jdbcType=VARCHAR}, 
      #{server,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.BranchInformation">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    insert into branch_information
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="platformName != null">
        platform_name,
      </if>
      <if test="appName != null">
        app_name,
      </if>
      <if test="platformUrl != null">
        platform_url,
      </if>
      <if test="domainName != null">
        domain_name,
      </if>
      <if test="icp != null">
        icp,
      </if>
      <if test="server != null">
        server,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="platformName != null">
        #{platformName,jdbcType=VARCHAR},
      </if>
      <if test="appName != null">
        #{appName,jdbcType=VARCHAR},
      </if>
      <if test="platformUrl != null">
        #{platformUrl,jdbcType=VARCHAR},
      </if>
      <if test="domainName != null">
        #{domainName,jdbcType=VARCHAR},
      </if>
      <if test="icp != null">
        #{icp,jdbcType=VARCHAR},
      </if>
      <if test="server != null">
        #{server,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.BranchInformationExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    select count(*) from branch_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    update branch_information
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.platformName != null">
        platform_name = #{record.platformName,jdbcType=VARCHAR},
      </if>
      <if test="record.appName != null">
        app_name = #{record.appName,jdbcType=VARCHAR},
      </if>
      <if test="record.platformUrl != null">
        platform_url = #{record.platformUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.domainName != null">
        domain_name = #{record.domainName,jdbcType=VARCHAR},
      </if>
      <if test="record.icp != null">
        icp = #{record.icp,jdbcType=VARCHAR},
      </if>
      <if test="record.server != null">
        server = #{record.server,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    update branch_information
    set id = #{record.id,jdbcType=VARCHAR},
      platform_name = #{record.platformName,jdbcType=VARCHAR},
      app_name = #{record.appName,jdbcType=VARCHAR},
      platform_url = #{record.platformUrl,jdbcType=VARCHAR},
      domain_name = #{record.domainName,jdbcType=VARCHAR},
      icp = #{record.icp,jdbcType=VARCHAR},
      server = #{record.server,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.BranchInformation">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    update branch_information
    <set>
      <if test="platformName != null">
        platform_name = #{platformName,jdbcType=VARCHAR},
      </if>
      <if test="appName != null">
        app_name = #{appName,jdbcType=VARCHAR},
      </if>
      <if test="platformUrl != null">
        platform_url = #{platformUrl,jdbcType=VARCHAR},
      </if>
      <if test="domainName != null">
        domain_name = #{domainName,jdbcType=VARCHAR},
      </if>
      <if test="icp != null">
        icp = #{icp,jdbcType=VARCHAR},
      </if>
      <if test="server != null">
        server = #{server,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.BranchInformation">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jan 30 11:17:16 CST 2018.
    -->
    update branch_information
    set platform_name = #{platformName,jdbcType=VARCHAR},
      app_name = #{appName,jdbcType=VARCHAR},
      platform_url = #{platformUrl,jdbcType=VARCHAR},
      domain_name = #{domainName,jdbcType=VARCHAR},
      icp = #{icp,jdbcType=VARCHAR},
      server = #{server,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  
   <select id="listBranchInformation" resultType="com.goafanti.common.model.BranchInformation">
   select
   id, platform_name as platformName, app_name as appName, platform_url platformUrl, domain_name as domainName, icp, server
   from branch_information
   </select>
   
   <select id="selectByDomain" parameterType="java.lang.String" resultMap="BaseResultMap">
   	select 
    <include refid="Base_Column_List" />
    from branch_information
    where domain_name = #{domainName,jdbcType=VARCHAR}
   </select>
</mapper>