<?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.ai.cloud.skywalking.example.account.dao.mapper.interfaces.TAccountMapper" >
  <resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
    <id column="ACCOUNT_ID" property="accountId" jdbcType="INTEGER" />
    <result column="PHONE_NUMBER" property="phoneNumber" jdbcType="VARCHAR" />
    <result column="MAIL" property="mail" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause" >
    <where >
      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    ACCOUNT_ID, PHONE_NUMBER, MAIL
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccountCriteria" >
    select
    <if test="distinct" >
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from t_account
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
    <if test="limitStart != null and limitStart>=0" >
      limit #{limitStart} , #{limitEnd}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="int" >
    select 
    <include refid="Base_Column_List" />
    from t_account
    where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="int" >
    delete from t_account
    where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccountCriteria" >
    delete from t_account
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
    insert into t_account (ACCOUNT_ID, PHONE_NUMBER, MAIL
      )
    values (#{accountId,jdbcType=INTEGER}, #{phoneNumber,jdbcType=VARCHAR}, #{mail,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
    insert into t_account
    <trim prefix="(" suffix=")" suffixOverrides="," >
      ACCOUNT_ID,
      <if test="phoneNumber != null" >
        PHONE_NUMBER,
      </if>
      <if test="mail != null" >
        MAIL,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      #{accountId,jdbcType=INTEGER},
      <if test="phoneNumber != null" >
        #{phoneNumber,jdbcType=VARCHAR},
      </if>
      <if test="mail != null" >
        #{mail,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccountCriteria" resultType="java.lang.Integer" >
    select count(*) from t_account
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update t_account
    <set >
      <if test="record.accountId != null" >
        ACCOUNT_ID = #{record.accountId,jdbcType=INTEGER},
      </if>
      <if test="record.phoneNumber != null" >
        PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.mail != null" >
        MAIL = #{record.mail,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update t_account
    set ACCOUNT_ID = #{record.accountId,jdbcType=INTEGER},
      PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
      MAIL = #{record.mail,jdbcType=VARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
    update t_account
    <set >
      <if test="phoneNumber != null" >
        PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
      </if>
      <if test="mail != null" >
        MAIL = #{mail,jdbcType=VARCHAR},
      </if>
    </set>
    where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
    update t_account
    set PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
      MAIL = #{mail,jdbcType=VARCHAR}
    where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
  </update>
</mapper>