<?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="cn.superdesk.uniorder.dao.mapper.base.UnifiedOrderUpdateMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdate">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
    <result column="pay_state" jdbcType="TINYINT" property="payState" />
    <result column="order_state" jdbcType="TINYINT" property="orderState" />
    <result column="order_state_name" jdbcType="VARCHAR" property="orderStateName" />
    <result column="complet_state" jdbcType="TINYINT" property="completState" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="user_id" jdbcType="BIGINT" property="userId" />
    <result column="user_type" jdbcType="VARCHAR" property="userType" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    <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">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    <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">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    id, order_sn, pay_state, order_state, order_state_name, complet_state, user_name, 
    user_id, user_type, create_time
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdateExample" resultMap="BaseResultMap">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from unified_order_update
    <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">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    select 
    <include refid="Base_Column_List" />
    from unified_order_update
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    delete from unified_order_update
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdateExample">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    delete from unified_order_update
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdate">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_update (order_sn, pay_state, order_state, 
      order_state_name, complet_state, user_name, 
      user_id, user_type, create_time
      )
    values (#{orderSn,jdbcType=VARCHAR}, #{payState,jdbcType=TINYINT}, #{orderState,jdbcType=TINYINT}, 
      #{orderStateName,jdbcType=VARCHAR}, #{completState,jdbcType=TINYINT}, #{userName,jdbcType=VARCHAR}, 
      #{userId,jdbcType=BIGINT}, #{userType,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdate">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_update
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orderSn != null">
        order_sn,
      </if>
      <if test="payState != null">
        pay_state,
      </if>
      <if test="orderState != null">
        order_state,
      </if>
      <if test="orderStateName != null">
        order_state_name,
      </if>
      <if test="completState != null">
        complet_state,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="userId != null">
        user_id,
      </if>
      <if test="userType != null">
        user_type,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orderSn != null">
        #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="payState != null">
        #{payState,jdbcType=TINYINT},
      </if>
      <if test="orderState != null">
        #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="completState != null">
        #{completState,jdbcType=TINYINT},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        #{userId,jdbcType=BIGINT},
      </if>
      <if test="userType != null">
        #{userType,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdateExample" resultType="java.lang.Long">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    select count(*) from unified_order_update
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    update unified_order_update
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.orderSn != null">
        order_sn = #{record.orderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.payState != null">
        pay_state = #{record.payState,jdbcType=TINYINT},
      </if>
      <if test="record.orderState != null">
        order_state = #{record.orderState,jdbcType=TINYINT},
      </if>
      <if test="record.orderStateName != null">
        order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.completState != null">
        complet_state = #{record.completState,jdbcType=TINYINT},
      </if>
      <if test="record.userName != null">
        user_name = #{record.userName,jdbcType=VARCHAR},
      </if>
      <if test="record.userId != null">
        user_id = #{record.userId,jdbcType=BIGINT},
      </if>
      <if test="record.userType != null">
        user_type = #{record.userType,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    update unified_order_update
    set id = #{record.id,jdbcType=BIGINT},
      order_sn = #{record.orderSn,jdbcType=VARCHAR},
      pay_state = #{record.payState,jdbcType=TINYINT},
      order_state = #{record.orderState,jdbcType=TINYINT},
      order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      complet_state = #{record.completState,jdbcType=TINYINT},
      user_name = #{record.userName,jdbcType=VARCHAR},
      user_id = #{record.userId,jdbcType=BIGINT},
      user_type = #{record.userType,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdate">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    update unified_order_update
    <set>
      <if test="orderSn != null">
        order_sn = #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="payState != null">
        pay_state = #{payState,jdbcType=TINYINT},
      </if>
      <if test="orderState != null">
        order_state = #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        order_state_name = #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="completState != null">
        complet_state = #{completState,jdbcType=TINYINT},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        user_id = #{userId,jdbcType=BIGINT},
      </if>
      <if test="userType != null">
        user_type = #{userType,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.base.UnifiedOrderUpdate">
    <!--


      This element was generated on Mon Jun 22 21:17:34 CST 2020.
    -->
    update unified_order_update
    set order_sn = #{orderSn,jdbcType=VARCHAR},
      pay_state = #{payState,jdbcType=TINYINT},
      order_state = #{orderState,jdbcType=TINYINT},
      order_state_name = #{orderStateName,jdbcType=VARCHAR},
      complet_state = #{completState,jdbcType=TINYINT},
      user_name = #{userName,jdbcType=VARCHAR},
      user_id = #{userId,jdbcType=BIGINT},
      user_type = #{userType,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>