<?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.fjs.scenic.mapper.scenic.TicketInformationMapper">
  <resultMap id="BaseResultMap" type="com.fjs.scenic.entity.scenic.TicketInformation">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="scenic_id" jdbcType="INTEGER" property="scenicId" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fjs.scenic.entity.scenic.TicketInformation">
    <result column="content" jdbcType="LONGVARCHAR" property="content" />
  </resultMap>
  <sql id="Base_Column_List">
    id, scenic_id
  </sql>
  <sql id="Blob_Column_List">
    content
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from ticket_information
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from ticket_information
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fjs.scenic.entity.scenic.TicketInformation">
    insert into ticket_information (id, scenic_id, content
      )
    values (#{id,jdbcType=INTEGER}, #{scenicId,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.fjs.scenic.entity.scenic.TicketInformation">
    insert into ticket_information
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="scenicId != null">
        scenic_id,
      </if>
      <if test="content != null">
        content,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="scenicId != null">
        #{scenicId,jdbcType=INTEGER},
      </if>
      <if test="content != null">
        #{content,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.fjs.scenic.entity.scenic.TicketInformation">
    update ticket_information
    <set>
      <if test="scenicId != null">
        scenic_id = #{scenicId,jdbcType=INTEGER},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.fjs.scenic.entity.scenic.TicketInformation">
    update ticket_information
    set scenic_id = #{scenicId,jdbcType=INTEGER},
      content = #{content,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fjs.scenic.entity.scenic.TicketInformation">
    update ticket_information
    set scenic_id = #{scenicId,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>

  <!--自定义-->
  <select id="selectByScenicId" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
    select
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from ticket_information
    where scenic_id = #{id,jdbcType=INTEGER}
  </select>

  <update id="updateByScenicId" parameterType="com.fjs.scenic.entity.scenic.TicketInformation">
    update ticket_information
    set scenic_id = #{scenicId,jdbcType=INTEGER},
    content = #{content,jdbcType=LONGVARCHAR}
    where scenic_id = #{scenicId,jdbcType=INTEGER}
  </update>
</mapper>