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

    <select id="selectSMdyyglMdysjqStoreweightsettingList" parameterType="pd" resultType="pd">
        select * from s_mdyygl_mdysjq_storeweightsetting where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="date !=null and date !='' ">
            and date = #{date}
        </if>
        <if test="storeRange !=null and storeRange !='' ">
            and storeRange = #{storeRange}
        </if>
        <if test="storeName !=null and storeName !='' ">
            and storeName = #{storeName}
        </if>
        <if test="memberDay !=null and memberDay !='' ">
            and memberDay = #{memberDay}
        </if>
        <if test="superMemberDay !=null and superMemberDay !='' ">
            and superMemberDay = #{superMemberDay}
        </if>
        <if test="promotionDay !=null and promotionDay !='' ">
            and promotionDay = #{promotionDay}
        </if>
        <if test="allChannelSalesBudget !=null and allChannelSalesBudget !='' ">
            and allChannelSalesBudget = #{allChannelSalesBudget}
        </if>
        <if test="allChannelSalesPlan !=null and allChannelSalesPlan !='' ">
            and allChannelSalesPlan = #{allChannelSalesPlan}
        </if>
        <if test="allChannelProfitBudget !=null and allChannelProfitBudget !='' ">
            and allChannelProfitBudget = #{allChannelProfitBudget}
        </if>
        <if test="allChannelProfitPlan !=null and allChannelProfitPlan !='' ">
            and allChannelProfitPlan = #{allChannelProfitPlan}
        </if>
        <if test="offlineSalesBudget !=null and offlineSalesBudget !='' ">
            and offlineSalesBudget = #{offlineSalesBudget}
        </if>
        <if test="offlineSalesPlan !=null and offlineSalesPlan !='' ">
            and offlineSalesPlan = #{offlineSalesPlan}
        </if>
        <if test="offlineProfitBudget !=null and offlineProfitBudget !='' ">
            and offlineProfitBudget = #{offlineProfitBudget}
        </if>
        <if test="offlineProfitPlan !=null and offlineProfitPlan !='' ">
            and offlineProfitPlan = #{offlineProfitPlan}
        </if>
        <if test="o2oSalesPlan !=null and o2oSalesPlan !='' ">
            and o2oSalesPlan = #{o2oSalesPlan}
        </if>
        <if test="o2oProfitPlan !=null and o2oProfitPlan !='' ">
            and o2oProfitPlan = #{o2oProfitPlan}
        </if>
        <if test="allChannelBrandSalesPlan !=null and allChannelBrandSalesPlan !='' ">
            and allChannelBrandSalesPlan = #{allChannelBrandSalesPlan}
        </if>
        <if test="allChannelBrandProfitPlan !=null and allChannelBrandProfitPlan !='' ">
            and allChannelBrandProfitPlan = #{allChannelBrandProfitPlan}
        </if>
        <if test="deliveryPickupTime !=null and deliveryPickupTime !='' ">
            and deliveryPickupTime = #{deliveryPickupTime}
        </if>
        <if test="remarks !=null and remarks !='' ">
            and remarks = #{remarks}
        </if>
    </select>


    <update id="updateSMdyyglMdysjqStoreweightsetting" parameterType="pd" >
        update s_mdyygl_mdysjq_storeweightsetting
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="date !=null and date !='' ">
            date = #{date},
        </if>
        <if test="storeRange !=null and storeRange !='' ">
            storeRange = #{storeRange},
        </if>
        <if test="storeName !=null and storeName !='' ">
            storeName = #{storeName},
        </if>
        <if test="memberDay !=null and memberDay !='' ">
            memberDay = #{memberDay},
        </if>
        <if test="superMemberDay !=null and superMemberDay !='' ">
            superMemberDay = #{superMemberDay},
        </if>
        <if test="promotionDay !=null and promotionDay !='' ">
            promotionDay = #{promotionDay},
        </if>
        <if test="allChannelSalesBudget !=null and allChannelSalesBudget !='' ">
            allChannelSalesBudget = #{allChannelSalesBudget},
        </if>
        <if test="allChannelSalesPlan !=null and allChannelSalesPlan !='' ">
            allChannelSalesPlan = #{allChannelSalesPlan},
        </if>
        <if test="allChannelProfitBudget !=null and allChannelProfitBudget !='' ">
            allChannelProfitBudget = #{allChannelProfitBudget},
        </if>
        <if test="allChannelProfitPlan !=null and allChannelProfitPlan !='' ">
            allChannelProfitPlan = #{allChannelProfitPlan},
        </if>
        <if test="offlineSalesBudget !=null and offlineSalesBudget !='' ">
            offlineSalesBudget = #{offlineSalesBudget},
        </if>
        <if test="offlineSalesPlan !=null and offlineSalesPlan !='' ">
            offlineSalesPlan = #{offlineSalesPlan},
        </if>
        <if test="offlineProfitBudget !=null and offlineProfitBudget !='' ">
            offlineProfitBudget = #{offlineProfitBudget},
        </if>
        <if test="offlineProfitPlan !=null and offlineProfitPlan !='' ">
            offlineProfitPlan = #{offlineProfitPlan},
        </if>
        <if test="o2oSalesPlan !=null and o2oSalesPlan !='' ">
            o2oSalesPlan = #{o2oSalesPlan},
        </if>
        <if test="o2oProfitPlan !=null and o2oProfitPlan !='' ">
            o2oProfitPlan = #{o2oProfitPlan},
        </if>
        <if test="allChannelBrandSalesPlan !=null and allChannelBrandSalesPlan !='' ">
            allChannelBrandSalesPlan = #{allChannelBrandSalesPlan},
        </if>
        <if test="allChannelBrandProfitPlan !=null and allChannelBrandProfitPlan !='' ">
            allChannelBrandProfitPlan = #{allChannelBrandProfitPlan},
        </if>
        <if test="deliveryPickupTime !=null and deliveryPickupTime !='' ">
            deliveryPickupTime = #{deliveryPickupTime},
        </if>
        <if test="remarks !=null and remarks !='' ">
            remarks = #{remarks},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="date !=null and date !='' ">
            date,
        </if>
        <if test="storeRange !=null and storeRange !='' ">
            storeRange,
        </if>
        <if test="storeName !=null and storeName !='' ">
            storeName,
        </if>
        <if test="memberDay !=null and memberDay !='' ">
            memberDay,
        </if>
        <if test="superMemberDay !=null and superMemberDay !='' ">
            superMemberDay,
        </if>
        <if test="promotionDay !=null and promotionDay !='' ">
            promotionDay,
        </if>
        <if test="allChannelSalesBudget !=null and allChannelSalesBudget !='' ">
            allChannelSalesBudget,
        </if>
        <if test="allChannelSalesPlan !=null and allChannelSalesPlan !='' ">
            allChannelSalesPlan,
        </if>
        <if test="allChannelProfitBudget !=null and allChannelProfitBudget !='' ">
            allChannelProfitBudget,
        </if>
        <if test="allChannelProfitPlan !=null and allChannelProfitPlan !='' ">
            allChannelProfitPlan,
        </if>
        <if test="offlineSalesBudget !=null and offlineSalesBudget !='' ">
            offlineSalesBudget,
        </if>
        <if test="offlineSalesPlan !=null and offlineSalesPlan !='' ">
            offlineSalesPlan,
        </if>
        <if test="offlineProfitBudget !=null and offlineProfitBudget !='' ">
            offlineProfitBudget,
        </if>
        <if test="offlineProfitPlan !=null and offlineProfitPlan !='' ">
            offlineProfitPlan,
        </if>
        <if test="o2oSalesPlan !=null and o2oSalesPlan !='' ">
            o2oSalesPlan,
        </if>
        <if test="o2oProfitPlan !=null and o2oProfitPlan !='' ">
            o2oProfitPlan,
        </if>
        <if test="allChannelBrandSalesPlan !=null and allChannelBrandSalesPlan !='' ">
            allChannelBrandSalesPlan,
        </if>
        <if test="allChannelBrandProfitPlan !=null and allChannelBrandProfitPlan !='' ">
            allChannelBrandProfitPlan,
        </if>
        <if test="deliveryPickupTime !=null and deliveryPickupTime !='' ">
            deliveryPickupTime,
        </if>
        <if test="remarks !=null and remarks !='' ">
            remarks,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="date !=null and date !='' ">
             #{date},
        </if>
        <if test="storeRange !=null and storeRange !='' ">
             #{storeRange},
        </if>
        <if test="storeName !=null and storeName !='' ">
             #{storeName},
        </if>
        <if test="memberDay !=null and memberDay !='' ">
             #{memberDay},
        </if>
        <if test="superMemberDay !=null and superMemberDay !='' ">
             #{superMemberDay},
        </if>
        <if test="promotionDay !=null and promotionDay !='' ">
             #{promotionDay},
        </if>
        <if test="allChannelSalesBudget !=null and allChannelSalesBudget !='' ">
             #{allChannelSalesBudget},
        </if>
        <if test="allChannelSalesPlan !=null and allChannelSalesPlan !='' ">
             #{allChannelSalesPlan},
        </if>
        <if test="allChannelProfitBudget !=null and allChannelProfitBudget !='' ">
             #{allChannelProfitBudget},
        </if>
        <if test="allChannelProfitPlan !=null and allChannelProfitPlan !='' ">
             #{allChannelProfitPlan},
        </if>
        <if test="offlineSalesBudget !=null and offlineSalesBudget !='' ">
             #{offlineSalesBudget},
        </if>
        <if test="offlineSalesPlan !=null and offlineSalesPlan !='' ">
             #{offlineSalesPlan},
        </if>
        <if test="offlineProfitBudget !=null and offlineProfitBudget !='' ">
             #{offlineProfitBudget},
        </if>
        <if test="offlineProfitPlan !=null and offlineProfitPlan !='' ">
             #{offlineProfitPlan},
        </if>
        <if test="o2oSalesPlan !=null and o2oSalesPlan !='' ">
             #{o2oSalesPlan},
        </if>
        <if test="o2oProfitPlan !=null and o2oProfitPlan !='' ">
             #{o2oProfitPlan},
        </if>
        <if test="allChannelBrandSalesPlan !=null and allChannelBrandSalesPlan !='' ">
             #{allChannelBrandSalesPlan},
        </if>
        <if test="allChannelBrandProfitPlan !=null and allChannelBrandProfitPlan !='' ">
             #{allChannelBrandProfitPlan},
        </if>
        <if test="deliveryPickupTime !=null and deliveryPickupTime !='' ">
             #{deliveryPickupTime},
        </if>
        <if test="remarks !=null and remarks !='' ">
             #{remarks},
        </if>
        </trim>

    </insert>

</mapper>
