<?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.mapper.TGuijiHousingconstructionYhjbxxMapper">
    
    <resultMap type="TGuijiHousingconstructionYhjbxx" id="TGuijiHousingconstructionYhjbxxResult">
        <result property="id"    column="id"    />
        <result property="createTime"    column="create_time"    />
        <result property="cdTime"    column="cd_time"    />
        <result property="cdBatch"    column="cd_batch"    />
        <result property="cdOperation"    column="cd_operation"    />
        <result property="cdSource"    column="cd_source"    />
        <result property="yhbh"    column="yhbh"    />
        <result property="yhmc"    column="yhmc"    />
        <result property="yhdz"    column="yhdz"    />
        <result property="ysyf"    column="ysyf"    />
        <result property="ysl"    column="ysl"    />
        <result property="sfjf"    column="sfjf"    />
        <result property="jfsj"    column="jfsj"    />
    </resultMap>

    <sql id="selectTGuijiHousingconstructionYhjbxxVo">
        select id, create_time, cd_time, cd_batch, cd_operation, cd_source, yhbh, yhmc, yhdz, ysyf, ysl, sfjf, jfsj from t_guiji_housingconstruction_yhjbxx
    </sql>

    <select id="selectTGuijiHousingconstructionYhjbxxList" parameterType="TGuijiHousingconstructionYhjbxx" resultMap="TGuijiHousingconstructionYhjbxxResult">
        <include refid="selectTGuijiHousingconstructionYhjbxxVo"/>
        <where>  
            <if test="cdTime != null  and cdTime != ''"> and cd_time = #{cdTime}</if>
            <if test="cdBatch != null  and cdBatch != ''"> and cd_batch = #{cdBatch}</if>
            <if test="cdOperation != null  and cdOperation != ''"> and cd_operation = #{cdOperation}</if>
            <if test="cdSource != null  and cdSource != ''"> and cd_source = #{cdSource}</if>
            <if test="yhbh != null  and yhbh != ''"> and yhbh = #{yhbh}</if>
            <if test="yhmc != null  and yhmc != ''"> and yhmc = #{yhmc}</if>
            <if test="yhdz != null  and yhdz != ''"> and yhdz = #{yhdz}</if>
            <if test="ysyf != null  and ysyf != ''"> and ysyf = #{ysyf}</if>
            <if test="ysl != null  and ysl != ''"> and ysl = #{ysl}</if>
            <if test="sfjf != null  and sfjf != ''"> and sfjf = #{sfjf}</if>
            <if test="jfsj != null  and jfsj != ''"> and jfsj = #{jfsj}</if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectTGuijiHousingconstructionYhjbxxById" parameterType="String" resultMap="TGuijiHousingconstructionYhjbxxResult">
        <include refid="selectTGuijiHousingconstructionYhjbxxVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTGuijiHousingconstructionYhjbxx" parameterType="TGuijiHousingconstructionYhjbxx">
        insert into t_guiji_housingconstruction_yhjbxx
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="createTime != null">create_time,</if>
            <if test="cdTime != null">cd_time,</if>
            <if test="cdBatch != null">cd_batch,</if>
            <if test="cdOperation != null">cd_operation,</if>
            <if test="cdSource != null">cd_source,</if>
            <if test="yhbh != null">yhbh,</if>
            <if test="yhmc != null">yhmc,</if>
            <if test="yhdz != null">yhdz,</if>
            <if test="ysyf != null">ysyf,</if>
            <if test="ysl != null">ysl,</if>
            <if test="sfjf != null">sfjf,</if>
            <if test="jfsj != null">jfsj,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="cdTime != null">#{cdTime},</if>
            <if test="cdBatch != null">#{cdBatch},</if>
            <if test="cdOperation != null">#{cdOperation},</if>
            <if test="cdSource != null">#{cdSource},</if>
            <if test="yhbh != null">#{yhbh},</if>
            <if test="yhmc != null">#{yhmc},</if>
            <if test="yhdz != null">#{yhdz},</if>
            <if test="ysyf != null">#{ysyf},</if>
            <if test="ysl != null">#{ysl},</if>
            <if test="sfjf != null">#{sfjf},</if>
            <if test="jfsj != null">#{jfsj},</if>
         </trim>
    </insert>

    <update id="updateTGuijiHousingconstructionYhjbxx" parameterType="TGuijiHousingconstructionYhjbxx">
        update t_guiji_housingconstruction_yhjbxx
        <trim prefix="SET" suffixOverrides=",">
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="cdTime != null">cd_time = #{cdTime},</if>
            <if test="cdBatch != null">cd_batch = #{cdBatch},</if>
            <if test="cdOperation != null">cd_operation = #{cdOperation},</if>
            <if test="cdSource != null">cd_source = #{cdSource},</if>
            <if test="yhbh != null">yhbh = #{yhbh},</if>
            <if test="yhmc != null">yhmc = #{yhmc},</if>
            <if test="yhdz != null">yhdz = #{yhdz},</if>
            <if test="ysyf != null">ysyf = #{ysyf},</if>
            <if test="ysl != null">ysl = #{ysl},</if>
            <if test="sfjf != null">sfjf = #{sfjf},</if>
            <if test="jfsj != null">jfsj = #{jfsj},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTGuijiHousingconstructionYhjbxxById" parameterType="String">
        delete from t_guiji_housingconstruction_yhjbxx where id = #{id}
    </delete>

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