<?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.AftFileMapper" >
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.AftFile" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="uid" property="uid" jdbcType="VARCHAR" />
    <result column="file_name" property="fileName" jdbcType="VARCHAR" />
    <result column="file_path" property="filePath" jdbcType="VARCHAR" />
    <result column="sign" property="sign" jdbcType="VARCHAR" />
    <result column="comment" property="comment" jdbcType="VARCHAR" />
    <result column="deleleted_sign" property="deleletedSign" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, uid, file_name, file_path, sign, comment, deleleted_sign
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from aft_file
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from aft_file
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.AftFile" >
    insert into aft_file (id, uid, file_name, 
      file_path, sign, comment, 
      deleleted_sign)
    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, 
      #{filePath,jdbcType=VARCHAR}, #{sign,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, 
      #{deleletedSign,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.AftFile" >
    insert into aft_file
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="uid != null" >
        uid,
      </if>
      <if test="fileName != null" >
        file_name,
      </if>
      <if test="filePath != null" >
        file_path,
      </if>
      <if test="sign != null" >
        sign,
      </if>
      <if test="comment != null" >
        comment,
      </if>
      <if test="deleletedSign != null" >
        deleleted_sign,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="uid != null" >
        #{uid,jdbcType=VARCHAR},
      </if>
      <if test="fileName != null" >
        #{fileName,jdbcType=VARCHAR},
      </if>
      <if test="filePath != null" >
        #{filePath,jdbcType=VARCHAR},
      </if>
      <if test="sign != null" >
        #{sign,jdbcType=VARCHAR},
      </if>
      <if test="comment != null" >
        #{comment,jdbcType=VARCHAR},
      </if>
      <if test="deleletedSign != null" >
        #{deleletedSign,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AftFile" >
    update aft_file
    <set >
      <if test="uid != null" >
        uid = #{uid,jdbcType=VARCHAR},
      </if>
      <if test="fileName != null" >
        file_name = #{fileName,jdbcType=VARCHAR},
      </if>
      <if test="filePath != null" >
        file_path = #{filePath,jdbcType=VARCHAR},
      </if>
      <if test="sign != null" >
        sign = #{sign,jdbcType=VARCHAR},
      </if>
      <if test="comment != null" >
        comment = #{comment,jdbcType=VARCHAR},
      </if>
      <if test="deleletedSign != null" >
        deleleted_sign = #{deleletedSign,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AftFile" >
    update aft_file
    set uid = #{uid,jdbcType=VARCHAR},
      file_name = #{fileName,jdbcType=VARCHAR},
      file_path = #{filePath,jdbcType=VARCHAR},
      sign = #{sign,jdbcType=VARCHAR},
      comment = #{comment,jdbcType=VARCHAR},
      deleleted_sign = #{deleletedSign,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  
   <select id="selectAftFileBySign" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from aft_file
    where sign = #{sign,jdbcType=VARCHAR}
  </select>
</mapper>