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

    <select id="selectSHyglJfglOrderinfoList" parameterType="pd" resultType="pd">
        select * from s_hygl_jfgl_orderinfo where 1=1
        <if test="orderID !=null and orderID !='' ">
            and orderID = #{orderID}
        </if>
        <if test="productName !=null and productName !='' ">
            and productName = #{productName}
        </if>
        <if test="productType !=null and productType !='' ">
            and productType = #{productType}
        </if>
        <if test="orderTotalPrice !=null and orderTotalPrice !='' ">
            and orderTotalPrice = #{orderTotalPrice}
        </if>
        <if test="externalPointsPaid !=null and externalPointsPaid !='' ">
            and externalPointsPaid = #{externalPointsPaid}
        </if>
        <if test="isPromotionOrder !=null and isPromotionOrder !='' ">
            and isPromotionOrder = #{isPromotionOrder}
        </if>
        <if test="redemptionQuantity !=null and redemptionQuantity !='' ">
            and redemptionQuantity = #{redemptionQuantity}
        </if>
        <if test="redemptionChannel !=null and redemptionChannel !='' ">
            and redemptionChannel = #{redemptionChannel}
        </if>
        <if test="paymentMethod !=null and paymentMethod !='' ">
            and paymentMethod = #{paymentMethod}
        </if>
        <if test="redemptionStatus !=null and redemptionStatus !='' ">
            and redemptionStatus = #{redemptionStatus}
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            and orderTime = #{orderTime}
        </if>
        <if test="memberPhoneOrCardNo !=null and memberPhoneOrCardNo !='' ">
            and memberPhoneOrCardNo = #{memberPhoneOrCardNo}
        </if>
        <if test="userRole !=null and userRole !='' ">
            and userRole = #{userRole}
        </if>
        <if test="pickupOrRedemptionStore !=null and pickupOrRedemptionStore !='' ">
            and pickupOrRedemptionStore = #{pickupOrRedemptionStore}
        </if>
        <if test="recommendingEmployee !=null and recommendingEmployee !='' ">
            and recommendingEmployee = #{recommendingEmployee}
        </if>
        <if test="recommendingStore !=null and recommendingStore !='' ">
            and recommendingStore = #{recommendingStore}
        </if>
        <if test="verificationStore !=null and verificationStore !='' ">
            and verificationStore = #{verificationStore}
        </if>
        <if test="verifiedBy !=null and verifiedBy !='' ">
            and verifiedBy = #{verifiedBy}
        </if>
        <if test="verificationTime !=null and verificationTime !='' ">
            and verificationTime = #{verificationTime}
        </if>
    </select>


    <update id="updateSHyglJfglOrderinfo" parameterType="pd" >
        update s_hygl_jfgl_orderinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="orderID !=null and orderID !='' ">
            orderID = #{orderID},
        </if>
        <if test="productName !=null and productName !='' ">
            productName = #{productName},
        </if>
        <if test="productType !=null and productType !='' ">
            productType = #{productType},
        </if>
        <if test="orderTotalPrice !=null and orderTotalPrice !='' ">
            orderTotalPrice = #{orderTotalPrice},
        </if>
        <if test="externalPointsPaid !=null and externalPointsPaid !='' ">
            externalPointsPaid = #{externalPointsPaid},
        </if>
        <if test="isPromotionOrder !=null and isPromotionOrder !='' ">
            isPromotionOrder = #{isPromotionOrder},
        </if>
        <if test="redemptionQuantity !=null and redemptionQuantity !='' ">
            redemptionQuantity = #{redemptionQuantity},
        </if>
        <if test="redemptionChannel !=null and redemptionChannel !='' ">
            redemptionChannel = #{redemptionChannel},
        </if>
        <if test="paymentMethod !=null and paymentMethod !='' ">
            paymentMethod = #{paymentMethod},
        </if>
        <if test="redemptionStatus !=null and redemptionStatus !='' ">
            redemptionStatus = #{redemptionStatus},
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            orderTime = #{orderTime},
        </if>
        <if test="memberPhoneOrCardNo !=null and memberPhoneOrCardNo !='' ">
            memberPhoneOrCardNo = #{memberPhoneOrCardNo},
        </if>
        <if test="userRole !=null and userRole !='' ">
            userRole = #{userRole},
        </if>
        <if test="pickupOrRedemptionStore !=null and pickupOrRedemptionStore !='' ">
            pickupOrRedemptionStore = #{pickupOrRedemptionStore},
        </if>
        <if test="recommendingEmployee !=null and recommendingEmployee !='' ">
            recommendingEmployee = #{recommendingEmployee},
        </if>
        <if test="recommendingStore !=null and recommendingStore !='' ">
            recommendingStore = #{recommendingStore},
        </if>
        <if test="verificationStore !=null and verificationStore !='' ">
            verificationStore = #{verificationStore},
        </if>
        <if test="verifiedBy !=null and verifiedBy !='' ">
            verifiedBy = #{verifiedBy},
        </if>
        <if test="verificationTime !=null and verificationTime !='' ">
            verificationTime = #{verificationTime},
        </if>
            <if test="exchangeCode !=null and exchangeCode !='' ">
                exchangeCode = #{exchangeCode},
            </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="orderID !=null and orderID !='' ">
            orderID,
        </if>
        <if test="productName !=null and productName !='' ">
            productName,
        </if>
        <if test="productType !=null and productType !='' ">
            productType,
        </if>
        <if test="orderTotalPrice !=null and orderTotalPrice !='' ">
            orderTotalPrice,
        </if>
        <if test="externalPointsPaid !=null and externalPointsPaid !='' ">
            externalPointsPaid,
        </if>
        <if test="isPromotionOrder !=null and isPromotionOrder !='' ">
            isPromotionOrder,
        </if>
        <if test="redemptionQuantity !=null and redemptionQuantity !='' ">
            redemptionQuantity,
        </if>
        <if test="redemptionChannel !=null and redemptionChannel !='' ">
            redemptionChannel,
        </if>
        <if test="paymentMethod !=null and paymentMethod !='' ">
            paymentMethod,
        </if>
        <if test="redemptionStatus !=null and redemptionStatus !='' ">
            redemptionStatus,
        </if>
        <if test="orderTime !=null and orderTime !='' ">
            orderTime,
        </if>
        <if test="memberPhoneOrCardNo !=null and memberPhoneOrCardNo !='' ">
            memberPhoneOrCardNo,
        </if>
        <if test="userRole !=null and userRole !='' ">
            userRole,
        </if>
        <if test="pickupOrRedemptionStore !=null and pickupOrRedemptionStore !='' ">
            pickupOrRedemptionStore,
        </if>
        <if test="recommendingEmployee !=null and recommendingEmployee !='' ">
            recommendingEmployee,
        </if>
        <if test="recommendingStore !=null and recommendingStore !='' ">
            recommendingStore,
        </if>
        <if test="verificationStore !=null and verificationStore !='' ">
            verificationStore,
        </if>
        <if test="verifiedBy !=null and verifiedBy !='' ">
            verifiedBy,
        </if>
        <if test="verificationTime !=null and verificationTime !='' ">
            verificationTime,
        </if>
            <if test="exchangeCode !=null and exchangeCode !='' ">
                exchangeCode,
            </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="orderID !=null and orderID !='' ">
             #{orderID},
        </if>
        <if test="productName !=null and productName !='' ">
             #{productName},
        </if>
        <if test="productType !=null and productType !='' ">
             #{productType},
        </if>
        <if test="orderTotalPrice !=null and orderTotalPrice !='' ">
             #{orderTotalPrice},
        </if>
        <if test="externalPointsPaid !=null and externalPointsPaid !='' ">
             #{externalPointsPaid},
        </if>
        <if test="isPromotionOrder !=null and isPromotionOrder !='' ">
             #{isPromotionOrder},
        </if>
        <if test="redemptionQuantity !=null and redemptionQuantity !='' ">
             #{redemptionQuantity},
        </if>
        <if test="redemptionChannel !=null and redemptionChannel !='' ">
             #{redemptionChannel},
        </if>
        <if test="paymentMethod !=null and paymentMethod !='' ">
             #{paymentMethod},
        </if>
        <if test="redemptionStatus !=null and redemptionStatus !='' ">
             #{redemptionStatus},
        </if>
        <if test="orderTime !=null and orderTime !='' ">
             #{orderTime},
        </if>
        <if test="memberPhoneOrCardNo !=null and memberPhoneOrCardNo !='' ">
             #{memberPhoneOrCardNo},
        </if>
        <if test="userRole !=null and userRole !='' ">
             #{userRole},
        </if>
        <if test="pickupOrRedemptionStore !=null and pickupOrRedemptionStore !='' ">
             #{pickupOrRedemptionStore},
        </if>
        <if test="recommendingEmployee !=null and recommendingEmployee !='' ">
             #{recommendingEmployee},
        </if>
        <if test="recommendingStore !=null and recommendingStore !='' ">
             #{recommendingStore},
        </if>
        <if test="verificationStore !=null and verificationStore !='' ">
             #{verificationStore},
        </if>
        <if test="verifiedBy !=null and verifiedBy !='' ">
             #{verifiedBy},
        </if>
        <if test="verificationTime !=null and verificationTime !='' ">
             #{verificationTime},
        </if>
            <if test="exchangeCode !=null and exchangeCode !='' ">
                #{exchangeCode},
            </if>
        </trim>

    </insert>

</mapper>
