<?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.MemberOrderMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.MemberOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="menber_type" jdbcType="INTEGER" property="menberType" />
    <result column="price" jdbcType="DOUBLE" property="price" />
    <result column="valid_month" jdbcType="INTEGER" property="validMonth" />
    <result column="order_state" jdbcType="INTEGER" property="orderState" />
    <result column="order_time" jdbcType="TIMESTAMP" property="orderTime" />
    <result column="user_id" jdbcType="VARCHAR" property="userId" />
    <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" />
    <result column="payment_value" jdbcType="DOUBLE" property="paymentValue" />
    <result column="payment_type" jdbcType="VARCHAR" property="paymentType" />
    <result column="payment_id" jdbcType="VARCHAR" property="paymentId" />
    <result column="valid_time" jdbcType="TIMESTAMP" property="validTime" />
    <result column="source_channel" jdbcType="INTEGER" property="sourceChannel" />
    <result column="pay_state" jdbcType="INTEGER" property="payState" />
  </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 Fri Nov 10 19:10:10 CST 2017.
    -->
    <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 Fri Nov 10 19:10:10 CST 2017.
    -->
    <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 Fri Nov 10 19:10:10 CST 2017.
    -->
    id, menber_type, price, valid_month, order_state, order_time, user_id, payment_time, 
    payment_value, payment_type, payment_id, valid_time, source_channel, pay_state
  </sql>
  <select id="selectByExample" parameterType="com.goafanti.common.model.MemberOrderExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from member_order
    <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.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    select 
    <include refid="Base_Column_List" />
    from member_order
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    delete from member_order
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.MemberOrderExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    delete from member_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.MemberOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    insert into member_order (id, menber_type, price, 
      valid_month, order_state, order_time, 
      user_id, payment_time, payment_value, 
      payment_type, payment_id, valid_time, 
      source_channel, pay_state)
    values (#{id,jdbcType=BIGINT}, #{menberType,jdbcType=INTEGER}, #{price,jdbcType=DOUBLE}, 
      #{validMonth,jdbcType=INTEGER}, #{orderState,jdbcType=INTEGER}, #{orderTime,jdbcType=TIMESTAMP}, 
      #{userId,jdbcType=VARCHAR}, #{paymentTime,jdbcType=TIMESTAMP}, #{paymentValue,jdbcType=DOUBLE}, 
      #{paymentType,jdbcType=VARCHAR}, #{paymentId,jdbcType=VARCHAR}, #{validTime,jdbcType=TIMESTAMP}, 
      #{sourceChannel,jdbcType=INTEGER}, #{payState,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.MemberOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    insert into member_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="menberType != null">
        menber_type,
      </if>
      <if test="price != null">
        price,
      </if>
      <if test="validMonth != null">
        valid_month,
      </if>
      <if test="orderState != null">
        order_state,
      </if>
      <if test="orderTime != null">
        order_time,
      </if>
      <if test="userId != null">
        user_id,
      </if>
      <if test="paymentTime != null">
        payment_time,
      </if>
      <if test="paymentValue != null">
        payment_value,
      </if>
      <if test="paymentType != null">
        payment_type,
      </if>
      <if test="paymentId != null">
        payment_id,
      </if>
      <if test="validTime != null">
        valid_time,
      </if>
      <if test="sourceChannel != null">
        source_channel,
      </if>
      <if test="payState != null">
        pay_state,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="menberType != null">
        #{menberType,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        #{price,jdbcType=DOUBLE},
      </if>
      <if test="validMonth != null">
        #{validMonth,jdbcType=INTEGER},
      </if>
      <if test="orderState != null">
        #{orderState,jdbcType=INTEGER},
      </if>
      <if test="orderTime != null">
        #{orderTime,jdbcType=TIMESTAMP},
      </if>
      <if test="userId != null">
        #{userId,jdbcType=VARCHAR},
      </if>
      <if test="paymentTime != null">
        #{paymentTime,jdbcType=TIMESTAMP},
      </if>
      <if test="paymentValue != null">
        #{paymentValue,jdbcType=DOUBLE},
      </if>
      <if test="paymentType != null">
        #{paymentType,jdbcType=VARCHAR},
      </if>
      <if test="paymentId != null">
        #{paymentId,jdbcType=VARCHAR},
      </if>
      <if test="validTime != null">
        #{validTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sourceChannel != null">
        #{sourceChannel,jdbcType=INTEGER},
      </if>
      <if test="payState != null">
        #{payState,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.MemberOrderExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    select count(*) from member_order
    <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 Fri Nov 10 19:10:10 CST 2017.
    -->
    update member_order
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.menberType != null">
        menber_type = #{record.menberType,jdbcType=INTEGER},
      </if>
      <if test="record.price != null">
        price = #{record.price,jdbcType=DOUBLE},
      </if>
      <if test="record.validMonth != null">
        valid_month = #{record.validMonth,jdbcType=INTEGER},
      </if>
      <if test="record.orderState != null">
        order_state = #{record.orderState,jdbcType=INTEGER},
      </if>
      <if test="record.orderTime != null">
        order_time = #{record.orderTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.userId != null">
        user_id = #{record.userId,jdbcType=VARCHAR},
      </if>
      <if test="record.paymentTime != null">
        payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.paymentValue != null">
        payment_value = #{record.paymentValue,jdbcType=DOUBLE},
      </if>
      <if test="record.paymentType != null">
        payment_type = #{record.paymentType,jdbcType=VARCHAR},
      </if>
      <if test="record.paymentId != null">
        payment_id = #{record.paymentId,jdbcType=VARCHAR},
      </if>
      <if test="record.validTime != null">
        valid_time = #{record.validTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.sourceChannel != null">
        source_channel = #{record.sourceChannel,jdbcType=INTEGER},
      </if>
      <if test="record.payState != null">
        pay_state = #{record.payState,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 Fri Nov 10 19:10:10 CST 2017.
    -->
    update member_order
    set id = #{record.id,jdbcType=BIGINT},
      menber_type = #{record.menberType,jdbcType=INTEGER},
      price = #{record.price,jdbcType=DOUBLE},
      valid_month = #{record.validMonth,jdbcType=INTEGER},
      order_state = #{record.orderState,jdbcType=INTEGER},
      order_time = #{record.orderTime,jdbcType=TIMESTAMP},
      user_id = #{record.userId,jdbcType=VARCHAR},
      payment_time = #{record.paymentTime,jdbcType=TIMESTAMP},
      payment_value = #{record.paymentValue,jdbcType=DOUBLE},
      payment_type = #{record.paymentType,jdbcType=VARCHAR},
      payment_id = #{record.paymentId,jdbcType=VARCHAR},
      valid_time = #{record.validTime,jdbcType=TIMESTAMP},
      source_channel = #{record.sourceChannel,jdbcType=INTEGER},
      pay_state = #{record.payState,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.MemberOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    update member_order
    <set>
      <if test="menberType != null">
        menber_type = #{menberType,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        price = #{price,jdbcType=DOUBLE},
      </if>
      <if test="validMonth != null">
        valid_month = #{validMonth,jdbcType=INTEGER},
      </if>
      <if test="orderState != null">
        order_state = #{orderState,jdbcType=INTEGER},
      </if>
      <if test="orderTime != null">
        order_time = #{orderTime,jdbcType=TIMESTAMP},
      </if>
      <if test="userId != null">
        user_id = #{userId,jdbcType=VARCHAR},
      </if>
      <if test="paymentTime != null">
        payment_time = #{paymentTime,jdbcType=TIMESTAMP},
      </if>
      <if test="paymentValue != null">
        payment_value = #{paymentValue,jdbcType=DOUBLE},
      </if>
      <if test="paymentType != null">
        payment_type = #{paymentType,jdbcType=VARCHAR},
      </if>
      <if test="paymentId != null">
        payment_id = #{paymentId,jdbcType=VARCHAR},
      </if>
      <if test="validTime != null">
        valid_time = #{validTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sourceChannel != null">
        source_channel = #{sourceChannel,jdbcType=INTEGER},
      </if>
      <if test="payState != null">
        pay_state = #{payState,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.MemberOrder">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Nov 10 19:10:10 CST 2017.
    -->
    update member_order
    set menber_type = #{menberType,jdbcType=INTEGER},
      price = #{price,jdbcType=DOUBLE},
      valid_month = #{validMonth,jdbcType=INTEGER},
      order_state = #{orderState,jdbcType=INTEGER},
      order_time = #{orderTime,jdbcType=TIMESTAMP},
      user_id = #{userId,jdbcType=VARCHAR},
      payment_time = #{paymentTime,jdbcType=TIMESTAMP},
      payment_value = #{paymentValue,jdbcType=DOUBLE},
      payment_type = #{paymentType,jdbcType=VARCHAR},
      payment_id = #{paymentId,jdbcType=VARCHAR},
      valid_time = #{validTime,jdbcType=TIMESTAMP},
      source_channel = #{sourceChannel,jdbcType=INTEGER},
      pay_state = #{payState,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>