<?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.sooka.system.real_estate.file_additional.mapper.TGuijiRealEstateFileAdditionalMapper">

    <sql id="selectVo">
        select id, YWZH, LicenseID, ZHLX, SYQR, ZH, FH, ZJMJ, GHYT, FWXZ from t_guiji_real_estate_file_additional
    </sql>

    <select id="selectList" parameterType="TGuijiRealEstateFileAdditional" resultType="TGuijiRealEstateFileAdditional">
        <include refid="selectVo"/>
        <where>
            <if test="YWZH != null  and YWZH != ''"> and YWZH like concat('%', #{YWZH}, '%')</if>
            <if test="LicenseID != null  and LicenseID != ''"> and LicenseID like concat('%', #{LicenseID}, '%')</if>
            <if test="ZHLX != null  and ZHLX != ''"> and ZHLX like concat('%', #{ZHLX}, '%')</if>
            <if test="SYQR != null  and SYQR != ''"> and SYQR like concat('%', #{SYQR}, '%')</if>
            <if test="ZH != null  and ZH != ''"> and ZH like concat('%', #{ZH}, '%')</if>
            <if test="FH != null  and FH != ''"> and FH like concat('%', #{FH}, '%')</if>
            <if test="ZJMJ != null  and ZJMJ != ''"> and ZJMJ like concat('%', #{ZJMJ}, '%')</if>
            <if test="GHYT != null  and GHYT != ''"> and GHYT like concat('%', #{GHYT}, '%')</if>
            <if test="FWXZ != null  and FWXZ != ''"> and FWXZ like concat('%', #{FWXZ}, '%')</if>
        </where>
    </select>

    <select id="selectById" parameterType="String" resultType="TGuijiRealEstateFileAdditional">
        <include refid="selectVo"/>
        where id = #{id}
    </select>

    <insert id="insert" parameterType="TGuijiRealEstateFileAdditional">
        insert into t_guiji_real_estate_file_additional
        <trim prefix="(" suffix=")" suffixOverrides=",">
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
         </trim>
    </insert>

    <update id="update" parameterType="TGuijiRealEstateFileAdditional">
        update t_guiji_real_estate_file_additional
        <trim prefix="SET" suffixOverrides=",">
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteById" parameterType="String">
        delete from t_guiji_real_estate_file_additional where id = #{id}
    </delete>

    <delete id="deleteByIds" parameterType="String">
        delete from t_guiji_real_estate_file_additional where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

</mapper>
