<?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.zcxk.order.dao.WorkFlowDetailMapper" >
  <resultMap id="BaseResultMap" type="com.zcxk.order.entity.WorkFlowDetail" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="flow_id" property="flowId" jdbcType="INTEGER" />
    <result column="flow_type" property="flowType" jdbcType="INTEGER" />
    <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP" />
    <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
    <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.zcxk.order.entity.WorkFlowDetail" extends="BaseResultMap" >
    <result column="flow_detail" property="flowDetail" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, flow_id, flow_type, create_by, date_create, update_by, date_update
  </sql>
  <sql id="Blob_Column_List" >
    flow_detail
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sc_work_flow_detail
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from sc_work_flow_detail
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.zcxk.order.entity.WorkFlowDetail" >
    insert into sc_work_flow_detail (id, flow_id, flow_type, 
      create_by, date_create, update_by, 
      date_update, flow_detail)
    values (#{id,jdbcType=INTEGER}, #{flowId,jdbcType=INTEGER}, #{flowType,jdbcType=INTEGER}, 
      #{createBy,jdbcType=VARCHAR}, #{dateCreate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, 
      #{dateUpdate,jdbcType=TIMESTAMP}, #{flowDetail,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zcxk.order.entity.WorkFlowDetail" >
    insert into sc_work_flow_detail
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="flowId != null" >
        flow_id,
      </if>
      <if test="flowType != null" >
        flow_type,
      </if>
      <if test="createBy != null" >
        create_by,
      </if>
      <if test="dateCreate != null" >
        date_create,
      </if>
      <if test="updateBy != null" >
        update_by,
      </if>
      <if test="dateUpdate != null" >
        date_update,
      </if>
      <if test="flowDetail != null" >
        flow_detail,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="flowId != null" >
        #{flowId,jdbcType=INTEGER},
      </if>
      <if test="flowType != null" >
        #{flowType,jdbcType=INTEGER},
      </if>
      <if test="createBy != null" >
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="dateCreate != null" >
        #{dateCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null" >
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="dateUpdate != null" >
        #{dateUpdate,jdbcType=TIMESTAMP},
      </if>
      <if test="flowDetail != null" >
        #{flowDetail,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.order.entity.WorkFlowDetail" >
    update sc_work_flow_detail
    <set >
      <if test="flowId != null" >
        flow_id = #{flowId,jdbcType=INTEGER},
      </if>
      <if test="flowType != null" >
        flow_type = #{flowType,jdbcType=INTEGER},
      </if>
      <if test="createBy != null" >
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="dateCreate != null" >
        date_create = #{dateCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null" >
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="dateUpdate != null" >
        date_update = #{dateUpdate,jdbcType=TIMESTAMP},
      </if>
      <if test="flowDetail != null" >
        flow_detail = #{flowDetail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zcxk.order.entity.WorkFlowDetail" >
    update sc_work_flow_detail
    set flow_id = #{flowId,jdbcType=INTEGER},
      flow_type = #{flowType,jdbcType=INTEGER},
      create_by = #{createBy,jdbcType=VARCHAR},
      date_create = #{dateCreate,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      date_update = #{dateUpdate,jdbcType=TIMESTAMP},
      flow_detail = #{flowDetail,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zcxk.order.entity.WorkFlowDetail" >
    update sc_work_flow_detail
    set flow_id = #{flowId,jdbcType=INTEGER},
      flow_type = #{flowType,jdbcType=INTEGER},
      create_by = #{createBy,jdbcType=VARCHAR},
      date_create = #{dateCreate,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      date_update = #{dateUpdate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectDetailId" resultType="java.lang.Integer">
    select id
    from sc_work_flow_detail
    where flow_id= #{flowId} and flow_type=#{flowType}
  </select>
</mapper>