<?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.ejweb.modules.reportAttachment.dao.ReportAttachmentMapper" >
  <resultMap id="BaseResultMap" type="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="report_id" property="reportId" jdbcType="VARCHAR" />
    <result column="attachment_name" property="attachmentName" jdbcType="VARCHAR" />
    <result column="attachment_path" property="attachmentPath" jdbcType="VARCHAR" />
    <result column="attachment_size" property="attachmentSize" jdbcType="INTEGER" />
    <result column="attachment_type" property="attachmentType" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, report_id, attachment_name, attachment_path, attachment_size, attachment_type
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from ct_bbtc_report_attachment
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from ct_bbtc_report_attachment
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
    insert into ct_bbtc_report_attachment (id, report_id, attachment_name,
      attachment_path, attachment_size, attachment_type
      )
    values (#{id,jdbcType=VARCHAR}, #{reportId,jdbcType=VARCHAR}, #{attachmentName,jdbcType=VARCHAR}, 
      #{attachmentPath,jdbcType=VARCHAR}, #{attachmentSize,jdbcType=INTEGER}, #{attachmentType,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
    insert into ct_bbtc_report_attachment
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="reportId != null" >
        report_id,
      </if>
      <if test="attachmentName != null" >
        attachment_name,
      </if>
      <if test="attachmentPath != null" >
        attachment_path,
      </if>
      <if test="attachmentSize != null" >
        attachment_size,
      </if>
      <if test="attachmentType != null" >
        attachment_type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="reportId != null" >
        #{reportId,jdbcType=VARCHAR},
      </if>
      <if test="attachmentName != null" >
        #{attachmentName,jdbcType=VARCHAR},
      </if>
      <if test="attachmentPath != null" >
        #{attachmentPath,jdbcType=VARCHAR},
      </if>
      <if test="attachmentSize != null" >
        #{attachmentSize,jdbcType=INTEGER},
      </if>
      <if test="attachmentType != null" >
        #{attachmentType,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
    update ct_bbtc_report_attachment
    <set >
      <if test="reportId != null" >
        report_id = #{reportId,jdbcType=VARCHAR},
      </if>
      <if test="attachmentName != null" >
        attachment_name = #{attachmentName,jdbcType=VARCHAR},
      </if>
      <if test="attachmentPath != null" >
        attachment_path = #{attachmentPath,jdbcType=VARCHAR},
      </if>
      <if test="attachmentSize != null" >
        attachment_size = #{attachmentSize,jdbcType=INTEGER},
      </if>
      <if test="attachmentType != null" >
        attachment_type = #{attachmentType,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ejweb.modules.reportAttachment.entity.ReportAttachment" >
    update ct_bbtc_report_attachment
    set report_id = #{reportId,jdbcType=VARCHAR},
      attachment_name = #{attachmentName,jdbcType=VARCHAR},
      attachment_path = #{attachmentPath,jdbcType=VARCHAR},
      attachment_size = #{attachmentSize,jdbcType=INTEGER},
      attachment_type = #{attachmentType,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>