<?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.TpEquipmentMapper" >
  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpEquipment" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="url_id" property="urlId" jdbcType="INTEGER" />
    <result column="community_id" property="communityId" jdbcType="INTEGER" />
    <result column="security_guard_tel_id" property="securityGuardTelId" jdbcType="INTEGER" />
    <result column="security_room_tel_id" property="securityRoomTelId" jdbcType="INTEGER" />
    <result column="address_id" property="addressId" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" 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="uuid_id" property="uuidId" jdbcType="INTEGER" />
    <result column="equipment_type" property="equipmentType" jdbcType="VARCHAR" />
    <result column="equipment_tree_id" property="equipmentTreeId" jdbcType="INTEGER" />
    <result column="appkey" property="appkey" jdbcType="VARCHAR" />
    <result column="secret" property="secret" jdbcType="VARCHAR" />
    <result column="op_user_uuid" property="opUserUuid" jdbcType="VARCHAR" />
    <result column="http_server" property="httpServer" jdbcType="VARCHAR" />
    <result column="unit_uuids" property="unitUuids" jdbcType="VARCHAR" />
    <result column="monitoringUrl" property="monitoringUrl" />
    <result column="securityGuardTel" property="securityGuardTel" />
    <result column="securityRoomTel" property="securityRoomTel" />
    <result column="monitoringAddress" property="monitoringAddress" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, url_id, community_id, security_guard_tel_id, security_room_tel_id, address_id,
    create_time, create_user, update_time, update_user, uuid_id, equipment_type, equipment_tree_id,
    appkey, secret, op_user_uuid, http_server, unit_uuids
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from tp_equipment
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from tp_equipment
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.community.huiju.model.TpEquipment" >
    insert into tp_equipment (id, url_id, community_id,
      security_guard_tel_id, security_room_tel_id,
      address_id, create_time, create_user,
      update_time, update_user, uuid_id,
      equipment_type, equipment_tree_id, appkey,
      secret, op_user_uuid, http_server,
      unit_uuids)
    values (#{id,jdbcType=INTEGER}, #{urlId,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER},
      #{securityGuardTelId,jdbcType=INTEGER}, #{securityRoomTelId,jdbcType=INTEGER},
      #{addressId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=INTEGER},
      #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{uuidId,jdbcType=INTEGER},
      #{equipmentType,jdbcType=VARCHAR}, #{equipmentTreeId,jdbcType=INTEGER}, #{appkey,jdbcType=VARCHAR},
      #{secret,jdbcType=VARCHAR}, #{opUserUuid,jdbcType=VARCHAR}, #{httpServer,jdbcType=VARCHAR},
      #{unitUuids,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.community.huiju.model.TpEquipment" >
    insert into tp_equipment
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="urlId != null" >
        url_id,
      </if>
      <if test="communityId != null" >
        community_id,
      </if>
      <if test="securityGuardTelId != null" >
        security_guard_tel_id,
      </if>
      <if test="securityRoomTelId != null" >
        security_room_tel_id,
      </if>
      <if test="addressId != null" >
        address_id,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="createUser != null" >
        create_user,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="updateUser != null" >
        update_user,
      </if>
      <if test="uuidId != null" >
        uuid_id,
      </if>
      <if test="equipmentType != null" >
        equipment_type,
      </if>
      <if test="equipmentTreeId != null" >
        equipment_tree_id,
      </if>
      <if test="appkey != null" >
        appkey,
      </if>
      <if test="secret != null" >
        secret,
      </if>
      <if test="opUserUuid != null" >
        op_user_uuid,
      </if>
      <if test="httpServer != null" >
        http_server,
      </if>
      <if test="unitUuids != null" >
        unit_uuids,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="urlId != null" >
        #{urlId,jdbcType=INTEGER},
      </if>
      <if test="communityId != null" >
        #{communityId,jdbcType=INTEGER},
      </if>
      <if test="securityGuardTelId != null" >
        #{securityGuardTelId,jdbcType=INTEGER},
      </if>
      <if test="securityRoomTelId != null" >
        #{securityRoomTelId,jdbcType=INTEGER},
      </if>
      <if test="addressId != null" >
        #{addressId,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,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="uuidId != null" >
        #{uuidId,jdbcType=INTEGER},
      </if>
      <if test="equipmentType != null" >
        #{equipmentType,jdbcType=VARCHAR},
      </if>
      <if test="equipmentTreeId != null" >
        #{equipmentTreeId,jdbcType=INTEGER},
      </if>
      <if test="appkey != null" >
        #{appkey,jdbcType=VARCHAR},
      </if>
      <if test="secret != null" >
        #{secret,jdbcType=VARCHAR},
      </if>
      <if test="opUserUuid != null" >
        #{opUserUuid,jdbcType=VARCHAR},
      </if>
      <if test="httpServer != null" >
        #{httpServer,jdbcType=VARCHAR},
      </if>
      <if test="unitUuids != null" >
        #{unitUuids,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpEquipment" >
    update tp_equipment
    <set >
      <if test="urlId != null" >
        url_id = #{urlId,jdbcType=INTEGER},
      </if>
      <if test="communityId != null" >
        community_id = #{communityId,jdbcType=INTEGER},
      </if>
      <if test="securityGuardTelId != null" >
        security_guard_tel_id = #{securityGuardTelId,jdbcType=INTEGER},
      </if>
      <if test="securityRoomTelId != null" >
        security_room_tel_id = #{securityRoomTelId,jdbcType=INTEGER},
      </if>
      <if test="addressId != null" >
        address_id = #{addressId,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,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="uuidId != null" >
        uuid_id = #{uuidId,jdbcType=INTEGER},
      </if>
      <if test="equipmentType != null" >
        equipment_type = #{equipmentType,jdbcType=VARCHAR},
      </if>
      <if test="equipmentTreeId != null" >
        equipment_tree_id = #{equipmentTreeId,jdbcType=INTEGER},
      </if>
      <if test="appkey != null" >
        appkey = #{appkey,jdbcType=VARCHAR},
      </if>
      <if test="secret != null" >
        secret = #{secret,jdbcType=VARCHAR},
      </if>
      <if test="opUserUuid != null" >
        op_user_uuid = #{opUserUuid,jdbcType=VARCHAR},
      </if>
      <if test="httpServer != null" >
        http_server = #{httpServer,jdbcType=VARCHAR},
      </if>
      <if test="unitUuids != null" >
        unit_uuids = #{unitUuids,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpEquipment" >
    update tp_equipment
    set url_id = #{urlId,jdbcType=INTEGER},
      community_id = #{communityId,jdbcType=INTEGER},
      security_guard_tel_id = #{securityGuardTelId,jdbcType=INTEGER},
      security_room_tel_id = #{securityRoomTelId,jdbcType=INTEGER},
      address_id = #{addressId,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user = #{createUser,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user = #{updateUser,jdbcType=INTEGER},
      uuid_id = #{uuidId,jdbcType=INTEGER},
      equipment_type = #{equipmentType,jdbcType=VARCHAR},
      equipment_tree_id = #{equipmentTreeId,jdbcType=INTEGER},
      appkey = #{appkey,jdbcType=VARCHAR},
      secret = #{secret,jdbcType=VARCHAR},
      op_user_uuid = #{opUserUuid,jdbcType=VARCHAR},
      http_server = #{httpServer,jdbcType=VARCHAR},
      unit_uuids = #{unitUuids,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>