<?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.on_sale.mapper.TGuijiRealEstateOnSaleMapper">

    <sql id="selectVo">
        select id, XSBAZMH, YWZH, QYMC, XMMC, XMBH, JGYH, JGZH, YSMJ, TS, ZH, FH, MJ, YSDJ, GHYT, FWXZ, SPSJ from t_guiji_real_estate_on_sale
    </sql>

    <select id="selectList" parameterType="TGuijiRealEstateOnSale" resultType="TGuijiRealEstateOnSale">
        <include refid="selectVo"/>
        <where>
            <if test="XSBAZMH != null  and XSBAZMH != ''"> and XSBAZMH like concat('%', #{XSBAZMH}, '%')</if>
            <if test="YWZH != null  and YWZH != ''"> and YWZH like concat('%', #{YWZH}, '%')</if>
            <if test="QYMC != null  and QYMC != ''"> and QYMC like concat('%', #{QYMC}, '%')</if>
            <if test="XMMC != null  and XMMC != ''"> and XMMC like concat('%', #{XMMC}, '%')</if>
            <if test="XMBH != null  and XMBH != ''"> and XMBH like concat('%', #{XMBH}, '%')</if>
            <if test="JGYH != null  and JGYH != ''"> and JGYH like concat('%', #{JGYH}, '%')</if>
            <if test="JGZH != null  and JGZH != ''"> and JGZH like concat('%', #{JGZH}, '%')</if>
            <if test="YSMJ != null  and YSMJ != ''"> and YSMJ like concat('%', #{YSMJ}, '%')</if>
            <if test="TS != null  and TS != ''"> and TS like concat('%', #{TS}, '%')</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="MJ != null  and MJ != ''"> and MJ like concat('%', #{MJ}, '%')</if>
            <if test="YSDJ != null  and YSDJ != ''"> and YSDJ like concat('%', #{YSDJ}, '%')</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>
            <if test="SPSJ != null  and SPSJ != ''"> and SPSJ like concat('%', #{SPSJ}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
