<?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="SKcKnTransferzonedocumentMapper" >
    <!-- 通用查询映射结果 -->

    <select id="selectSKcKnTransferzonedocumentList" parameterType="pd" resultType="pd">
        select * from s_kc_kn_transferzonedocument where 1=1
        <if test="transferZoneDocumentNumber !=null and transferZoneDocumentNumber !='' ">
            and transferZoneDocumentNumber = #{transferZoneDocumentNumber}
        </if>
        <if test="submitter !=null and submitter !='' ">
            and submitter = #{submitter}
        </if>
        <if test="submissionTime !=null and submissionTime !='' ">
            and submissionTime = #{submissionTime}
        </if>
    </select>


    <update id="updateSKcKnTransferzonedocument" parameterType="pd" >
        update s_kc_kn_transferzonedocument
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="transferZoneDocumentNumber !=null and transferZoneDocumentNumber !='' ">
            transferZoneDocumentNumber = #{transferZoneDocumentNumber},
        </if>
        <if test="submitter !=null and submitter !='' ">
            submitter = #{submitter},
        </if>
        <if test="submissionTime !=null and submissionTime !='' ">
            submissionTime = #{submissionTime},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

    <delete id="SKcKnTransferzonedocumentRemove" parameterType="pd">
        <if test="ids != null">
            delete from s_kc_kn_transferzonedocument where
            <if test="ids != null">
                id in(${ids})
            </if>
        </if>
    </delete>

    <insert id="addSKcKnTransferzonedocument" parameterType="pd" >

        insert into s_kc_kn_transferzonedocument
        <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">

        <if test="transferZoneDocumentNumber !=null and transferZoneDocumentNumber !='' ">
            transferZoneDocumentNumber,
        </if>
        <if test="submitter !=null and submitter !='' ">
            submitter,
        </if>
        <if test="submissionTime !=null and submissionTime !='' ">
            submissionTime,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="transferZoneDocumentNumber !=null and transferZoneDocumentNumber !='' ">
             #{transferZoneDocumentNumber},
        </if>
        <if test="submitter !=null and submitter !='' ">
             #{submitter},
        </if>
        <if test="submissionTime !=null and submissionTime !='' ">
             #{submissionTime},
        </if>
        </trim>

    </insert>

</mapper>
