<?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.ScenicDescriptionMapper">
    <resultMap id="BaseResultMap" type="com.fjs.scenic.entity.scenic.ScenicDescription">
        <constructor>
            <arg column="scenic_id" jdbcType="INTEGER" javaType="java.lang.Integer"/>
        </constructor>
    </resultMap>
    <resultMap id="ResultMapWithBLOBs" type="com.fjs.scenic.entity.scenic.ScenicDescription">
        <constructor>
            <arg column="scenic_id" jdbcType="INTEGER" javaType="java.lang.Integer"/>
            <arg column="description" jdbcType="LONGVARCHAR" javaType="java.lang.String"/>
        </constructor>
    </resultMap>
    <sql id="Blob_Column_List">
    description
  </sql>
    <insert id="insert" parameterType="com.fjs.scenic.entity.scenic.ScenicDescription">
    insert into scenic_description (scenic_id, description)
    values (#{scenicId,jdbcType=INTEGER}, #{description,jdbcType=LONGVARCHAR})
  </insert>
    <insert id="insertSelective" parameterType="com.fjs.scenic.entity.scenic.ScenicDescription">
        insert into scenic_description
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="scenicId != null">
                scenic_id,
            </if>
            <if test="description != null">
                description,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="scenicId != null">
                #{scenicId,jdbcType=INTEGER},
            </if>
            <if test="description != null">
                #{description,jdbcType=LONGVARCHAR},
            </if>
        </trim>
    </insert>

    <!--手动-->
    <update id="updateByFid" parameterType="com.fjs.scenic.entity.scenic.ScenicDescription">
        update scenic_description
        <set>
            <if test="description != null">
                description = #{description,jdbcType=LONGVARCHAR},
            </if>
        </set>
        where scenic_id = #{scenicId,jdbcType=INTEGER}
    </update>

    <select id="selectByScenicId" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
        select * from scenic_description
        where scenic_id = #{id,jdbcType=INTEGER}
    </select>
</mapper>