<?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.TmpTableMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TmpTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    <id column="order_no" jdbcType="VARCHAR" property="orderNo" />
    <result column="all_count" jdbcType="INTEGER" property="allCount" />
    <result column="dis_count" jdbcType="INTEGER" property="disCount" />
  </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 Wed Apr 11 14:10:27 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 Wed Apr 11 14:10:27 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 Wed Apr 11 14:10:27 CST 2018.
    -->
    order_no, all_count, dis_count
  </sql>
  <select id="selectByExample" parameterType="com.goafanti.common.model.TmpTableExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tmp_table
    <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 Wed Apr 11 14:10:27 CST 2018.
    -->
    select 
    <include refid="Base_Column_List" />
    from tmp_table
    where order_no = #{orderNo,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 Wed Apr 11 14:10:27 CST 2018.
    -->
    delete from tmp_table
    where order_no = #{orderNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TmpTableExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    delete from tmp_table
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.TmpTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    insert into tmp_table (order_no, all_count, dis_count
      )
    values (#{orderNo,jdbcType=VARCHAR}, #{allCount,jdbcType=INTEGER}, #{disCount,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.TmpTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    insert into tmp_table
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orderNo != null">
        order_no,
      </if>
      <if test="allCount != null">
        all_count,
      </if>
      <if test="disCount != null">
        dis_count,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orderNo != null">
        #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="allCount != null">
        #{allCount,jdbcType=INTEGER},
      </if>
      <if test="disCount != null">
        #{disCount,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.TmpTableExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    select count(*) from tmp_table
    <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 Wed Apr 11 14:10:27 CST 2018.
    -->
    update tmp_table
    <set>
      <if test="record.orderNo != null">
        order_no = #{record.orderNo,jdbcType=VARCHAR},
      </if>
      <if test="record.allCount != null">
        all_count = #{record.allCount,jdbcType=INTEGER},
      </if>
      <if test="record.disCount != null">
        dis_count = #{record.disCount,jdbcType=INTEGER},
      </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 Wed Apr 11 14:10:27 CST 2018.
    -->
    update tmp_table
    set order_no = #{record.orderNo,jdbcType=VARCHAR},
      all_count = #{record.allCount,jdbcType=INTEGER},
      dis_count = #{record.disCount,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TmpTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    update tmp_table
    <set>
      <if test="allCount != null">
        all_count = #{allCount,jdbcType=INTEGER},
      </if>
      <if test="disCount != null">
        dis_count = #{disCount,jdbcType=INTEGER},
      </if>
    </set>
    where order_no = #{orderNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TmpTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Apr 11 14:10:27 CST 2018.
    -->
    update tmp_table
    set all_count = #{allCount,jdbcType=INTEGER},
      dis_count = #{disCount,jdbcType=INTEGER}
    where order_no = #{orderNo,jdbcType=VARCHAR}
  </update>
  
  <select id="selectAll" resultMap="BaseResultMap">
  	select order_no,all_count,dis_count from tmp_table
  </select>
</mapper>