<?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.cab.dao.TestParamsMapper" >
  <resultMap id="BaseResultMap" type="com.cab.model.TestParams" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="params_name" property="paramsName" jdbcType="VARCHAR" />
    <result column="params_type" property="paramsType" jdbcType="VARCHAR" />
    <result column="params_limit" property="paramsLimit" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="interface_id" property="interfaceId" jdbcType="INTEGER" />
    <result column="remarks" property="remarks" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, params_name, params_type, params_limit, create_time, interface_id,remarks
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from test_params
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from test_params
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.cab.model.TestParams" >
    insert into test_params (id, params_name, params_type, 
      params_limit, create_time, interface_id
      )
    values (#{id,jdbcType=INTEGER}, #{paramsName,jdbcType=VARCHAR}, #{paramsType,jdbcType=VARCHAR}, 
      #{paramsLimit,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{interfaceId,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.cab.model.TestParams" >
    insert into test_params
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="paramsName != null" >
        params_name,
      </if>
      <if test="paramsType != null" >
        params_type,
      </if>
      <if test="paramsLimit != null" >
        params_limit,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="interfaceId != null" >
        interface_id,
      </if>
      <if test="remarks != null" >
        remarks,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="paramsName != null" >
        #{paramsName,jdbcType=VARCHAR},
      </if>
      <if test="paramsType != null" >
        #{paramsType,jdbcType=VARCHAR},
      </if>
      <if test="paramsLimit != null" >
        #{paramsLimit,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="interfaceId != null" >
        #{interfaceId,jdbcType=INTEGER},
      </if>
      <if test="remarks != null" >
        #{remarks,jdbcType=VARCHAR},
      </if>
    </trim>
    <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
		SELECT LAST_INSERT_ID() AS id
	</selectKey>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.cab.model.TestParams" >
    update test_params
    <set >
      <if test="paramsName != null" >
        params_name = #{paramsName,jdbcType=VARCHAR},
      </if>
      <if test="paramsType != null" >
        params_type = #{paramsType,jdbcType=VARCHAR},
      </if>
      <if test="paramsLimit != null" >
        params_limit = #{paramsLimit,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="interfaceId != null" >
        interface_id = #{interfaceId,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.cab.model.TestParams" >
    update test_params
    set params_name = #{paramsName,jdbcType=VARCHAR},
      params_type = #{paramsType,jdbcType=VARCHAR},
      params_limit = #{paramsLimit,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      interface_id = #{interfaceId,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
  
    <select id="getParams" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from test_params
    where interface_id = #{interfaceId,jdbcType=INTEGER}
  </select>
</mapper>