<?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.develop.DevImexportMapper">
  <resultMap id="BaseResultMap" type="com.th.demo.model.develop.DevImexport">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="NAME" jdbcType="VARCHAR" property="name" />
    <result column="PARAM1" jdbcType="VARCHAR" property="param1" />
    <result column="PARAM2" jdbcType="VARCHAR" property="param2" />
    <result column="PARAM3" jdbcType="VARCHAR" property="param3" />
    <result column="PARAM4" jdbcType="VARCHAR" property="param4" />
  </resultMap>
  <sql id="Base_Column_List">
    ID, NAME, PARAM1, PARAM2, PARAM3, PARAM4
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from DEV_IMEXPORT
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from DEV_IMEXPORT
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.th.demo.model.develop.DevImexport">

    <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
      SELECT  REPLACE(UUID(),'-','') as id from dual
    </selectKey>

      insert into DEV_IMEXPORT (ID, NAME, PARAM1,
      PARAM2, PARAM3, PARAM4
      )
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{param1,jdbcType=VARCHAR}, 
      #{param2,jdbcType=VARCHAR}, #{param3,jdbcType=VARCHAR}, #{param4,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.th.demo.model.develop.DevImexport">
    insert into DEV_IMEXPORT
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="name != null">
        NAME,
      </if>
      <if test="param1 != null">
        PARAM1,
      </if>
      <if test="param2 != null">
        PARAM2,
      </if>
      <if test="param3 != null">
        PARAM3,
      </if>
      <if test="param4 != null">
        PARAM4,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="param1 != null">
        #{param1,jdbcType=VARCHAR},
      </if>
      <if test="param2 != null">
        #{param2,jdbcType=VARCHAR},
      </if>
      <if test="param3 != null">
        #{param3,jdbcType=VARCHAR},
      </if>
      <if test="param4 != null">
        #{param4,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.develop.DevImexport">
    update DEV_IMEXPORT
    <set>
      <if test="name != null">
        NAME = #{name,jdbcType=VARCHAR},
      </if>
      <if test="param1 != null">
        PARAM1 = #{param1,jdbcType=VARCHAR},
      </if>
      <if test="param2 != null">
        PARAM2 = #{param2,jdbcType=VARCHAR},
      </if>
      <if test="param3 != null">
        PARAM3 = #{param3,jdbcType=VARCHAR},
      </if>
      <if test="param4 != null">
        PARAM4 = #{param4,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.th.demo.model.develop.DevImexport">
    update DEV_IMEXPORT
    set NAME = #{name,jdbcType=VARCHAR},
      PARAM1 = #{param1,jdbcType=VARCHAR},
      PARAM2 = #{param2,jdbcType=VARCHAR},
      PARAM3 = #{param3,jdbcType=VARCHAR},
      PARAM4 = #{param4,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>



  <select id="select" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from DEV_IMEXPORT

  </select>
</mapper>