<?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.pre_sale_record_change.mapper.TGuijiRealEstatePreSaleRecordChangeMapper">

    <sql id="selectVo">
        select id, HTH, YWZH, CMRXM, MSRXM, SFZLX, SFZH, LXDZ, FWZL, HTZJ, JZMJ, TNMJ, FTMJ, ZH, FH, FWYT, FWXZ, ZL, HTRQ, BGYY, SPSJ from t_guiji_real_estate_pre_sale_record_change
    </sql>

    <select id="selectList" parameterType="TGuijiRealEstatePreSaleRecordChange" resultType="TGuijiRealEstatePreSaleRecordChange">
        <include refid="selectVo"/>
        <where>
            <if test="HTH != null  and HTH != ''"> and HTH like concat('%', #{HTH}, '%')</if>
            <if test="YWZH != null  and YWZH != ''"> and YWZH like concat('%', #{YWZH}, '%')</if>
            <if test="CMRXM != null  and CMRXM != ''"> and CMRXM like concat('%', #{CMRXM}, '%')</if>
            <if test="MSRXM != null  and MSRXM != ''"> and MSRXM like concat('%', #{MSRXM}, '%')</if>
            <if test="SFZLX != null  and SFZLX != ''"> and SFZLX like concat('%', #{SFZLX}, '%')</if>
            <if test="SFZH != null  and SFZH != ''"> and SFZH like concat('%', #{SFZH}, '%')</if>
            <if test="LXDZ != null  and LXDZ != ''"> and LXDZ like concat('%', #{LXDZ}, '%')</if>
            <if test="FWZL != null  and FWZL != ''"> and FWZL like concat('%', #{FWZL}, '%')</if>
            <if test="HTZJ != null  and HTZJ != ''"> and HTZJ like concat('%', #{HTZJ}, '%')</if>
            <if test="JZMJ != null  and JZMJ != ''"> and JZMJ like concat('%', #{JZMJ}, '%')</if>
            <if test="TNMJ != null  and TNMJ != ''"> and TNMJ like concat('%', #{TNMJ}, '%')</if>
            <if test="FTMJ != null  and FTMJ != ''"> and FTMJ like concat('%', #{FTMJ}, '%')</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="FWYT != null  and FWYT != ''"> and FWYT like concat('%', #{FWYT}, '%')</if>
            <if test="FWXZ != null  and FWXZ != ''"> and FWXZ like concat('%', #{FWXZ}, '%')</if>
            <if test="ZL != null  and ZL != ''"> and ZL like concat('%', #{ZL}, '%')</if>
            <if test="HTRQ != null  and HTRQ != ''"> and HTRQ like concat('%', #{HTRQ}, '%')</if>
            <if test="BGYY != null  and BGYY != ''"> and BGYY like concat('%', #{BGYY}, '%')</if>
            <if test="SPSJ != null  and SPSJ != ''"> and SPSJ like concat('%', #{SPSJ}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
