<?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.housing_stock.mapper.TGuijiRealEstateHousingStockMapper">

    <sql id="selectVo">
        select id, HTH, YWZH, CSRXM, MSRXM, SFZLX, SFZH, LXDZ, FWZL, HTZJ, ZJMJ, JYMJ, CQZH, ZH, FH, GHYT, TNMJ, GTMJ, QYSJ, BASJ from t_guiji_real_estate_housing_stock
    </sql>

    <select id="selectList" parameterType="TGuijiRealEstateHousingStock" resultType="TGuijiRealEstateHousingStock">
        <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="CSRXM != null  and CSRXM != ''"> and CSRXM like concat('%', #{CSRXM}, '%')</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="ZJMJ != null  and ZJMJ != ''"> and ZJMJ like concat('%', #{ZJMJ}, '%')</if>
            <if test="JYMJ != null  and JYMJ != ''"> and JYMJ like concat('%', #{JYMJ}, '%')</if>
            <if test="CQZH != null  and CQZH != ''"> and CQZH like concat('%', #{CQZH}, '%')</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="GHYT != null  and GHYT != ''"> and GHYT like concat('%', #{GHYT}, '%')</if>
            <if test="TNMJ != null  and TNMJ != ''"> and TNMJ like concat('%', #{TNMJ}, '%')</if>
            <if test="GTMJ != null  and GTMJ != ''"> and GTMJ like concat('%', #{GTMJ}, '%')</if>
            <if test="QYSJ != null  and QYSJ != ''"> and QYSJ like concat('%', #{QYSJ}, '%')</if>
            <if test="BASJ != null  and BASJ != ''"> and BASJ like concat('%', #{BASJ}, '%')</if>
        </where>
    </select>

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

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

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

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

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

</mapper>
