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

    <select id="selectSKcCrkDzysDeliveryorderList" parameterType="pd" resultType="pd">
        select * from s_kc_crk_dzys_deliveryorder where 1=1
        <if test="deliveryDocumentNumber !=null and deliveryDocumentNumber !='' ">
            and deliveryDocumentNumber = #{deliveryDocumentNumber}
        </if>
        <if test="receiptAcceptanceStatus !=null and receiptAcceptanceStatus !='' ">
            and receiptAcceptanceStatus = #{receiptAcceptanceStatus}
        </if>
        <if test="warehouseShipmentTime !=null and warehouseShipmentTime !='' ">
            and warehouseShipmentTime = #{warehouseShipmentTime}
        </if>
        <if test="storeAcceptanceTime !=null and storeAcceptanceTime !='' ">
            and storeAcceptanceTime = #{storeAcceptanceTime}
        </if>
        <if test="receiver !=null and receiver !='' ">
            and receiver = #{receiver}
        </if>
        <if test="acceptor !=null and acceptor !='' ">
            and acceptor = #{acceptor}
        </if>
        <if test="receiptPushStatus !=null and receiptPushStatus !='' ">
            and receiptPushStatus = #{receiptPushStatus}
        </if>
        <if test="acceptancePushStatus !=null and acceptancePushStatus !='' ">
            and acceptancePushStatus = #{acceptancePushStatus}
        </if>
        <if test="electronicSealStatus !=null and electronicSealStatus !='' ">
            and electronicSealStatus = #{electronicSealStatus}
        </if>
        <if test="operation !=null and operation !='' ">
            and operation = #{operation}
        </if>
    </select>


    <update id="updateSKcCrkDzysDeliveryorder" parameterType="pd" >
        update s_kc_crk_dzys_deliveryorder
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="deliveryDocumentNumber !=null and deliveryDocumentNumber !='' ">
            deliveryDocumentNumber = #{deliveryDocumentNumber},
        </if>
        <if test="receiptAcceptanceStatus !=null and receiptAcceptanceStatus !='' ">
            receiptAcceptanceStatus = #{receiptAcceptanceStatus},
        </if>
        <if test="warehouseShipmentTime !=null and warehouseShipmentTime !='' ">
            warehouseShipmentTime = #{warehouseShipmentTime},
        </if>
        <if test="storeAcceptanceTime !=null and storeAcceptanceTime !='' ">
            storeAcceptanceTime = #{storeAcceptanceTime},
        </if>
        <if test="receiver !=null and receiver !='' ">
            receiver = #{receiver},
        </if>
        <if test="acceptor !=null and acceptor !='' ">
            acceptor = #{acceptor},
        </if>
        <if test="receiptPushStatus !=null and receiptPushStatus !='' ">
            receiptPushStatus = #{receiptPushStatus},
        </if>
        <if test="acceptancePushStatus !=null and acceptancePushStatus !='' ">
            acceptancePushStatus = #{acceptancePushStatus},
        </if>
        <if test="electronicSealStatus !=null and electronicSealStatus !='' ">
            electronicSealStatus = #{electronicSealStatus},
        </if>
        <if test="operation !=null and operation !='' ">
            operation = #{operation},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="deliveryDocumentNumber !=null and deliveryDocumentNumber !='' ">
            deliveryDocumentNumber,
        </if>
        <if test="receiptAcceptanceStatus !=null and receiptAcceptanceStatus !='' ">
            receiptAcceptanceStatus,
        </if>
        <if test="warehouseShipmentTime !=null and warehouseShipmentTime !='' ">
            warehouseShipmentTime,
        </if>
        <if test="storeAcceptanceTime !=null and storeAcceptanceTime !='' ">
            storeAcceptanceTime,
        </if>
        <if test="receiver !=null and receiver !='' ">
            receiver,
        </if>
        <if test="acceptor !=null and acceptor !='' ">
            acceptor,
        </if>
        <if test="receiptPushStatus !=null and receiptPushStatus !='' ">
            receiptPushStatus,
        </if>
        <if test="acceptancePushStatus !=null and acceptancePushStatus !='' ">
            acceptancePushStatus,
        </if>
        <if test="electronicSealStatus !=null and electronicSealStatus !='' ">
            electronicSealStatus,
        </if>
        <if test="operation !=null and operation !='' ">
            operation,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="deliveryDocumentNumber !=null and deliveryDocumentNumber !='' ">
             #{deliveryDocumentNumber},
        </if>
        <if test="receiptAcceptanceStatus !=null and receiptAcceptanceStatus !='' ">
             #{receiptAcceptanceStatus},
        </if>
        <if test="warehouseShipmentTime !=null and warehouseShipmentTime !='' ">
             #{warehouseShipmentTime},
        </if>
        <if test="storeAcceptanceTime !=null and storeAcceptanceTime !='' ">
             #{storeAcceptanceTime},
        </if>
        <if test="receiver !=null and receiver !='' ">
             #{receiver},
        </if>
        <if test="acceptor !=null and acceptor !='' ">
             #{acceptor},
        </if>
        <if test="receiptPushStatus !=null and receiptPushStatus !='' ">
             #{receiptPushStatus},
        </if>
        <if test="acceptancePushStatus !=null and acceptancePushStatus !='' ">
             #{acceptancePushStatus},
        </if>
        <if test="electronicSealStatus !=null and electronicSealStatus !='' ">
             #{electronicSealStatus},
        </if>
        <if test="operation !=null and operation !='' ">
             #{operation},
        </if>
        </trim>

    </insert>

</mapper>
