<?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.operation.UnifiedOrderIssuesFlowingMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowing">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="uid" jdbcType="VARCHAR" property="uid" />
    <result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="process_result" jdbcType="TINYINT" property="processResult" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowing">
    <result column="source_json" jdbcType="LONGVARCHAR" property="sourceJson" />
    <result column="process_json" jdbcType="LONGVARCHAR" property="processJson" />
    <result column="process_report" jdbcType="LONGVARCHAR" property="processReport" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, uid, order_sn, create_time, process_result
  </sql>
  <sql id="Blob_Column_List">
    source_json, process_json, process_report
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowingExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from unified_order_issues_flowing
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowingExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from unified_order_issues_flowing
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from unified_order_issues_flowing
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from unified_order_issues_flowing
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowingExample">
    delete from unified_order_issues_flowing
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowing">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_issues_flowing (uid, order_sn, create_time, 
      process_result, source_json, process_json, 
      process_report)
    values (#{uid,jdbcType=VARCHAR}, #{orderSn,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{processResult,jdbcType=TINYINT}, #{sourceJson,jdbcType=LONGVARCHAR}, #{processJson,jdbcType=LONGVARCHAR}, 
      #{processReport,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowing">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_order_issues_flowing
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="uid != null">
        uid,
      </if>
      <if test="orderSn != null">
        order_sn,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="processResult != null">
        process_result,
      </if>
      <if test="sourceJson != null">
        source_json,
      </if>
      <if test="processJson != null">
        process_json,
      </if>
      <if test="processReport != null">
        process_report,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="uid != null">
        #{uid,jdbcType=VARCHAR},
      </if>
      <if test="orderSn != null">
        #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="processResult != null">
        #{processResult,jdbcType=TINYINT},
      </if>
      <if test="sourceJson != null">
        #{sourceJson,jdbcType=LONGVARCHAR},
      </if>
      <if test="processJson != null">
        #{processJson,jdbcType=LONGVARCHAR},
      </if>
      <if test="processReport != null">
        #{processReport,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowingExample" resultType="java.lang.Long">
    select count(*) from unified_order_issues_flowing
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update unified_order_issues_flowing
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.uid != null">
        uid = #{record.uid,jdbcType=VARCHAR},
      </if>
      <if test="record.orderSn != null">
        order_sn = #{record.orderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.processResult != null">
        process_result = #{record.processResult,jdbcType=TINYINT},
      </if>
      <if test="record.sourceJson != null">
        source_json = #{record.sourceJson,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.processJson != null">
        process_json = #{record.processJson,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.processReport != null">
        process_report = #{record.processReport,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update unified_order_issues_flowing
    set id = #{record.id,jdbcType=BIGINT},
      uid = #{record.uid,jdbcType=VARCHAR},
      order_sn = #{record.orderSn,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      process_result = #{record.processResult,jdbcType=TINYINT},
      source_json = #{record.sourceJson,jdbcType=LONGVARCHAR},
      process_json = #{record.processJson,jdbcType=LONGVARCHAR},
      process_report = #{record.processReport,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update unified_order_issues_flowing
    set id = #{record.id,jdbcType=BIGINT},
      uid = #{record.uid,jdbcType=VARCHAR},
      order_sn = #{record.orderSn,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      process_result = #{record.processResult,jdbcType=TINYINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowing">
    update unified_order_issues_flowing
    <set>
      <if test="uid != null">
        uid = #{uid,jdbcType=VARCHAR},
      </if>
      <if test="orderSn != null">
        order_sn = #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="processResult != null">
        process_result = #{processResult,jdbcType=TINYINT},
      </if>
      <if test="sourceJson != null">
        source_json = #{sourceJson,jdbcType=LONGVARCHAR},
      </if>
      <if test="processJson != null">
        process_json = #{processJson,jdbcType=LONGVARCHAR},
      </if>
      <if test="processReport != null">
        process_report = #{processReport,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowing">
    update unified_order_issues_flowing
    set uid = #{uid,jdbcType=VARCHAR},
      order_sn = #{orderSn,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      process_result = #{processResult,jdbcType=TINYINT},
      source_json = #{sourceJson,jdbcType=LONGVARCHAR},
      process_json = #{processJson,jdbcType=LONGVARCHAR},
      process_report = #{processReport,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.operation.UnifiedOrderIssuesFlowing">
    update unified_order_issues_flowing
    set uid = #{uid,jdbcType=VARCHAR},
      order_sn = #{orderSn,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      process_result = #{processResult,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>