<?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.fdage.dao.base.TbExhibitionMapper">
  <resultMap id="BaseResultMap" type="com.fdage.pojo.TbExhibition">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="web_url" jdbcType="VARCHAR" property="webUrl" />
    <result column="type_id" jdbcType="BIGINT" property="typeId" />
    <result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
    <result column="state" jdbcType="INTEGER" property="state" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fdage.pojo.TbExhibition">
    <result column="description" jdbcType="LONGVARCHAR" property="description" />
  </resultMap>
  <sql id="Base_Column_List">
    id, name,web_url, type_id, equipment_id, state, create_time
  </sql>
  <sql id="Blob_Column_List">
    description
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from tb_exhibition
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from tb_exhibition
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.fdage.pojo.TbExhibition" useGeneratedKeys="true" keyProperty="id">
    insert into tb_exhibition (id, name, type_id, web_url,
      equipment_id, state, create_time, 
      description)
    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{typeId,jdbcType=BIGINT}, #{webUrl,jdbcType=VARCHAR},
      #{equipmentId,jdbcType=BIGINT}, #{state,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
      #{description,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.fdage.pojo.TbExhibition" useGeneratedKeys="true" keyProperty="id">
    insert into tb_exhibition
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="typeId != null">
        type_id,
      </if>
      <if test="webUrl != null">
        web_url,
      </if>
      <if test="equipmentId != null">
        equipment_id,
      </if>
      <if test="state != null">
        state,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="description != null">
        description,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="typeId != null">
        #{typeId,jdbcType=BIGINT},
      </if>
      <if test="webUrl != null">
        #{webUrl,jdbcType=VARCHAR},
      </if>
      <if test="equipmentId != null">
        #{equipmentId,jdbcType=BIGINT},
      </if>
      <if test="state != null">
        #{state,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="description != null">
        #{description,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.fdage.pojo.TbExhibition">
    update tb_exhibition
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="typeId != null">
        type_id = #{typeId,jdbcType=BIGINT},
      </if>
      <if test="webUrl != null">
        web_url = #{webUrl,jdbcType=BIGINT},
      </if>
      <if test="equipmentId != null">
        equipment_id = #{equipmentId,jdbcType=BIGINT},
      </if>
      <if test="state != null">
        state = #{state,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.fdage.pojo.TbExhibition">
    update tb_exhibition
    set name = #{name,jdbcType=VARCHAR},
      type_id = #{typeId,jdbcType=BIGINT},
      web_url = #{webUrl,jdbcType=VARCHAR},
      equipment_id = #{equipmentId,jdbcType=BIGINT},
      state = #{state,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      description = #{description,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fdage.pojo.TbExhibition">
    update tb_exhibition
    set name = #{name,jdbcType=VARCHAR},
      type_id = #{typeId,jdbcType=BIGINT},
      web_url = #{webUrl,jdbcType=VARCHAR},
      equipment_id = #{equipmentId,jdbcType=BIGINT},
      state = #{state,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>