<?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.order.dao.mapper.interfaces.TOrderMapper" >
  <resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
    <id column="ORDER_ID" property="orderId" jdbcType="VARCHAR" />
    <result column="RESOURCE_ID" property="resourceId" jdbcType="INTEGER" />
    <result column="PHONE_NUMBER" property="phoneNumber" jdbcType="VARCHAR" />
    <result column="PACKAGE_ID" property="packageId" jdbcType="INTEGER" />
    <result column="MAIL_ACCOUNT" property="mailAccount" 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" >
    ORDER_ID, RESOURCE_ID, PHONE_NUMBER, PACKAGE_ID, MAIL_ACCOUNT
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrderCriteria" >
    select
    <if test="distinct" >
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from t_order
    <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="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from t_order
    where ORDER_ID = #{orderId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from t_order
    where ORDER_ID = #{orderId,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrderCriteria" >
    delete from t_order
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
    insert into t_order (ORDER_ID, RESOURCE_ID, PHONE_NUMBER, 
      PACKAGE_ID, MAIL_ACCOUNT)
    values (#{orderId,jdbcType=VARCHAR}, #{resourceId,jdbcType=INTEGER}, #{phoneNumber,jdbcType=VARCHAR}, 
      #{packageId,jdbcType=INTEGER}, #{mailAccount,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
    insert into t_order
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="orderId != null" >
        ORDER_ID,
      </if>
      RESOURCE_ID,
      <if test="phoneNumber != null" >
        PHONE_NUMBER,
      </if>
      PACKAGE_ID,
      <if test="mailAccount != null" >
        MAIL_ACCOUNT,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="orderId != null" >
        #{orderId,jdbcType=VARCHAR},
      </if>
      #{resourceId,jdbcType=INTEGER},
      <if test="phoneNumber != null" >
        #{phoneNumber,jdbcType=VARCHAR},
      </if>
      #{packageId,jdbcType=INTEGER},
      <if test="mailAccount != null" >
        #{mailAccount,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrderCriteria" resultType="java.lang.Integer" >
    select count(*) from t_order
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update t_order
    <set >
      <if test="record.orderId != null" >
        ORDER_ID = #{record.orderId,jdbcType=VARCHAR},
      </if>
      <if test="record.resourceId != null" >
        RESOURCE_ID = #{record.resourceId,jdbcType=INTEGER},
      </if>
      <if test="record.phoneNumber != null" >
        PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.packageId != null" >
        PACKAGE_ID = #{record.packageId,jdbcType=INTEGER},
      </if>
      <if test="record.mailAccount != null" >
        MAIL_ACCOUNT = #{record.mailAccount,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update t_order
    set ORDER_ID = #{record.orderId,jdbcType=VARCHAR},
      RESOURCE_ID = #{record.resourceId,jdbcType=INTEGER},
      PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
      PACKAGE_ID = #{record.packageId,jdbcType=INTEGER},
      MAIL_ACCOUNT = #{record.mailAccount,jdbcType=VARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
    update t_order
    <set >
      <if test="resourceId != null" >
        RESOURCE_ID = #{resourceId,jdbcType=INTEGER},
      </if>
      <if test="phoneNumber != null" >
        PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
      </if>
      <if test="packageId != null" >
        PACKAGE_ID = #{packageId,jdbcType=INTEGER},
      </if>
      <if test="mailAccount != null" >
        MAIL_ACCOUNT = #{mailAccount,jdbcType=VARCHAR},
      </if>
    </set>
    where ORDER_ID = #{orderId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
    update t_order
    set RESOURCE_ID = #{resourceId,jdbcType=INTEGER},
      PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
      PACKAGE_ID = #{packageId,jdbcType=INTEGER},
      MAIL_ACCOUNT = #{mailAccount,jdbcType=VARCHAR}
    where ORDER_ID = #{orderId,jdbcType=VARCHAR}
  </update>
</mapper>