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

    <select id="selectSMdyyglMdysjqStoreweightinfoList" parameterType="pd" resultType="pd">
        select * from s_mdyygl_mdysjq_storeweightinfo where 1=1
        <if test="storeName !=null and storeName !='' ">
            and storeName = #{storeName}
        </if>
        <if test="date !=null and date !='' ">
            and date = #{date}
        </if>
        <if test="channel !=null and channel !='' ">
            and channel = #{channel}
        </if>
        <if test="storeCode !=null and storeCode !='' ">
            and storeCode = #{storeCode}
        </if>
        <if test="specialDay !=null and specialDay !='' ">
            and specialDay = #{specialDay}
        </if>
        <if test="budgetValue !=null and budgetValue !='' ">
            and budgetValue = #{budgetValue}
        </if>
        <if test="weightCoefficient !=null and weightCoefficient !='' ">
            and weightCoefficient = #{weightCoefficient}
        </if>
        <if test="actualSales !=null and actualSales !='' ">
            and actualSales = #{actualSales}
        </if>
        <if test="budgetAchievementRate !=null and budgetAchievementRate !='' ">
            and budgetAchievementRate = #{budgetAchievementRate}
        </if>
        <if test="planValue !=null and planValue !='' ">
            and planValue = #{planValue}
        </if>
        <if test="planAchievementRate !=null and planAchievementRate !='' ">
            and planAchievementRate = #{planAchievementRate}
        </if>
        <if test="budgetCycle !=null and budgetCycle !='' ">
            and budgetCycle = #{budgetCycle}
        </if>
        <if test="storeRange !=null and storeRange !='' ">
            and storeRange = #{storeRange}
        </if>
        <if test="channelName !=null and channelName !='' ">
            and channelName = #{channelName}
        </if>
    </select>


    <update id="updateSMdyyglMdysjqStoreweightinfo" parameterType="pd" >
        update s_mdyygl_mdysjq_storeweightinfo
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="storeCode !=null and storeCode !='' ">
            storeCode = #{storeCode},
        </if>
        <if test="specialDay !=null and specialDay !='' ">
            specialDay = #{specialDay},
        </if>
        <if test="budgetValue !=null and budgetValue !='' ">
            budgetValue = #{budgetValue},
        </if>
        <if test="weightCoefficient !=null and weightCoefficient !='' ">
            weightCoefficient = #{weightCoefficient},
        </if>
        <if test="actualSales !=null and actualSales !='' ">
            actualSales = #{actualSales},
        </if>
        <if test="budgetAchievementRate !=null and budgetAchievementRate !='' ">
            budgetAchievementRate = #{budgetAchievementRate},
        </if>
        <if test="planValue !=null and planValue !='' ">
            planValue = #{planValue},
        </if>
        <if test="planAchievementRate !=null and planAchievementRate !='' ">
            planAchievementRate = #{planAchievementRate},
        </if>
        <if test="budgetCycle !=null and budgetCycle !='' ">
            budgetCycle = #{budgetCycle},
        </if>
        <if test="storeRange !=null and storeRange !='' ">
            storeRange = #{storeRange},
        </if>
        <if test="channelName !=null and channelName !='' ">
            channelName = #{channelName},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

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

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

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

        <if test="storeCode !=null and storeCode !='' ">
            storeCode,
        </if>
        <if test="specialDay !=null and specialDay !='' ">
            specialDay,
        </if>
        <if test="budgetValue !=null and budgetValue !='' ">
            budgetValue,
        </if>
        <if test="weightCoefficient !=null and weightCoefficient !='' ">
            weightCoefficient,
        </if>
        <if test="actualSales !=null and actualSales !='' ">
            actualSales,
        </if>
        <if test="budgetAchievementRate !=null and budgetAchievementRate !='' ">
            budgetAchievementRate,
        </if>
        <if test="planValue !=null and planValue !='' ">
            planValue,
        </if>
        <if test="planAchievementRate !=null and planAchievementRate !='' ">
            planAchievementRate,
        </if>
        <if test="budgetCycle !=null and budgetCycle !='' ">
            budgetCycle,
        </if>
        <if test="storeRange !=null and storeRange !='' ">
            storeRange,
        </if>
        <if test="channelName !=null and channelName !='' ">
            channelName,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="storeCode !=null and storeCode !='' ">
             #{storeCode},
        </if>
        <if test="specialDay !=null and specialDay !='' ">
             #{specialDay},
        </if>
        <if test="budgetValue !=null and budgetValue !='' ">
             #{budgetValue},
        </if>
        <if test="weightCoefficient !=null and weightCoefficient !='' ">
             #{weightCoefficient},
        </if>
        <if test="actualSales !=null and actualSales !='' ">
             #{actualSales},
        </if>
        <if test="budgetAchievementRate !=null and budgetAchievementRate !='' ">
             #{budgetAchievementRate},
        </if>
        <if test="planValue !=null and planValue !='' ">
             #{planValue},
        </if>
        <if test="planAchievementRate !=null and planAchievementRate !='' ">
             #{planAchievementRate},
        </if>
        <if test="budgetCycle !=null and budgetCycle !='' ">
             #{budgetCycle},
        </if>
        <if test="storeRange !=null and storeRange !='' ">
             #{storeRange},
        </if>
        <if test="channelName !=null and channelName !='' ">
             #{channelName},
        </if>
        </trim>

    </insert>

</mapper>
