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

    <select id="selectSFwglServerorderinfoList" parameterType="pd" resultType="pd">
        select * from s_fwgl_serverorderinfo where 1=1
        <if test="orderNumber !=null and orderNumber !='' ">
            and orderNumber = #{orderNumber}
        </if>
        <if test="productType !=null and productType !='' ">
            and productType = #{productType}
        </if>
        <if test="productEnterprise !=null and productEnterprise !='' ">
            and productEnterprise = #{productEnterprise}
        </if>
        <if test="productName !=null and productName !='' ">
            and productName = #{productName}
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            and orderTime = #{orderTime}
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
            and orderAmount = #{orderAmount}
        </if>
        <if test="orderSource !=null and orderSource !='' ">
            and orderSource = #{orderSource}
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            and orderStatus = #{orderStatus}
        </if>
        <if test="orderingAccount !=null and orderingAccount !='' ">
            and orderingAccount = #{orderingAccount}
        </if>
        <if test="userId !=null and userId !='' ">
            and userId = #{userId}
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
            and orderingPhone = #{orderingPhone}
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
            and orderingStore = #{orderingStore}
        </if>
        <if test="storeCode !=null and storeCode !='' ">
            and storeCode = #{storeCode}
        </if>
        <if test="refundOperator !=null and refundOperator !='' ">
            and refundOperator = #{refundOperator}
        </if>
        <if test="couponUsed !=null and couponUsed !='' ">
            and couponUsed = #{couponUsed}
        </if>
        <if test="physicalRedemptionUsed !=null and physicalRedemptionUsed !='' ">
            and physicalRedemptionUsed = #{physicalRedemptionUsed}
        </if>
        <if test="salesChannel !=null and salesChannel !='' ">
            and salesChannel = #{salesChannel}
        </if>
    </select>


    <update id="updateSFwglServerorderinfo" parameterType="pd" >
        update s_fwgl_serverorderinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="orderNumber !=null and orderNumber !='' ">
            orderNumber = #{orderNumber},
        </if>
        <if test="productType !=null and productType !='' ">
            productType = #{productType},
        </if>
        <if test="productEnterprise !=null and productEnterprise !='' ">
            productEnterprise = #{productEnterprise},
        </if>
        <if test="productName !=null and productName !='' ">
            productName = #{productName},
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            orderTime = #{orderTime},
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
            orderAmount = #{orderAmount},
        </if>
        <if test="orderSource !=null and orderSource !='' ">
            orderSource = #{orderSource},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus = #{orderStatus},
        </if>
        <if test="orderingAccount !=null and orderingAccount !='' ">
            orderingAccount = #{orderingAccount},
        </if>
        <if test="userId !=null and userId !='' ">
            userId = #{userId},
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
            orderingPhone = #{orderingPhone},
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
            orderingStore = #{orderingStore},
        </if>
        <if test="storeCode !=null and storeCode !='' ">
            storeCode = #{storeCode},
        </if>
        <if test="refundOperator !=null and refundOperator !='' ">
            refundOperator = #{refundOperator},
        </if>
        <if test="couponUsed !=null and couponUsed !='' ">
            couponUsed = #{couponUsed},
        </if>
        <if test="physicalRedemptionUsed !=null and physicalRedemptionUsed !='' ">
            physicalRedemptionUsed = #{physicalRedemptionUsed},
        </if>
        <if test="salesChannel !=null and salesChannel !='' ">
            salesChannel = #{salesChannel},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="orderNumber !=null and orderNumber !='' ">
            orderNumber,
        </if>
        <if test="productType !=null and productType !='' ">
            productType,
        </if>
        <if test="productEnterprise !=null and productEnterprise !='' ">
            productEnterprise,
        </if>
        <if test="productName !=null and productName !='' ">
            productName,
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            orderTime,
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
            orderAmount,
        </if>
        <if test="orderSource !=null and orderSource !='' ">
            orderSource,
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
            orderStatus,
        </if>
        <if test="orderingAccount !=null and orderingAccount !='' ">
            orderingAccount,
        </if>
        <if test="userId !=null and userId !='' ">
            userId,
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
            orderingPhone,
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
            orderingStore,
        </if>
        <if test="storeCode !=null and storeCode !='' ">
            storeCode,
        </if>
        <if test="refundOperator !=null and refundOperator !='' ">
            refundOperator,
        </if>
        <if test="couponUsed !=null and couponUsed !='' ">
            couponUsed,
        </if>
        <if test="physicalRedemptionUsed !=null and physicalRedemptionUsed !='' ">
            physicalRedemptionUsed,
        </if>
        <if test="salesChannel !=null and salesChannel !='' ">
            salesChannel,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="orderNumber !=null and orderNumber !='' ">
             #{orderNumber},
        </if>
        <if test="productType !=null and productType !='' ">
             #{productType},
        </if>
        <if test="productEnterprise !=null and productEnterprise !='' ">
             #{productEnterprise},
        </if>
        <if test="productName !=null and productName !='' ">
             #{productName},
        </if>
        <if test="orderTime !=null and orderTime !='' ">
             #{orderTime},
        </if>
        <if test="orderAmount !=null and orderAmount !='' ">
             #{orderAmount},
        </if>
        <if test="orderSource !=null and orderSource !='' ">
             #{orderSource},
        </if>
        <if test="orderStatus !=null and orderStatus !='' ">
             #{orderStatus},
        </if>
        <if test="orderingAccount !=null and orderingAccount !='' ">
             #{orderingAccount},
        </if>
        <if test="userId !=null and userId !='' ">
             #{userId},
        </if>
        <if test="orderingPhone !=null and orderingPhone !='' ">
             #{orderingPhone},
        </if>
        <if test="orderingStore !=null and orderingStore !='' ">
             #{orderingStore},
        </if>
        <if test="storeCode !=null and storeCode !='' ">
             #{storeCode},
        </if>
        <if test="refundOperator !=null and refundOperator !='' ">
             #{refundOperator},
        </if>
        <if test="couponUsed !=null and couponUsed !='' ">
             #{couponUsed},
        </if>
        <if test="physicalRedemptionUsed !=null and physicalRedemptionUsed !='' ">
             #{physicalRedemptionUsed},
        </if>
        <if test="salesChannel !=null and salesChannel !='' ">
             #{salesChannel},
        </if>
        </trim>

    </insert>

</mapper>
