<?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.DemandLogMapper" >
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandLog" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="demand_id" property="demandId" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="INTEGER" />
    <result column="operator" property="operator" jdbcType="VARCHAR" />
    <result column="principal" property="principal" jdbcType="VARCHAR" />
    <result column="recored_time" property="recoredTime" jdbcType="TIMESTAMP" />
    <result column="comment" property="comment" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, demand_id, status, operator, principal, recored_time, comment
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from demand_log
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from demand_log
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.DemandLog" >
    insert into demand_log (id, demand_id, status, 
      operator, principal, recored_time, 
      comment)
    values (#{id,jdbcType=VARCHAR}, #{demandId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{operator,jdbcType=VARCHAR}, #{principal,jdbcType=VARCHAR}, #{recoredTime,jdbcType=TIMESTAMP}, 
      #{comment,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandLog" >
    insert into demand_log
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="demandId != null" >
        demand_id,
      </if>
      <if test="status != null" >
        status,
      </if>
      <if test="operator != null" >
        operator,
      </if>
      <if test="principal != null" >
        principal,
      </if>
      <if test="recoredTime != null" >
        recored_time,
      </if>
      <if test="comment != null" >
        comment,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="demandId != null" >
        #{demandId,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
      <if test="operator != null" >
        #{operator,jdbcType=VARCHAR},
      </if>
      <if test="principal != null" >
        #{principal,jdbcType=VARCHAR},
      </if>
      <if test="recoredTime != null" >
        #{recoredTime,jdbcType=TIMESTAMP},
      </if>
      <if test="comment != null" >
        #{comment,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandLog" >
    update demand_log
    <set >
      <if test="demandId != null" >
        demand_id = #{demandId,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="operator != null" >
        operator = #{operator,jdbcType=VARCHAR},
      </if>
      <if test="principal != null" >
        principal = #{principal,jdbcType=VARCHAR},
      </if>
      <if test="recoredTime != null" >
        recored_time = #{recoredTime,jdbcType=TIMESTAMP},
      </if>
      <if test="comment != null" >
        comment = #{comment,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandLog" >
    update demand_log
    set demand_id = #{demandId,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      operator = #{operator,jdbcType=VARCHAR},
      principal = #{principal,jdbcType=VARCHAR},
      recored_time = #{recoredTime,jdbcType=TIMESTAMP},
      comment = #{comment,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>