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

    <select id="selectSDdglFpglDsfzfkpList" parameterType="pd" resultType="pd">
        select * from s_ddgl_fpgl_dsfzfkp where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="orderNo !=null and orderNo !='' ">
            and orderNo = #{orderNo}
        </if>
        <if test="paymentMethodCode !=null and paymentMethodCode !='' ">
            and paymentMethodCode = #{paymentMethodCode}
        </if>
        <if test="paymentMethodName !=null and paymentMethodName !='' ">
            and paymentMethodName = #{paymentMethodName}
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
            and orderAmount = #{orderAmount}
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
            and billingAmount = #{billingAmount}
        </if>
        <if test="originalPositiveOrder !=null and originalPositiveOrder !='' ">
            and originalPositiveOrder = #{originalPositiveOrder}
        </if>
        <if test="orderCreateTime !=null and orderCreateTime !='' ">
            and orderCreateTime = #{orderCreateTime}
        </if>
        <if test="orderType !=null and orderType !='' ">
            and orderType = #{orderType}
        </if>
    </select>


    <update id="updateSDdglFpglDsfzfkp" parameterType="pd" >
        update s_ddgl_fpgl_dsfzfkp
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="orderNo !=null and orderNo !='' ">
            orderNo = #{orderNo},
        </if>
        <if test="paymentMethodCode !=null and paymentMethodCode !='' ">
            paymentMethodCode = #{paymentMethodCode},
        </if>
        <if test="paymentMethodName !=null and paymentMethodName !='' ">
            paymentMethodName = #{paymentMethodName},
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
            orderAmount = #{orderAmount},
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
            billingAmount = #{billingAmount},
        </if>
        <if test="originalPositiveOrder !=null and originalPositiveOrder !='' ">
            originalPositiveOrder = #{originalPositiveOrder},
        </if>
        <if test="orderCreateTime !=null and orderCreateTime !='' ">
            orderCreateTime = #{orderCreateTime},
        </if>
        <if test="orderType !=null and orderType !='' ">
            orderType = #{orderType},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="orderNo !=null and orderNo !='' ">
            orderNo,
        </if>
        <if test="paymentMethodCode !=null and paymentMethodCode !='' ">
            paymentMethodCode,
        </if>
        <if test="paymentMethodName !=null and paymentMethodName !='' ">
            paymentMethodName,
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
            orderAmount,
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
            billingAmount,
        </if>
        <if test="originalPositiveOrder !=null and originalPositiveOrder !='' ">
            originalPositiveOrder,
        </if>
        <if test="orderCreateTime !=null and orderCreateTime !='' ">
            orderCreateTime,
        </if>
        <if test="orderType !=null and orderType !='' ">
            orderType,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="orderNo !=null and orderNo !='' ">
             #{orderNo},
        </if>
        <if test="paymentMethodCode !=null and paymentMethodCode !='' ">
             #{paymentMethodCode},
        </if>
        <if test="paymentMethodName !=null and paymentMethodName !='' ">
             #{paymentMethodName},
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
             #{orderAmount},
        </if>
        <if test="billingAmount !=null and billingAmount !='' ">
             #{billingAmount},
        </if>
        <if test="originalPositiveOrder !=null and originalPositiveOrder !='' ">
             #{originalPositiveOrder},
        </if>
        <if test="orderCreateTime !=null and orderCreateTime !='' ">
             #{orderCreateTime},
        </if>
        <if test="orderType !=null and orderType !='' ">
             #{orderType},
        </if>
        </trim>

    </insert>

</mapper>
