<?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.community.huiju.dao.TpConfigurationMapper" >
  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpConfiguration" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="key" property="key" jdbcType="VARCHAR" />
    <result column="configuration_name" property="configurationName" jdbcType="VARCHAR" />
    <result column="configuration_type" property="configurationType" jdbcType="INTEGER" />
    <result column="configuration_value" property="configurationValue" jdbcType="VARCHAR" />
    <result column="create_tiem" property="createTiem" jdbcType="TIMESTAMP" />
    <result column="create_user" property="createUser" jdbcType="INTEGER" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
    <result column="community_id" property="communityId" jdbcType="INTEGER" />
    <result column="doorUuid" property="dooruuid" jdbcType="VARCHAR" />
    <result column="deviceUuid" property="deviceuuid" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, `key`, configuration_name, configuration_type, configuration_value, create_tiem,
    create_user, update_time, update_user, community_id, doorUuid, deviceUuid
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from tp_configuration
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from tp_configuration
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.community.huiju.model.TpConfiguration" >
    insert into tp_configuration (id, `key`, configuration_name,
      configuration_type, configuration_value,
      create_tiem, create_user, update_time,
      update_user, community_id, doorUuid,
      deviceUuid)
    values (#{id,jdbcType=INTEGER}, #{key,jdbcType=VARCHAR}, #{configurationName,jdbcType=VARCHAR},
      #{configurationType,jdbcType=INTEGER}, #{configurationValue,jdbcType=VARCHAR},
      #{createTiem,jdbcType=TIMESTAMP}, #{createUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
      #{updateUser,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{dooruuid,jdbcType=VARCHAR},
      #{deviceuuid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.community.huiju.model.TpConfiguration" >
    insert into tp_configuration
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="key != null" >
        `key`,
      </if>
      <if test="configurationName != null" >
        configuration_name,
      </if>
      <if test="configurationType != null" >
        configuration_type,
      </if>
      <if test="configurationValue != null" >
        configuration_value,
      </if>
      <if test="createTiem != null" >
        create_tiem,
      </if>
      <if test="createUser != null" >
        create_user,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="updateUser != null" >
        update_user,
      </if>
      <if test="communityId != null" >
        community_id,
      </if>
      <if test="dooruuid != null" >
        doorUuid,
      </if>
      <if test="deviceuuid != null" >
        deviceUuid,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="key != null" >
        #{key,jdbcType=VARCHAR},
      </if>
      <if test="configurationName != null" >
        #{configurationName,jdbcType=VARCHAR},
      </if>
      <if test="configurationType != null" >
        #{configurationType,jdbcType=INTEGER},
      </if>
      <if test="configurationValue != null" >
        #{configurationValue,jdbcType=VARCHAR},
      </if>
      <if test="createTiem != null" >
        #{createTiem,jdbcType=TIMESTAMP},
      </if>
      <if test="createUser != null" >
        #{createUser,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null" >
        #{updateUser,jdbcType=INTEGER},
      </if>
      <if test="communityId != null" >
        #{communityId,jdbcType=INTEGER},
      </if>
      <if test="dooruuid != null" >
        #{dooruuid,jdbcType=VARCHAR},
      </if>
      <if test="deviceuuid != null" >
        #{deviceuuid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpConfiguration" >
    update tp_configuration
    <set >
      <if test="key != null" >
        `key` = #{key,jdbcType=VARCHAR},
      </if>
      <if test="configurationName != null" >
        configuration_name = #{configurationName,jdbcType=VARCHAR},
      </if>
      <if test="configurationType != null" >
        configuration_type = #{configurationType,jdbcType=INTEGER},
      </if>
      <if test="configurationValue != null" >
        configuration_value = #{configurationValue,jdbcType=VARCHAR},
      </if>
      <if test="createTiem != null" >
        create_tiem = #{createTiem,jdbcType=TIMESTAMP},
      </if>
      <if test="createUser != null" >
        create_user = #{createUser,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null" >
        update_user = #{updateUser,jdbcType=INTEGER},
      </if>
      <if test="communityId != null" >
        community_id = #{communityId,jdbcType=INTEGER},
      </if>
      <if test="dooruuid != null" >
        doorUuid = #{dooruuid,jdbcType=VARCHAR},
      </if>
      <if test="deviceuuid != null" >
        deviceUuid = #{deviceuuid,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpConfiguration" >
    update tp_configuration
    set `key` = #{key,jdbcType=VARCHAR},
      configuration_name = #{configurationName,jdbcType=VARCHAR},
      configuration_type = #{configurationType,jdbcType=INTEGER},
      configuration_value = #{configurationValue,jdbcType=VARCHAR},
      create_tiem = #{createTiem,jdbcType=TIMESTAMP},
      create_user = #{createUser,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user = #{updateUser,jdbcType=INTEGER},
      community_id = #{communityId,jdbcType=INTEGER},
      doorUuid = #{dooruuid,jdbcType=VARCHAR},
      deviceUuid = #{deviceuuid,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>