<?xml version="1.0" encoding="UTF-8" ?>
<!--

       Copyright ${license.git.copyrightYears} the original author or authors.

       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.

-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.apache.ibatis.submitted.awful_table.AwfulTableMapper" >
  <resultMap id="BaseResultMap" type="org.apache.ibatis.submitted.awful_table.AwfulTable" >
    <id column="A_CuStOmEr iD" property="customerId" jdbcType="INTEGER" />
    <result column="A_first name" property="firstFirstName" jdbcType="VARCHAR" />
    <result column="A_FIRST_NAME" property="secondFirstName" jdbcType="VARCHAR" />
    <result column="A_FIRSTNAME" property="thirdFirstName" jdbcType="VARCHAR" />
    <result column="A_last name" property="lastName" jdbcType="VARCHAR" />
    <result column="A_E_MAIL" property="eMail" jdbcType="VARCHAR" />
    <result column="A__id1" property="id1" jdbcType="INTEGER" />
    <result column="A_$id2" property="id2" jdbcType="INTEGER" />
    <result column="A_id5_" property="id5" jdbcType="INTEGER" />
    <result column="A_id6$" property="id6" jdbcType="INTEGER" />
    <result column="A_id7$$" property="id7" jdbcType="INTEGER" />
    <result column="A_EMAILADDRESS" property="emailaddress" jdbcType="VARCHAR" />
    <result column="A_from" property="from" jdbcType="VARCHAR" />
    <result column="A_ACTIVE" property="active" jdbcType="BIT" />
  </resultMap>
  <sql id="Base_Column_List" >
    A."CuStOmEr iD" as "A_CuStOmEr iD", A."first name" as "A_first name", A.FIRST_NAME as A_FIRST_NAME,
    A.FIRSTNAME as A_FIRSTNAME, A."last name" as "A_last name", A.E_MAIL as A_E_MAIL,
    A."_id1" as "A__id1", A."$id2" as "A_$id2", A."id5_" as "A_id5_", A."id6$" as "A_id6$",
    A."id7$$" as "A_id7$$", A.EMAILADDRESS as A_EMAILADDRESS, A."from" as "A_from", A.ACTIVE as A_ACTIVE
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from "awful table" A
    where A."CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from "awful table"
    where "CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" useGeneratedKeys="true" keyProperty="customerId" >
    insert into "awful table" ("first name", FIRST_NAME,
      FIRSTNAME, "last name", E_MAIL,
      "_id1", "$id2", "id5_", "id6$",
      "id7$$", EMAILADDRESS, "from",
      ACTIVE)
    values (#{firstFirstName,jdbcType=VARCHAR}, #{secondFirstName,jdbcType=VARCHAR},
      #{thirdFirstName,jdbcType=VARCHAR}, #{lastName,jdbcType=VARCHAR}, #{eMail,jdbcType=VARCHAR},
      #{id1,jdbcType=INTEGER}, #{id2,jdbcType=INTEGER}, #{id5,jdbcType=INTEGER}, #{id6,jdbcType=INTEGER},
      #{id7,jdbcType=INTEGER}, #{emailaddress,jdbcType=VARCHAR}, #{from,jdbcType=VARCHAR},
      #{active,jdbcType=BIT})
  </insert>
  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="customerId" >
    insert into "awful table"
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="firstFirstName != null" >
        "first name",
      </if>
      <if test="secondFirstName != null" >
        FIRST_NAME,
      </if>
      <if test="thirdFirstName != null" >
        FIRSTNAME,
      </if>
      <if test="lastName != null" >
        "last name",
      </if>
      <if test="eMail != null" >
        E_MAIL,
      </if>
      <if test="id1 != null" >
        "_id1",
      </if>
      <if test="id2 != null" >
        "$id2",
      </if>
      <if test="id5 != null" >
        "id5_",
      </if>
      <if test="id6 != null" >
        "id6$",
      </if>
      <if test="id7 != null" >
        "id7$$",
      </if>
      <if test="emailaddress != null" >
        EMAILADDRESS,
      </if>
      <if test="from != null" >
        "from",
      </if>
      ACTIVE,
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="firstFirstName != null" >
        #{firstFirstName,jdbcType=VARCHAR},
      </if>
      <if test="secondFirstName != null" >
        #{secondFirstName,jdbcType=VARCHAR},
      </if>
      <if test="thirdFirstName != null" >
        #{thirdFirstName,jdbcType=VARCHAR},
      </if>
      <if test="lastName != null" >
        #{lastName,jdbcType=VARCHAR},
      </if>
      <if test="eMail != null" >
        #{eMail,jdbcType=VARCHAR},
      </if>
      <if test="id1 != null" >
        #{id1,jdbcType=INTEGER},
      </if>
      <if test="id2 != null" >
        #{id2,jdbcType=INTEGER},
      </if>
      <if test="id5 != null" >
        #{id5,jdbcType=INTEGER},
      </if>
      <if test="id6 != null" >
        #{id6,jdbcType=INTEGER},
      </if>
      <if test="id7 != null" >
        #{id7,jdbcType=INTEGER},
      </if>
      <if test="emailaddress != null" >
        #{emailaddress,jdbcType=VARCHAR},
      </if>
      <if test="from != null" >
        #{from,jdbcType=VARCHAR},
      </if>
      #{active,jdbcType=BIT},
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="org.apache.ibatis.submitted.awful_table.AwfulTable" >
    update "awful table"
    <set >
      <if test="firstFirstName != null" >
        "first name" = #{firstFirstName,jdbcType=VARCHAR},
      </if>
      <if test="secondFirstName != null" >
        FIRST_NAME = #{secondFirstName,jdbcType=VARCHAR},
      </if>
      <if test="thirdFirstName != null" >
        FIRSTNAME = #{thirdFirstName,jdbcType=VARCHAR},
      </if>
      <if test="lastName != null" >
        "last name" = #{lastName,jdbcType=VARCHAR},
      </if>
      <if test="eMail != null" >
        E_MAIL = #{eMail,jdbcType=VARCHAR},
      </if>
      <if test="id1 != null" >
        "_id1" = #{id1,jdbcType=INTEGER},
      </if>
      <if test="id2 != null" >
        "$id2" = #{id2,jdbcType=INTEGER},
      </if>
      <if test="id5 != null" >
        "id5_" = #{id5,jdbcType=INTEGER},
      </if>
      <if test="id6 != null" >
        "id6$" = #{id6,jdbcType=INTEGER},
      </if>
      <if test="id7 != null" >
        "id7$$" = #{id7,jdbcType=INTEGER},
      </if>
      <if test="emailaddress != null" >
        EMAILADDRESS = #{emailaddress,jdbcType=VARCHAR},
      </if>
      <if test="from != null" >
        "from" = #{from,jdbcType=VARCHAR},
      </if>
      <if test="active != null" >
        ACTIVE = #{active,jdbcType=BIT},
      </if>
    </set>
    where "CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.apache.ibatis.submitted.awful_table.AwfulTable" >
    update "awful table"
    set "first name" = #{firstFirstName,jdbcType=VARCHAR},
      FIRST_NAME = #{secondFirstName,jdbcType=VARCHAR},
      FIRSTNAME = #{thirdFirstName,jdbcType=VARCHAR},
      "last name" = #{lastName,jdbcType=VARCHAR},
      E_MAIL = #{eMail,jdbcType=VARCHAR},
      "_id1" = #{id1,jdbcType=INTEGER},
      "$id2" = #{id2,jdbcType=INTEGER},
      "id5_" = #{id5,jdbcType=INTEGER},
      "id6$" = #{id6,jdbcType=INTEGER},
      "id7$$" = #{id7,jdbcType=INTEGER},
      EMAILADDRESS = #{emailaddress,jdbcType=VARCHAR},
      "from" = #{from,jdbcType=VARCHAR},
      ACTIVE = #{active,jdbcType=BIT}
    where "CuStOmEr iD" = #{customerId,jdbcType=INTEGER}
  </update>
</mapper>
