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

    <select id="selectSDdglFpglInvoiceinfoList" parameterType="pd" resultType="pd">
        select * from s_ddgl_fpgl_invoiceinfo where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="platformOrderNo !=null and platformOrderNo !='' ">
            and platformOrderNo = #{platformOrderNo}
        </if>
        <if test="invoiceCode !=null and invoiceCode !='' ">
            and invoiceCode = #{invoiceCode}
        </if>
        <if test="invoiceNumber !=null and invoiceNumber !='' ">
            and invoiceNumber = #{invoiceNumber}
        </if>
        <if test="invoiceAmount !=null and invoiceAmount !='' ">
            and invoiceAmount = #{invoiceAmount}
        </if>
        <if test="channelStore !=null and channelStore !='' ">
            and channelStore = #{channelStore}
        </if>
        <if test="orderInvoiceType !=null and orderInvoiceType !='' ">
            and orderInvoiceType = #{orderInvoiceType}
        </if>
        <if test="invoiceType !=null and invoiceType !='' ">
            and invoiceType = #{invoiceType}
        </if>
        <if test="headerType !=null and headerType !='' ">
            and headerType = #{headerType}
        </if>
        <if test="headerName !=null and headerName !='' ">
            and headerName = #{headerName}
        </if>
        <if test="billingType !=null and billingType !='' ">
            and billingType = #{billingType}
        </if>
        <if test="billingTime !=null and billingTime !='' ">
            and billingTime = #{billingTime}
        </if>
        <if test="mailingInfo !=null and mailingInfo !='' ">
            and mailingInfo = #{mailingInfo}
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
            and billingAmount = #{billingAmount}
        </if>
        <if test="storeName !=null and storeName !='' ">
            and storeName = #{storeName}
        </if>
        <if test="auditType !=null and auditType !='' ">
            and auditType = #{auditType}
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
            and auditStatus = #{auditStatus}
        </if>
        <if test="noData !=null and noData !='' ">
            and noData = #{noData}
        </if>
        <if test="mergeOrderNo !=null and mergeOrderNo !='' ">
            and mergeOrderNo = #{mergeOrderNo}
        </if>
        <if test="orderNo !=null and orderNo !='' ">
            and orderNo = #{orderNo}
        </if>
        <if test="billingStatus !=null and billingStatus !='' ">
            and billingStatus = #{billingStatus}
        </if>
        <if test="createTime !=null and createTime !='' ">
            and createTime = #{createTime}
        </if>
    </select>


    <update id="updateSDdglFpglInvoiceinfo" parameterType="pd" >
        update s_ddgl_fpgl_invoiceinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="platformOrderNo !=null and platformOrderNo !='' ">
            platformOrderNo = #{platformOrderNo},
        </if>
        <if test="invoiceCode !=null and invoiceCode !='' ">
            invoiceCode = #{invoiceCode},
        </if>
        <if test="invoiceNumber !=null and invoiceNumber !='' ">
            invoiceNumber = #{invoiceNumber},
        </if>
        <if test="invoiceAmount !=null and invoiceAmount !='' ">
            invoiceAmount = #{invoiceAmount},
        </if>
        <if test="channelStore !=null and channelStore !='' ">
            channelStore = #{channelStore},
        </if>
        <if test="orderInvoiceType !=null and orderInvoiceType !='' ">
            orderInvoiceType = #{orderInvoiceType},
        </if>
        <if test="invoiceType !=null and invoiceType !='' ">
            invoiceType = #{invoiceType},
        </if>
        <if test="headerType !=null and headerType !='' ">
            headerType = #{headerType},
        </if>
        <if test="headerName !=null and headerName !='' ">
            headerName = #{headerName},
        </if>
        <if test="billingType !=null and billingType !='' ">
            billingType = #{billingType},
        </if>
        <if test="billingTime !=null and billingTime !='' ">
            billingTime = #{billingTime},
        </if>
        <if test="mailingInfo !=null and mailingInfo !='' ">
            mailingInfo = #{mailingInfo},
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
            billingAmount = #{billingAmount},
        </if>
        <if test="storeName !=null and storeName !='' ">
            storeName = #{storeName},
        </if>
        <if test="auditType !=null and auditType !='' ">
            auditType = #{auditType},
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
            auditStatus = #{auditStatus},
        </if>
        <if test="noData !=null and noData !='' ">
            noData = #{noData},
        </if>
        <if test="mergeOrderNo !=null and mergeOrderNo !='' ">
            mergeOrderNo = #{mergeOrderNo},
        </if>
        <if test="orderNo !=null and orderNo !='' ">
            orderNo = #{orderNo},
        </if>
        <if test="billingStatus !=null and billingStatus !='' ">
            billingStatus = #{billingStatus},
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime = #{createTime},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="platformOrderNo !=null and platformOrderNo !='' ">
            platformOrderNo,
        </if>
        <if test="invoiceCode !=null and invoiceCode !='' ">
            invoiceCode,
        </if>
        <if test="invoiceNumber !=null and invoiceNumber !='' ">
            invoiceNumber,
        </if>
        <if test="invoiceAmount !=null and invoiceAmount !='' ">
            invoiceAmount,
        </if>
        <if test="channelStore !=null and channelStore !='' ">
            channelStore,
        </if>
        <if test="orderInvoiceType !=null and orderInvoiceType !='' ">
            orderInvoiceType,
        </if>
        <if test="invoiceType !=null and invoiceType !='' ">
            invoiceType,
        </if>
        <if test="headerType !=null and headerType !='' ">
            headerType,
        </if>
        <if test="headerName !=null and headerName !='' ">
            headerName,
        </if>
        <if test="billingType !=null and billingType !='' ">
            billingType,
        </if>
        <if test="billingTime !=null and billingTime !='' ">
            billingTime,
        </if>
        <if test="mailingInfo !=null and mailingInfo !='' ">
            mailingInfo,
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
            billingAmount,
        </if>
        <if test="storeName !=null and storeName !='' ">
            storeName,
        </if>
        <if test="auditType !=null and auditType !='' ">
            auditType,
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
            auditStatus,
        </if>
        <if test="noData !=null and noData !='' ">
            noData,
        </if>
        <if test="mergeOrderNo !=null and mergeOrderNo !='' ">
            mergeOrderNo,
        </if>
        <if test="orderNo !=null and orderNo !='' ">
            orderNo,
        </if>
        <if test="billingStatus !=null and billingStatus !='' ">
            billingStatus,
        </if>
        <if test="createTime !=null and createTime !='' ">
            createTime,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="platformOrderNo !=null and platformOrderNo !='' ">
             #{platformOrderNo},
        </if>
        <if test="invoiceCode !=null and invoiceCode !='' ">
             #{invoiceCode},
        </if>
        <if test="invoiceNumber !=null and invoiceNumber !='' ">
             #{invoiceNumber},
        </if>
        <if test="invoiceAmount !=null and invoiceAmount !='' ">
             #{invoiceAmount},
        </if>
        <if test="channelStore !=null and channelStore !='' ">
             #{channelStore},
        </if>
        <if test="orderInvoiceType !=null and orderInvoiceType !='' ">
             #{orderInvoiceType},
        </if>
        <if test="invoiceType !=null and invoiceType !='' ">
             #{invoiceType},
        </if>
        <if test="headerType !=null and headerType !='' ">
             #{headerType},
        </if>
        <if test="headerName !=null and headerName !='' ">
             #{headerName},
        </if>
        <if test="billingType !=null and billingType !='' ">
             #{billingType},
        </if>
        <if test="billingTime !=null and billingTime !='' ">
             #{billingTime},
        </if>
        <if test="mailingInfo !=null and mailingInfo !='' ">
             #{mailingInfo},
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
             #{billingAmount},
        </if>
        <if test="storeName !=null and storeName !='' ">
             #{storeName},
        </if>
        <if test="auditType !=null and auditType !='' ">
             #{auditType},
        </if>
        <if test="auditStatus !=null and auditStatus !='' ">
             #{auditStatus},
        </if>
        <if test="noData !=null and noData !='' ">
             #{noData},
        </if>
        <if test="mergeOrderNo !=null and mergeOrderNo !='' ">
             #{mergeOrderNo},
        </if>
        <if test="orderNo !=null and orderNo !='' ">
             #{orderNo},
        </if>
        <if test="billingStatus !=null and billingStatus !='' ">
             #{billingStatus},
        </if>
        <if test="createTime !=null and createTime !='' ">
             #{createTime},
        </if>
        </trim>

    </insert>

</mapper>
