<?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.TGuijiHousingconstructionZlskfrxMapper">
    
    <resultMap type="TGuijiHousingconstructionZlskfrx" id="TGuijiHousingconstructionZlskfrxResult">
        <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="caseid"    column="caseid"    />
        <result property="incomingcall"    column="incomingcall"    />
        <result property="name"    column="name"    />
        <result property="address"    column="address"    />
        <result property="content"    column="content"    />
        <result property="createon"    column="createon"    />
    </resultMap>

    <sql id="selectTGuijiHousingconstructionZlskfrxVo">
        select id, create_time, cd_time, cd_batch, cd_operation, cd_source, caseid, incomingcall, name, address, content, createon from t_guiji_housingconstruction_zlskfrx
    </sql>

    <select id="selectTGuijiHousingconstructionZlskfrxList" parameterType="TGuijiHousingconstructionZlskfrx" resultMap="TGuijiHousingconstructionZlskfrxResult">
        <include refid="selectTGuijiHousingconstructionZlskfrxVo"/>
        <where>  
            <if test="caseid != null  and caseid != ''"> and caseid = #{caseid}</if>
            <if test="incomingcall != null  and incomingcall != ''"> and incomingcall = #{incomingcall}</if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectTGuijiHousingconstructionZlskfrxById" parameterType="String" resultMap="TGuijiHousingconstructionZlskfrxResult">
        <include refid="selectTGuijiHousingconstructionZlskfrxVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTGuijiHousingconstructionZlskfrx" parameterType="TGuijiHousingconstructionZlskfrx">
        insert into t_guiji_housingconstruction_zlskfrx
        <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="caseid != null">caseid,</if>
            <if test="incomingcall != null">incomingcall,</if>
            <if test="name != null">name,</if>
            <if test="address != null">address,</if>
            <if test="content != null">content,</if>
            <if test="createon != null">createon,</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="caseid != null">#{caseid},</if>
            <if test="incomingcall != null">#{incomingcall},</if>
            <if test="name != null">#{name},</if>
            <if test="address != null">#{address},</if>
            <if test="content != null">#{content},</if>
            <if test="createon != null">#{createon},</if>
         </trim>
    </insert>

    <update id="updateTGuijiHousingconstructionZlskfrx" parameterType="TGuijiHousingconstructionZlskfrx">
        update t_guiji_housingconstruction_zlskfrx
        <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="caseid != null">caseid = #{caseid},</if>
            <if test="incomingcall != null">incomingcall = #{incomingcall},</if>
            <if test="name != null">name = #{name},</if>
            <if test="address != null">address = #{address},</if>
            <if test="content != null">content = #{content},</if>
            <if test="createon != null">createon = #{createon},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTGuijiHousingconstructionZlskfrxById" parameterType="String">
        delete from t_guiji_housingconstruction_zlskfrx where id = #{id}
    </delete>

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

</mapper>