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

    <select id="selectSGkdgglCustomerOrderAuditList" parameterType="pd" resultType="pd">
        select * from s_gkdggl_customer_order_audit where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="updateTime !=null and updateTime !='' ">
            and updateTime = #{updateTime}
        </if>
        <if test="orderNumber !=null and orderNumber !='' ">
            and orderNumber = #{orderNumber}
        </if>
        <if test="createdBy !=null and createdBy !='' ">
            and createdBy = #{createdBy}
        </if>
        <if test="createdDate !=null and createdDate !='' ">
            and createdDate = #{createdDate}
        </if>
        <if test="recipientPhone !=null and recipientPhone !='' ">
            and recipientPhone = #{recipientPhone}
        </if>
        <if test="recipientName !=null and recipientName !='' ">
            and recipientName = #{recipientName}
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            and orderStatus = #{orderStatus}
        </if>
        <if test="operator !=null and operator !='' ">
            and operator = #{operator}
        </if>
        <if test="depositPaymentStatus !=null and depositPaymentStatus !='' ">
            and depositPaymentStatus = #{depositPaymentStatus}
        </if>
    </select>


    <update id="updateSGkdgglCustomerOrderAudit" parameterType="pd" >
        update s_gkdggl_customer_order_audit
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="updateTime !=null and updateTime !='' ">
            updateTime = #{updateTime},
        </if>
        <if test="orderNumber !=null and orderNumber !='' ">
            orderNumber = #{orderNumber},
        </if>
        <if test="createdBy !=null and createdBy !='' ">
            createdBy = #{createdBy},
        </if>
        <if test="createdDate !=null and createdDate !='' ">
            createdDate = #{createdDate},
        </if>
        <if test="recipientPhone !=null and recipientPhone !='' ">
            recipientPhone = #{recipientPhone},
        </if>
        <if test="recipientName !=null and recipientName !='' ">
            recipientName = #{recipientName},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus = #{orderStatus},
        </if>
        <if test="operator !=null and operator !='' ">
            operator = #{operator},
        </if>
        <if test="depositPaymentStatus !=null and depositPaymentStatus !='' ">
            depositPaymentStatus = #{depositPaymentStatus},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="updateTime !=null and updateTime !='' ">
            updateTime,
        </if>
        <if test="orderNumber !=null and orderNumber !='' ">
            orderNumber,
        </if>
        <if test="createdBy !=null and createdBy !='' ">
            createdBy,
        </if>
        <if test="createdDate !=null and createdDate !='' ">
            createdDate,
        </if>
        <if test="recipientPhone !=null and recipientPhone !='' ">
            recipientPhone,
        </if>
        <if test="recipientName !=null and recipientName !='' ">
            recipientName,
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus,
        </if>
        <if test="operator !=null and operator !='' ">
            operator,
        </if>
        <if test="depositPaymentStatus !=null and depositPaymentStatus !='' ">
            depositPaymentStatus,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="updateTime !=null and updateTime !='' ">
             #{updateTime},
        </if>
        <if test="orderNumber !=null and orderNumber !='' ">
             #{orderNumber},
        </if>
        <if test="createdBy !=null and createdBy !='' ">
             #{createdBy},
        </if>
        <if test="createdDate !=null and createdDate !='' ">
             #{createdDate},
        </if>
        <if test="recipientPhone !=null and recipientPhone !='' ">
             #{recipientPhone},
        </if>
        <if test="recipientName !=null and recipientName !='' ">
             #{recipientName},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
             #{orderStatus},
        </if>
        <if test="operator !=null and operator !='' ">
             #{operator},
        </if>
        <if test="depositPaymentStatus !=null and depositPaymentStatus !='' ">
             #{depositPaymentStatus},
        </if>
        </trim>

    </insert>

</mapper>
