<?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.th.demo.mapping.common.CommonImagePathMapper">
  <resultMap id="BaseResultMap" type="com.th.demo.model.common.CommonImagePath">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="F_ID" jdbcType="VARCHAR" property="fId" />
    <result column="IMAGE_NAME" jdbcType="VARCHAR" property="imageName" />
    <result column="IMAGE_PATH" jdbcType="VARCHAR" property="imagePath" />
    <result column="IMAGE_TYPE" jdbcType="VARCHAR" property="imageType" />
    <result column="IMAGE_SIZE" jdbcType="VARCHAR" property="imageSize" />
  </resultMap>
  <sql id="Base_Column_List">
    ID, F_ID, IMAGE_NAME, IMAGE_PATH, IMAGE_TYPE, IMAGE_SIZE
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from T_COMMON_IMAGE_PATH
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from T_COMMON_IMAGE_PATH
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.th.demo.model.common.CommonImagePath">


    insert into T_COMMON_IMAGE_PATH (ID, F_ID, IMAGE_NAME, 
      IMAGE_PATH, IMAGE_TYPE, IMAGE_SIZE
      )
    values (#{id,jdbcType=VARCHAR}, #{fId,jdbcType=VARCHAR}, #{imageName,jdbcType=VARCHAR}, 
      #{imagePath,jdbcType=VARCHAR}, #{imageType,jdbcType=VARCHAR}, #{imageSize,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.th.demo.model.common.CommonImagePath">
    insert into T_COMMON_IMAGE_PATH
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="fId != null">
        F_ID,
      </if>
      <if test="imageName != null">
        IMAGE_NAME,
      </if>
      <if test="imagePath != null">
        IMAGE_PATH,
      </if>
      <if test="imageType != null">
        IMAGE_TYPE,
      </if>
      <if test="imageSize != null">
        IMAGE_SIZE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="fId != null">
        #{fId,jdbcType=VARCHAR},
      </if>
      <if test="imageName != null">
        #{imageName,jdbcType=VARCHAR},
      </if>
      <if test="imagePath != null">
        #{imagePath,jdbcType=VARCHAR},
      </if>
      <if test="imageType != null">
        #{imageType,jdbcType=VARCHAR},
      </if>
      <if test="imageSize != null">
        #{imageSize,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.common.CommonImagePath">
    update T_COMMON_IMAGE_PATH
    <set>
      <if test="fId != null">
        F_ID = #{fId,jdbcType=VARCHAR},
      </if>
      <if test="imageName != null">
        IMAGE_NAME = #{imageName,jdbcType=VARCHAR},
      </if>
      <if test="imagePath != null">
        IMAGE_PATH = #{imagePath,jdbcType=VARCHAR},
      </if>
      <if test="imageType != null">
        IMAGE_TYPE = #{imageType,jdbcType=VARCHAR},
      </if>
      <if test="imageSize != null">
        IMAGE_SIZE = #{imageSize,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.th.demo.model.common.CommonImagePath">
    update T_COMMON_IMAGE_PATH
    set F_ID = #{fId,jdbcType=VARCHAR},
      IMAGE_NAME = #{imageName,jdbcType=VARCHAR},
      IMAGE_PATH = #{imagePath,jdbcType=VARCHAR},
      IMAGE_TYPE = #{imageType,jdbcType=VARCHAR},
      IMAGE_SIZE = #{imageSize,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>




  <select id="selectByFid" resultMap="BaseResultMap"   >
    select
    <include refid="Base_Column_List" />
    from T_COMMON_IMAGE_PATH
    where F_ID = #{id,jdbcType=VARCHAR}
  </select>


</mapper>