<?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="com.bailuntec.mapper.DcAutoSalesMapper">
    <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcAutoSales">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="forecast_formula" jdbcType="VARCHAR" property="forecastFormula"/>
        <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku"/>
        <result column="title" jdbcType="VARCHAR" property="title"/>
        <result column="warehouse_code" jdbcType="VARCHAR" property="warehouseCode"/>
        <result column="category_id" jdbcType="INTEGER" property="categoryId"/>
        <result column="oneday_sales" jdbcType="INTEGER" property="onedaySales"/>
        <result column="twoday_sales" jdbcType="INTEGER" property="twodaySales"/>
        <result column="threeday_sales" jdbcType="INTEGER" property="threedaySales"/>
        <result column="fourthday_sales" jdbcType="INTEGER" property="fourthdaySales"/>
        <result column="fiveday_sales" jdbcType="INTEGER" property="fivedaySales"/>
        <result column="sixday_sales" jdbcType="INTEGER" property="sixdaySales"/>
        <result column="sevenday_sales" jdbcType="INTEGER" property="sevendaySales"/>
        <result column="eightday_sales" jdbcType="INTEGER" property="eightdaySales"/>
        <result column="nineday_sales" jdbcType="INTEGER" property="ninedaySales"/>
        <result column="tenday_sales" jdbcType="INTEGER" property="tendaySales"/>
        <result column="elevenday_sales" jdbcType="INTEGER" property="elevendaySales"/>
        <result column="twelveday_sales" jdbcType="INTEGER" property="twelvedaySales"/>
        <result column="thridteenday_sales" jdbcType="INTEGER" property="thridteendaySales"/>
        <result column="fourteenday_sales" jdbcType="INTEGER" property="fourteendaySales"/>
        <result column="fifteenday_sales" jdbcType="INTEGER" property="fifteendaySales"/>
        <result column="sixteenday_sales" jdbcType="INTEGER" property="sixteendaySales"/>
        <result column="seventeenday_sales" jdbcType="INTEGER" property="seventeendaySales"/>
        <result column="eighteenday_sales" jdbcType="INTEGER" property="eighteendaySales"/>
        <result column="nineteenday_sales" jdbcType="INTEGER" property="nineteendaySales"/>
        <result column="twentyday_sales" jdbcType="INTEGER" property="twentydaySales"/>
        <result column="twenty_oneday_sales" jdbcType="INTEGER" property="twentyOnedaySales"/>
        <result column="twenty_twoday_sales" jdbcType="INTEGER" property="twentyTwodaySales"/>
        <result column="twenty_threeday_sales" jdbcType="INTEGER" property="twentyThreedaySales"/>
        <result column="twenty_fourthday_sales" jdbcType="INTEGER" property="twentyFourthdaySales"/>
        <result column="twenty_fiveday_sales" jdbcType="INTEGER" property="twentyFivedaySales"/>
        <result column="twenty_sixday_sales" jdbcType="INTEGER" property="twentySixdaySales"/>
        <result column="twenty_seveneday_sales" jdbcType="INTEGER" property="twentySevenedaySales"/>
        <result column="twenty_eightday_sales" jdbcType="INTEGER" property="twentyEightdaySales"/>
        <result column="twenty_nineday_sales" jdbcType="INTEGER" property="twentyNinedaySales"/>
        <result column="thirtyday_sales" jdbcType="INTEGER" property="thirtydaySales"/>
        <result column="warehouse_name" jdbcType="VARCHAR" property="warehouseName"/>
        <result column="forecast_today_sales" jdbcType="DECIMAL" property="forecastTodaySales"/>
        <result column="forecast_oneday_sales" jdbcType="DECIMAL" property="forecastOnedaySales"/>
        <result column="forecast_twoday_sales" jdbcType="DECIMAL" property="forecastTwodaySales"/>
        <result column="forecast_threeday_sales" jdbcType="DECIMAL" property="forecastThreedaySales"/>
        <result column="forecast_fourthday_sales" jdbcType="DECIMAL" property="forecastFourthdaySales"/>
        <result column="forecast_fiveday_sales" jdbcType="DECIMAL" property="forecastFivedaySales"/>
        <result column="forecast_sixday_sales" jdbcType="DECIMAL" property="forecastSixdaySales"/>
        <result column="forecast_sevenday_sales" jdbcType="DECIMAL" property="forecastSevendaySales"/>
        <result column="forecast_eightday_sales" jdbcType="DECIMAL" property="forecastEightdaySales"/>
        <result column="forecast_nineday_sales" jdbcType="DECIMAL" property="forecastNinedaySales"/>
        <result column="forecast_tenday_sales" jdbcType="DECIMAL" property="forecastTendaySales"/>
        <result column="forecast_elevenday_sales" jdbcType="DECIMAL" property="forecastElevendaySales"/>
        <result column="forecast_twelveday_sales" jdbcType="DECIMAL" property="forecastTwelvedaySales"/>
        <result column="forecast_thridteenday_sales" jdbcType="DECIMAL" property="forecastThridteendaySales"/>
        <result column="forecast_fourteenday_sales" jdbcType="DECIMAL" property="forecastFourteendaySales"/>
        <result column="forecast_fifteenday_sales" jdbcType="DECIMAL" property="forecastFifteendaySales"/>
        <result column="forecast_sixteenday_sales" jdbcType="DECIMAL" property="forecastSixteendaySales"/>
        <result column="forecast_seventeenday_sales" jdbcType="DECIMAL" property="forecastSeventeendaySales"/>
        <result column="forecast_eighteenday_sales" jdbcType="DECIMAL" property="forecastEighteendaySales"/>
        <result column="forecast_nineteenday_sales" jdbcType="DECIMAL" property="forecastNineteendaySales"/>
        <result column="forecast_twentyday_sales" jdbcType="DECIMAL" property="forecastTwentydaySales"/>
        <result column="forecast_twenty_oneday_sales" jdbcType="DECIMAL" property="forecastTwentyOnedaySales"/>
        <result column="forecast_twenty_twoday_sales" jdbcType="DECIMAL" property="forecastTwentyTwodaySales"/>
        <result column="forecast_twenty_threeday_sales" jdbcType="DECIMAL" property="forecastTwentyThreedaySales"/>
        <result column="forecast_twenty_fourthday_sales" jdbcType="DECIMAL" property="forecastTwentyFourthdaySales"/>
        <result column="forecast_twenty_fiveday_sales" jdbcType="DECIMAL" property="forecastTwentyFivedaySales"/>
        <result column="forecast_twenty_sixday_sales" jdbcType="DECIMAL" property="forecastTwentySixdaySales"/>
        <result column="forecast_twenty_seveneday_sales" jdbcType="DECIMAL" property="forecastTwentySevenedaySales"/>
        <result column="forecast_twenty_eightday_sales" jdbcType="DECIMAL" property="forecastTwentyEightdaySales"/>
        <result column="forecast_twenty_nineday_sales" jdbcType="DECIMAL" property="forecastTwentyNinedaySales"/>
        <result column="forecast_thirtyday_sales" jdbcType="DECIMAL" property="forecastThirtydaySales"/>
        <result column="k_variable" jdbcType="DECIMAL" property="kVariable"/>
        <result column="b_variable" jdbcType="DECIMAL" property="bVariable"/>
        <result column="r_variable" jdbcType="DECIMAL" property="rVariable"/>
        <result column="average_sales" jdbcType="DECIMAL" property="averageSales"/>
        <result column="details" jdbcType="VARCHAR" property="details"/>
        <result column="fit_a_variable" jdbcType="DECIMAL" property="fitAVariable"/>
        <result column="fit_b_variable" jdbcType="DECIMAL" property="fitBVariable"/>
        <result column="fit_r_variable" jdbcType="DECIMAL" property="fitRVariable"/>
        <result column="fit_forecast_formula" jdbcType="VARCHAR" property="fitForecastFormula"/>
        <result column="history_sales_details" jdbcType="VARCHAR" property="historySalesDetails"/>
        <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
        <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
    </resultMap>
    <sql id="Example_Where_Clause">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        <where>
            <foreach collection="oredCriteria" item="criteria" separator="or">
                <if test="criteria.valid">
                    <trim prefix="(" prefixOverrides="and" suffix=")">
                        <foreach collection="criteria.criteria" item="criterion">
                            <choose>
                                <when test="criterion.noValue">
                                    and ${criterion.condition}
                                </when>
                                <when test="criterion.singleValue">
                                    and ${criterion.condition} #{criterion.value}
                                </when>
                                <when test="criterion.betweenValue">
                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                                </when>
                                <when test="criterion.listValue">
                                    and ${criterion.condition}
                                    <foreach close=")" collection="criterion.value" item="listItem" open="("
                                             separator=",">
                                        #{listItem}
                                    </foreach>
                                </when>
                            </choose>
                        </foreach>
                    </trim>
                </if>
            </foreach>
        </where>
    </sql>
    <sql id="Update_By_Example_Where_Clause">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        <where>
            <foreach collection="example.oredCriteria" item="criteria" separator="or">
                <if test="criteria.valid">
                    <trim prefix="(" prefixOverrides="and" suffix=")">
                        <foreach collection="criteria.criteria" item="criterion">
                            <choose>
                                <when test="criterion.noValue">
                                    and ${criterion.condition}
                                </when>
                                <when test="criterion.singleValue">
                                    and ${criterion.condition} #{criterion.value}
                                </when>
                                <when test="criterion.betweenValue">
                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                                </when>
                                <when test="criterion.listValue">
                                    and ${criterion.condition}
                                    <foreach close=")" collection="criterion.value" item="listItem" open="("
                                             separator=",">
                                        #{listItem}
                                    </foreach>
                                </when>
                            </choose>
                        </foreach>
                    </trim>
                </if>
            </foreach>
        </where>
    </sql>
    <sql id="Base_Column_List">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        id, forecast_formula, bailun_sku, title, warehouse_code, category_id, oneday_sales,
        twoday_sales, threeday_sales, fourthday_sales, fiveday_sales, sixday_sales, sevenday_sales,
        eightday_sales, nineday_sales, tenday_sales, elevenday_sales, twelveday_sales, thridteenday_sales,
        fourteenday_sales, fifteenday_sales, sixteenday_sales, seventeenday_sales, eighteenday_sales,
        nineteenday_sales, twentyday_sales, twenty_oneday_sales, twenty_twoday_sales, twenty_threeday_sales,
        twenty_fourthday_sales, twenty_fiveday_sales, twenty_sixday_sales, twenty_seveneday_sales,
        twenty_eightday_sales, twenty_nineday_sales, thirtyday_sales, warehouse_name, forecast_today_sales,
        forecast_oneday_sales, forecast_twoday_sales, forecast_threeday_sales, forecast_fourthday_sales,
        forecast_fiveday_sales, forecast_sixday_sales, forecast_sevenday_sales, forecast_eightday_sales,
        forecast_nineday_sales, forecast_tenday_sales, forecast_elevenday_sales, forecast_twelveday_sales,
        forecast_thridteenday_sales, forecast_fourteenday_sales, forecast_fifteenday_sales,
        forecast_sixteenday_sales, forecast_seventeenday_sales, forecast_eighteenday_sales,
        forecast_nineteenday_sales, forecast_twentyday_sales, forecast_twenty_oneday_sales,
        forecast_twenty_twoday_sales, forecast_twenty_threeday_sales, forecast_twenty_fourthday_sales,
        forecast_twenty_fiveday_sales, forecast_twenty_sixday_sales, forecast_twenty_seveneday_sales,
        forecast_twenty_eightday_sales, forecast_twenty_nineday_sales, forecast_thirtyday_sales,
        k_variable, b_variable, r_variable, average_sales, details, fit_a_variable, fit_b_variable,
        fit_r_variable, fit_forecast_formula, history_sales_details, gmt_create, gmt_modified
    </sql>
    <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcAutoSalesExample"
            resultMap="BaseResultMap">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        select
        <if test="distinct">
            distinct
        </if>
        <include refid="Base_Column_List"/>
        from dc_auto_sales
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
        <if test="orderByClause != null">
            order by ${orderByClause}
        </if>
        <if test="rows != null">
            <if test="offset != null">
                limit ${offset}, ${rows}
            </if>
            <if test="offset == null">
                limit ${rows}
            </if>
        </if>
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        select
        <include refid="Base_Column_List"/>
        from dc_auto_sales
        where id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        delete from dc_auto_sales
        where id = #{id,jdbcType=INTEGER}
    </delete>
    <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcAutoSalesExample">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        delete from dc_auto_sales
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </delete>
    <insert id="insert" parameterType="com.bailuntec.domain.entity.DcAutoSales">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        insert into dc_auto_sales (id, forecast_formula, bailun_sku,
        title, warehouse_code, category_id,
        oneday_sales, twoday_sales, threeday_sales,
        fourthday_sales, fiveday_sales, sixday_sales,
        sevenday_sales, eightday_sales, nineday_sales,
        tenday_sales, elevenday_sales, twelveday_sales,
        thridteenday_sales, fourteenday_sales, fifteenday_sales,
        sixteenday_sales, seventeenday_sales, eighteenday_sales,
        nineteenday_sales, twentyday_sales, twenty_oneday_sales,
        twenty_twoday_sales, twenty_threeday_sales,
        twenty_fourthday_sales, twenty_fiveday_sales,
        twenty_sixday_sales, twenty_seveneday_sales,
        twenty_eightday_sales, twenty_nineday_sales,
        thirtyday_sales, warehouse_name, forecast_today_sales,
        forecast_oneday_sales, forecast_twoday_sales,
        forecast_threeday_sales, forecast_fourthday_sales,
        forecast_fiveday_sales, forecast_sixday_sales,
        forecast_sevenday_sales, forecast_eightday_sales,
        forecast_nineday_sales, forecast_tenday_sales,
        forecast_elevenday_sales, forecast_twelveday_sales,
        forecast_thridteenday_sales, forecast_fourteenday_sales,
        forecast_fifteenday_sales, forecast_sixteenday_sales,
        forecast_seventeenday_sales, forecast_eighteenday_sales,
        forecast_nineteenday_sales, forecast_twentyday_sales,
        forecast_twenty_oneday_sales, forecast_twenty_twoday_sales,
        forecast_twenty_threeday_sales, forecast_twenty_fourthday_sales,
        forecast_twenty_fiveday_sales, forecast_twenty_sixday_sales,
        forecast_twenty_seveneday_sales, forecast_twenty_eightday_sales,
        forecast_twenty_nineday_sales, forecast_thirtyday_sales,
        k_variable, b_variable, r_variable,
        average_sales, details, fit_a_variable,
        fit_b_variable, fit_r_variable, fit_forecast_formula,
        history_sales_details, gmt_create, gmt_modified
        )
        values (#{id,jdbcType=INTEGER}, #{forecastFormula,jdbcType=VARCHAR}, #{bailunSku,jdbcType=VARCHAR},
        #{title,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{categoryId,jdbcType=INTEGER},
        #{onedaySales,jdbcType=INTEGER}, #{twodaySales,jdbcType=INTEGER}, #{threedaySales,jdbcType=INTEGER},
        #{fourthdaySales,jdbcType=INTEGER}, #{fivedaySales,jdbcType=INTEGER}, #{sixdaySales,jdbcType=INTEGER},
        #{sevendaySales,jdbcType=INTEGER}, #{eightdaySales,jdbcType=INTEGER}, #{ninedaySales,jdbcType=INTEGER},
        #{tendaySales,jdbcType=INTEGER}, #{elevendaySales,jdbcType=INTEGER}, #{twelvedaySales,jdbcType=INTEGER},
        #{thridteendaySales,jdbcType=INTEGER}, #{fourteendaySales,jdbcType=INTEGER},
        #{fifteendaySales,jdbcType=INTEGER},
        #{sixteendaySales,jdbcType=INTEGER}, #{seventeendaySales,jdbcType=INTEGER},
        #{eighteendaySales,jdbcType=INTEGER},
        #{nineteendaySales,jdbcType=INTEGER}, #{twentydaySales,jdbcType=INTEGER}, #{twentyOnedaySales,jdbcType=INTEGER},
        #{twentyTwodaySales,jdbcType=INTEGER}, #{twentyThreedaySales,jdbcType=INTEGER},
        #{twentyFourthdaySales,jdbcType=INTEGER}, #{twentyFivedaySales,jdbcType=INTEGER},
        #{twentySixdaySales,jdbcType=INTEGER}, #{twentySevenedaySales,jdbcType=INTEGER},
        #{twentyEightdaySales,jdbcType=INTEGER}, #{twentyNinedaySales,jdbcType=INTEGER},
        #{thirtydaySales,jdbcType=INTEGER}, #{warehouseName,jdbcType=VARCHAR}, #{forecastTodaySales,jdbcType=DECIMAL},
        #{forecastOnedaySales,jdbcType=DECIMAL}, #{forecastTwodaySales,jdbcType=DECIMAL},
        #{forecastThreedaySales,jdbcType=DECIMAL}, #{forecastFourthdaySales,jdbcType=DECIMAL},
        #{forecastFivedaySales,jdbcType=DECIMAL}, #{forecastSixdaySales,jdbcType=DECIMAL},
        #{forecastSevendaySales,jdbcType=DECIMAL}, #{forecastEightdaySales,jdbcType=DECIMAL},
        #{forecastNinedaySales,jdbcType=DECIMAL}, #{forecastTendaySales,jdbcType=DECIMAL},
        #{forecastElevendaySales,jdbcType=DECIMAL}, #{forecastTwelvedaySales,jdbcType=DECIMAL},
        #{forecastThridteendaySales,jdbcType=DECIMAL}, #{forecastFourteendaySales,jdbcType=DECIMAL},
        #{forecastFifteendaySales,jdbcType=DECIMAL}, #{forecastSixteendaySales,jdbcType=DECIMAL},
        #{forecastSeventeendaySales,jdbcType=DECIMAL}, #{forecastEighteendaySales,jdbcType=DECIMAL},
        #{forecastNineteendaySales,jdbcType=DECIMAL}, #{forecastTwentydaySales,jdbcType=DECIMAL},
        #{forecastTwentyOnedaySales,jdbcType=DECIMAL}, #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
        #{forecastTwentyThreedaySales,jdbcType=DECIMAL}, #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
        #{forecastTwentyFivedaySales,jdbcType=DECIMAL}, #{forecastTwentySixdaySales,jdbcType=DECIMAL},
        #{forecastTwentySevenedaySales,jdbcType=DECIMAL}, #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
        #{forecastTwentyNinedaySales,jdbcType=DECIMAL}, #{forecastThirtydaySales,jdbcType=DECIMAL},
        #{kVariable,jdbcType=DECIMAL}, #{bVariable,jdbcType=DECIMAL}, #{rVariable,jdbcType=DECIMAL},
        #{averageSales,jdbcType=DECIMAL}, #{details,jdbcType=VARCHAR}, #{fitAVariable,jdbcType=DECIMAL},
        #{fitBVariable,jdbcType=DECIMAL}, #{fitRVariable,jdbcType=DECIMAL}, #{fitForecastFormula,jdbcType=VARCHAR},
        #{historySalesDetails,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}
        )
    </insert>
    <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcAutoSales">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        insert into dc_auto_sales
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="forecastFormula != null">
                forecast_formula,
            </if>
            <if test="bailunSku != null">
                bailun_sku,
            </if>
            <if test="title != null">
                title,
            </if>
            <if test="warehouseCode != null">
                warehouse_code,
            </if>
            <if test="categoryId != null">
                category_id,
            </if>
            <if test="onedaySales != null">
                oneday_sales,
            </if>
            <if test="twodaySales != null">
                twoday_sales,
            </if>
            <if test="threedaySales != null">
                threeday_sales,
            </if>
            <if test="fourthdaySales != null">
                fourthday_sales,
            </if>
            <if test="fivedaySales != null">
                fiveday_sales,
            </if>
            <if test="sixdaySales != null">
                sixday_sales,
            </if>
            <if test="sevendaySales != null">
                sevenday_sales,
            </if>
            <if test="eightdaySales != null">
                eightday_sales,
            </if>
            <if test="ninedaySales != null">
                nineday_sales,
            </if>
            <if test="tendaySales != null">
                tenday_sales,
            </if>
            <if test="elevendaySales != null">
                elevenday_sales,
            </if>
            <if test="twelvedaySales != null">
                twelveday_sales,
            </if>
            <if test="thridteendaySales != null">
                thridteenday_sales,
            </if>
            <if test="fourteendaySales != null">
                fourteenday_sales,
            </if>
            <if test="fifteendaySales != null">
                fifteenday_sales,
            </if>
            <if test="sixteendaySales != null">
                sixteenday_sales,
            </if>
            <if test="seventeendaySales != null">
                seventeenday_sales,
            </if>
            <if test="eighteendaySales != null">
                eighteenday_sales,
            </if>
            <if test="nineteendaySales != null">
                nineteenday_sales,
            </if>
            <if test="twentydaySales != null">
                twentyday_sales,
            </if>
            <if test="twentyOnedaySales != null">
                twenty_oneday_sales,
            </if>
            <if test="twentyTwodaySales != null">
                twenty_twoday_sales,
            </if>
            <if test="twentyThreedaySales != null">
                twenty_threeday_sales,
            </if>
            <if test="twentyFourthdaySales != null">
                twenty_fourthday_sales,
            </if>
            <if test="twentyFivedaySales != null">
                twenty_fiveday_sales,
            </if>
            <if test="twentySixdaySales != null">
                twenty_sixday_sales,
            </if>
            <if test="twentySevenedaySales != null">
                twenty_seveneday_sales,
            </if>
            <if test="twentyEightdaySales != null">
                twenty_eightday_sales,
            </if>
            <if test="twentyNinedaySales != null">
                twenty_nineday_sales,
            </if>
            <if test="thirtydaySales != null">
                thirtyday_sales,
            </if>
            <if test="warehouseName != null">
                warehouse_name,
            </if>
            <if test="forecastTodaySales != null">
                forecast_today_sales,
            </if>
            <if test="forecastOnedaySales != null">
                forecast_oneday_sales,
            </if>
            <if test="forecastTwodaySales != null">
                forecast_twoday_sales,
            </if>
            <if test="forecastThreedaySales != null">
                forecast_threeday_sales,
            </if>
            <if test="forecastFourthdaySales != null">
                forecast_fourthday_sales,
            </if>
            <if test="forecastFivedaySales != null">
                forecast_fiveday_sales,
            </if>
            <if test="forecastSixdaySales != null">
                forecast_sixday_sales,
            </if>
            <if test="forecastSevendaySales != null">
                forecast_sevenday_sales,
            </if>
            <if test="forecastEightdaySales != null">
                forecast_eightday_sales,
            </if>
            <if test="forecastNinedaySales != null">
                forecast_nineday_sales,
            </if>
            <if test="forecastTendaySales != null">
                forecast_tenday_sales,
            </if>
            <if test="forecastElevendaySales != null">
                forecast_elevenday_sales,
            </if>
            <if test="forecastTwelvedaySales != null">
                forecast_twelveday_sales,
            </if>
            <if test="forecastThridteendaySales != null">
                forecast_thridteenday_sales,
            </if>
            <if test="forecastFourteendaySales != null">
                forecast_fourteenday_sales,
            </if>
            <if test="forecastFifteendaySales != null">
                forecast_fifteenday_sales,
            </if>
            <if test="forecastSixteendaySales != null">
                forecast_sixteenday_sales,
            </if>
            <if test="forecastSeventeendaySales != null">
                forecast_seventeenday_sales,
            </if>
            <if test="forecastEighteendaySales != null">
                forecast_eighteenday_sales,
            </if>
            <if test="forecastNineteendaySales != null">
                forecast_nineteenday_sales,
            </if>
            <if test="forecastTwentydaySales != null">
                forecast_twentyday_sales,
            </if>
            <if test="forecastTwentyOnedaySales != null">
                forecast_twenty_oneday_sales,
            </if>
            <if test="forecastTwentyTwodaySales != null">
                forecast_twenty_twoday_sales,
            </if>
            <if test="forecastTwentyThreedaySales != null">
                forecast_twenty_threeday_sales,
            </if>
            <if test="forecastTwentyFourthdaySales != null">
                forecast_twenty_fourthday_sales,
            </if>
            <if test="forecastTwentyFivedaySales != null">
                forecast_twenty_fiveday_sales,
            </if>
            <if test="forecastTwentySixdaySales != null">
                forecast_twenty_sixday_sales,
            </if>
            <if test="forecastTwentySevenedaySales != null">
                forecast_twenty_seveneday_sales,
            </if>
            <if test="forecastTwentyEightdaySales != null">
                forecast_twenty_eightday_sales,
            </if>
            <if test="forecastTwentyNinedaySales != null">
                forecast_twenty_nineday_sales,
            </if>
            <if test="forecastThirtydaySales != null">
                forecast_thirtyday_sales,
            </if>
            <if test="kVariable != null">
                k_variable,
            </if>
            <if test="bVariable != null">
                b_variable,
            </if>
            <if test="rVariable != null">
                r_variable,
            </if>
            <if test="averageSales != null">
                average_sales,
            </if>
            <if test="details != null">
                details,
            </if>
            <if test="fitAVariable != null">
                fit_a_variable,
            </if>
            <if test="fitBVariable != null">
                fit_b_variable,
            </if>
            <if test="fitRVariable != null">
                fit_r_variable,
            </if>
            <if test="fitForecastFormula != null">
                fit_forecast_formula,
            </if>
            <if test="historySalesDetails != null">
                history_sales_details,
            </if>
            <if test="gmtCreate != null">
                gmt_create,
            </if>
            <if test="gmtModified != null">
                gmt_modified,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="forecastFormula != null">
                #{forecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="bailunSku != null">
                #{bailunSku,jdbcType=VARCHAR},
            </if>
            <if test="title != null">
                #{title,jdbcType=VARCHAR},
            </if>
            <if test="warehouseCode != null">
                #{warehouseCode,jdbcType=VARCHAR},
            </if>
            <if test="categoryId != null">
                #{categoryId,jdbcType=INTEGER},
            </if>
            <if test="onedaySales != null">
                #{onedaySales,jdbcType=INTEGER},
            </if>
            <if test="twodaySales != null">
                #{twodaySales,jdbcType=INTEGER},
            </if>
            <if test="threedaySales != null">
                #{threedaySales,jdbcType=INTEGER},
            </if>
            <if test="fourthdaySales != null">
                #{fourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="fivedaySales != null">
                #{fivedaySales,jdbcType=INTEGER},
            </if>
            <if test="sixdaySales != null">
                #{sixdaySales,jdbcType=INTEGER},
            </if>
            <if test="sevendaySales != null">
                #{sevendaySales,jdbcType=INTEGER},
            </if>
            <if test="eightdaySales != null">
                #{eightdaySales,jdbcType=INTEGER},
            </if>
            <if test="ninedaySales != null">
                #{ninedaySales,jdbcType=INTEGER},
            </if>
            <if test="tendaySales != null">
                #{tendaySales,jdbcType=INTEGER},
            </if>
            <if test="elevendaySales != null">
                #{elevendaySales,jdbcType=INTEGER},
            </if>
            <if test="twelvedaySales != null">
                #{twelvedaySales,jdbcType=INTEGER},
            </if>
            <if test="thridteendaySales != null">
                #{thridteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fourteendaySales != null">
                #{fourteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fifteendaySales != null">
                #{fifteendaySales,jdbcType=INTEGER},
            </if>
            <if test="sixteendaySales != null">
                #{sixteendaySales,jdbcType=INTEGER},
            </if>
            <if test="seventeendaySales != null">
                #{seventeendaySales,jdbcType=INTEGER},
            </if>
            <if test="eighteendaySales != null">
                #{eighteendaySales,jdbcType=INTEGER},
            </if>
            <if test="nineteendaySales != null">
                #{nineteendaySales,jdbcType=INTEGER},
            </if>
            <if test="twentydaySales != null">
                #{twentydaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyOnedaySales != null">
                #{twentyOnedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyTwodaySales != null">
                #{twentyTwodaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyThreedaySales != null">
                #{twentyThreedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFourthdaySales != null">
                #{twentyFourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFivedaySales != null">
                #{twentyFivedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySixdaySales != null">
                #{twentySixdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySevenedaySales != null">
                #{twentySevenedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyEightdaySales != null">
                #{twentyEightdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyNinedaySales != null">
                #{twentyNinedaySales,jdbcType=INTEGER},
            </if>
            <if test="thirtydaySales != null">
                #{thirtydaySales,jdbcType=INTEGER},
            </if>
            <if test="warehouseName != null">
                #{warehouseName,jdbcType=VARCHAR},
            </if>
            <if test="forecastTodaySales != null">
                #{forecastTodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastOnedaySales != null">
                #{forecastOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwodaySales != null">
                #{forecastTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThreedaySales != null">
                #{forecastThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourthdaySales != null">
                #{forecastFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFivedaySales != null">
                #{forecastFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixdaySales != null">
                #{forecastSixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSevendaySales != null">
                #{forecastSevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEightdaySales != null">
                #{forecastEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNinedaySales != null">
                #{forecastNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTendaySales != null">
                #{forecastTendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastElevendaySales != null">
                #{forecastElevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwelvedaySales != null">
                #{forecastTwelvedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThridteendaySales != null">
                #{forecastThridteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourteendaySales != null">
                #{forecastFourteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFifteendaySales != null">
                #{forecastFifteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixteendaySales != null">
                #{forecastSixteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSeventeendaySales != null">
                #{forecastSeventeendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEighteendaySales != null">
                #{forecastEighteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNineteendaySales != null">
                #{forecastNineteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentydaySales != null">
                #{forecastTwentydaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyOnedaySales != null">
                #{forecastTwentyOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyTwodaySales != null">
                #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyThreedaySales != null">
                #{forecastTwentyThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFourthdaySales != null">
                #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFivedaySales != null">
                #{forecastTwentyFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySixdaySales != null">
                #{forecastTwentySixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySevenedaySales != null">
                #{forecastTwentySevenedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyEightdaySales != null">
                #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyNinedaySales != null">
                #{forecastTwentyNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThirtydaySales != null">
                #{forecastThirtydaySales,jdbcType=DECIMAL},
            </if>
            <if test="kVariable != null">
                #{kVariable,jdbcType=DECIMAL},
            </if>
            <if test="bVariable != null">
                #{bVariable,jdbcType=DECIMAL},
            </if>
            <if test="rVariable != null">
                #{rVariable,jdbcType=DECIMAL},
            </if>
            <if test="averageSales != null">
                #{averageSales,jdbcType=DECIMAL},
            </if>
            <if test="details != null">
                #{details,jdbcType=VARCHAR},
            </if>
            <if test="fitAVariable != null">
                #{fitAVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitBVariable != null">
                #{fitBVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitRVariable != null">
                #{fitRVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitForecastFormula != null">
                #{fitForecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="historySalesDetails != null">
                #{historySalesDetails,jdbcType=VARCHAR},
            </if>
            <if test="gmtCreate != null">
                #{gmtCreate,jdbcType=TIMESTAMP},
            </if>
            <if test="gmtModified != null">
                #{gmtModified,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>
    <select id="countByExample" parameterType="com.bailuntec.domain.example.DcAutoSalesExample"
            resultType="java.lang.Long">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        select count(*) from dc_auto_sales
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </select>
    <update id="updateByExampleSelective" parameterType="map">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        update dc_auto_sales
        <set>
            <if test="record.id != null">
                id = #{record.id,jdbcType=INTEGER},
            </if>
            <if test="record.forecastFormula != null">
                forecast_formula = #{record.forecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="record.bailunSku != null">
                bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
            </if>
            <if test="record.title != null">
                title = #{record.title,jdbcType=VARCHAR},
            </if>
            <if test="record.warehouseCode != null">
                warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
            </if>
            <if test="record.categoryId != null">
                category_id = #{record.categoryId,jdbcType=INTEGER},
            </if>
            <if test="record.onedaySales != null">
                oneday_sales = #{record.onedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twodaySales != null">
                twoday_sales = #{record.twodaySales,jdbcType=INTEGER},
            </if>
            <if test="record.threedaySales != null">
                threeday_sales = #{record.threedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.fourthdaySales != null">
                fourthday_sales = #{record.fourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="record.fivedaySales != null">
                fiveday_sales = #{record.fivedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.sixdaySales != null">
                sixday_sales = #{record.sixdaySales,jdbcType=INTEGER},
            </if>
            <if test="record.sevendaySales != null">
                sevenday_sales = #{record.sevendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.eightdaySales != null">
                eightday_sales = #{record.eightdaySales,jdbcType=INTEGER},
            </if>
            <if test="record.ninedaySales != null">
                nineday_sales = #{record.ninedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.tendaySales != null">
                tenday_sales = #{record.tendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.elevendaySales != null">
                elevenday_sales = #{record.elevendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twelvedaySales != null">
                twelveday_sales = #{record.twelvedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.thridteendaySales != null">
                thridteenday_sales = #{record.thridteendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.fourteendaySales != null">
                fourteenday_sales = #{record.fourteendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.fifteendaySales != null">
                fifteenday_sales = #{record.fifteendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.sixteendaySales != null">
                sixteenday_sales = #{record.sixteendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.seventeendaySales != null">
                seventeenday_sales = #{record.seventeendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.eighteendaySales != null">
                eighteenday_sales = #{record.eighteendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.nineteendaySales != null">
                nineteenday_sales = #{record.nineteendaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentydaySales != null">
                twentyday_sales = #{record.twentydaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentyOnedaySales != null">
                twenty_oneday_sales = #{record.twentyOnedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentyTwodaySales != null">
                twenty_twoday_sales = #{record.twentyTwodaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentyThreedaySales != null">
                twenty_threeday_sales = #{record.twentyThreedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentyFourthdaySales != null">
                twenty_fourthday_sales = #{record.twentyFourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentyFivedaySales != null">
                twenty_fiveday_sales = #{record.twentyFivedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentySixdaySales != null">
                twenty_sixday_sales = #{record.twentySixdaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentySevenedaySales != null">
                twenty_seveneday_sales = #{record.twentySevenedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentyEightdaySales != null">
                twenty_eightday_sales = #{record.twentyEightdaySales,jdbcType=INTEGER},
            </if>
            <if test="record.twentyNinedaySales != null">
                twenty_nineday_sales = #{record.twentyNinedaySales,jdbcType=INTEGER},
            </if>
            <if test="record.thirtydaySales != null">
                thirtyday_sales = #{record.thirtydaySales,jdbcType=INTEGER},
            </if>
            <if test="record.warehouseName != null">
                warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
            </if>
            <if test="record.forecastTodaySales != null">
                forecast_today_sales = #{record.forecastTodaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastOnedaySales != null">
                forecast_oneday_sales = #{record.forecastOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwodaySales != null">
                forecast_twoday_sales = #{record.forecastTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastThreedaySales != null">
                forecast_threeday_sales = #{record.forecastThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastFourthdaySales != null">
                forecast_fourthday_sales = #{record.forecastFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastFivedaySales != null">
                forecast_fiveday_sales = #{record.forecastFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastSixdaySales != null">
                forecast_sixday_sales = #{record.forecastSixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastSevendaySales != null">
                forecast_sevenday_sales = #{record.forecastSevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastEightdaySales != null">
                forecast_eightday_sales = #{record.forecastEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastNinedaySales != null">
                forecast_nineday_sales = #{record.forecastNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTendaySales != null">
                forecast_tenday_sales = #{record.forecastTendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastElevendaySales != null">
                forecast_elevenday_sales = #{record.forecastElevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwelvedaySales != null">
                forecast_twelveday_sales = #{record.forecastTwelvedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastThridteendaySales != null">
                forecast_thridteenday_sales = #{record.forecastThridteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastFourteendaySales != null">
                forecast_fourteenday_sales = #{record.forecastFourteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastFifteendaySales != null">
                forecast_fifteenday_sales = #{record.forecastFifteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastSixteendaySales != null">
                forecast_sixteenday_sales = #{record.forecastSixteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastSeventeendaySales != null">
                forecast_seventeenday_sales = #{record.forecastSeventeendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastEighteendaySales != null">
                forecast_eighteenday_sales = #{record.forecastEighteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastNineteendaySales != null">
                forecast_nineteenday_sales = #{record.forecastNineteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentydaySales != null">
                forecast_twentyday_sales = #{record.forecastTwentydaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentyOnedaySales != null">
                forecast_twenty_oneday_sales = #{record.forecastTwentyOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentyTwodaySales != null">
                forecast_twenty_twoday_sales = #{record.forecastTwentyTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentyThreedaySales != null">
                forecast_twenty_threeday_sales = #{record.forecastTwentyThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentyFourthdaySales != null">
                forecast_twenty_fourthday_sales = #{record.forecastTwentyFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentyFivedaySales != null">
                forecast_twenty_fiveday_sales = #{record.forecastTwentyFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentySixdaySales != null">
                forecast_twenty_sixday_sales = #{record.forecastTwentySixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentySevenedaySales != null">
                forecast_twenty_seveneday_sales = #{record.forecastTwentySevenedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentyEightdaySales != null">
                forecast_twenty_eightday_sales = #{record.forecastTwentyEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastTwentyNinedaySales != null">
                forecast_twenty_nineday_sales = #{record.forecastTwentyNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.forecastThirtydaySales != null">
                forecast_thirtyday_sales = #{record.forecastThirtydaySales,jdbcType=DECIMAL},
            </if>
            <if test="record.kVariable != null">
                k_variable = #{record.kVariable,jdbcType=DECIMAL},
            </if>
            <if test="record.bVariable != null">
                b_variable = #{record.bVariable,jdbcType=DECIMAL},
            </if>
            <if test="record.rVariable != null">
                r_variable = #{record.rVariable,jdbcType=DECIMAL},
            </if>
            <if test="record.averageSales != null">
                average_sales = #{record.averageSales,jdbcType=DECIMAL},
            </if>
            <if test="record.details != null">
                details = #{record.details,jdbcType=VARCHAR},
            </if>
            <if test="record.fitAVariable != null">
                fit_a_variable = #{record.fitAVariable,jdbcType=DECIMAL},
            </if>
            <if test="record.fitBVariable != null">
                fit_b_variable = #{record.fitBVariable,jdbcType=DECIMAL},
            </if>
            <if test="record.fitRVariable != null">
                fit_r_variable = #{record.fitRVariable,jdbcType=DECIMAL},
            </if>
            <if test="record.fitForecastFormula != null">
                fit_forecast_formula = #{record.fitForecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="record.historySalesDetails != null">
                history_sales_details = #{record.historySalesDetails,jdbcType=VARCHAR},
            </if>
            <if test="record.gmtCreate != null">
                gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
            </if>
            <if test="record.gmtModified != null">
                gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
            </if>
        </set>
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByExample" parameterType="map">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        update dc_auto_sales
        set id = #{record.id,jdbcType=INTEGER},
        forecast_formula = #{record.forecastFormula,jdbcType=VARCHAR},
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
        title = #{record.title,jdbcType=VARCHAR},
        warehouse_code = #{record.warehouseCode,jdbcType=VARCHAR},
        category_id = #{record.categoryId,jdbcType=INTEGER},
        oneday_sales = #{record.onedaySales,jdbcType=INTEGER},
        twoday_sales = #{record.twodaySales,jdbcType=INTEGER},
        threeday_sales = #{record.threedaySales,jdbcType=INTEGER},
        fourthday_sales = #{record.fourthdaySales,jdbcType=INTEGER},
        fiveday_sales = #{record.fivedaySales,jdbcType=INTEGER},
        sixday_sales = #{record.sixdaySales,jdbcType=INTEGER},
        sevenday_sales = #{record.sevendaySales,jdbcType=INTEGER},
        eightday_sales = #{record.eightdaySales,jdbcType=INTEGER},
        nineday_sales = #{record.ninedaySales,jdbcType=INTEGER},
        tenday_sales = #{record.tendaySales,jdbcType=INTEGER},
        elevenday_sales = #{record.elevendaySales,jdbcType=INTEGER},
        twelveday_sales = #{record.twelvedaySales,jdbcType=INTEGER},
        thridteenday_sales = #{record.thridteendaySales,jdbcType=INTEGER},
        fourteenday_sales = #{record.fourteendaySales,jdbcType=INTEGER},
        fifteenday_sales = #{record.fifteendaySales,jdbcType=INTEGER},
        sixteenday_sales = #{record.sixteendaySales,jdbcType=INTEGER},
        seventeenday_sales = #{record.seventeendaySales,jdbcType=INTEGER},
        eighteenday_sales = #{record.eighteendaySales,jdbcType=INTEGER},
        nineteenday_sales = #{record.nineteendaySales,jdbcType=INTEGER},
        twentyday_sales = #{record.twentydaySales,jdbcType=INTEGER},
        twenty_oneday_sales = #{record.twentyOnedaySales,jdbcType=INTEGER},
        twenty_twoday_sales = #{record.twentyTwodaySales,jdbcType=INTEGER},
        twenty_threeday_sales = #{record.twentyThreedaySales,jdbcType=INTEGER},
        twenty_fourthday_sales = #{record.twentyFourthdaySales,jdbcType=INTEGER},
        twenty_fiveday_sales = #{record.twentyFivedaySales,jdbcType=INTEGER},
        twenty_sixday_sales = #{record.twentySixdaySales,jdbcType=INTEGER},
        twenty_seveneday_sales = #{record.twentySevenedaySales,jdbcType=INTEGER},
        twenty_eightday_sales = #{record.twentyEightdaySales,jdbcType=INTEGER},
        twenty_nineday_sales = #{record.twentyNinedaySales,jdbcType=INTEGER},
        thirtyday_sales = #{record.thirtydaySales,jdbcType=INTEGER},
        warehouse_name = #{record.warehouseName,jdbcType=VARCHAR},
        forecast_today_sales = #{record.forecastTodaySales,jdbcType=DECIMAL},
        forecast_oneday_sales = #{record.forecastOnedaySales,jdbcType=DECIMAL},
        forecast_twoday_sales = #{record.forecastTwodaySales,jdbcType=DECIMAL},
        forecast_threeday_sales = #{record.forecastThreedaySales,jdbcType=DECIMAL},
        forecast_fourthday_sales = #{record.forecastFourthdaySales,jdbcType=DECIMAL},
        forecast_fiveday_sales = #{record.forecastFivedaySales,jdbcType=DECIMAL},
        forecast_sixday_sales = #{record.forecastSixdaySales,jdbcType=DECIMAL},
        forecast_sevenday_sales = #{record.forecastSevendaySales,jdbcType=DECIMAL},
        forecast_eightday_sales = #{record.forecastEightdaySales,jdbcType=DECIMAL},
        forecast_nineday_sales = #{record.forecastNinedaySales,jdbcType=DECIMAL},
        forecast_tenday_sales = #{record.forecastTendaySales,jdbcType=DECIMAL},
        forecast_elevenday_sales = #{record.forecastElevendaySales,jdbcType=DECIMAL},
        forecast_twelveday_sales = #{record.forecastTwelvedaySales,jdbcType=DECIMAL},
        forecast_thridteenday_sales = #{record.forecastThridteendaySales,jdbcType=DECIMAL},
        forecast_fourteenday_sales = #{record.forecastFourteendaySales,jdbcType=DECIMAL},
        forecast_fifteenday_sales = #{record.forecastFifteendaySales,jdbcType=DECIMAL},
        forecast_sixteenday_sales = #{record.forecastSixteendaySales,jdbcType=DECIMAL},
        forecast_seventeenday_sales = #{record.forecastSeventeendaySales,jdbcType=DECIMAL},
        forecast_eighteenday_sales = #{record.forecastEighteendaySales,jdbcType=DECIMAL},
        forecast_nineteenday_sales = #{record.forecastNineteendaySales,jdbcType=DECIMAL},
        forecast_twentyday_sales = #{record.forecastTwentydaySales,jdbcType=DECIMAL},
        forecast_twenty_oneday_sales = #{record.forecastTwentyOnedaySales,jdbcType=DECIMAL},
        forecast_twenty_twoday_sales = #{record.forecastTwentyTwodaySales,jdbcType=DECIMAL},
        forecast_twenty_threeday_sales = #{record.forecastTwentyThreedaySales,jdbcType=DECIMAL},
        forecast_twenty_fourthday_sales = #{record.forecastTwentyFourthdaySales,jdbcType=DECIMAL},
        forecast_twenty_fiveday_sales = #{record.forecastTwentyFivedaySales,jdbcType=DECIMAL},
        forecast_twenty_sixday_sales = #{record.forecastTwentySixdaySales,jdbcType=DECIMAL},
        forecast_twenty_seveneday_sales = #{record.forecastTwentySevenedaySales,jdbcType=DECIMAL},
        forecast_twenty_eightday_sales = #{record.forecastTwentyEightdaySales,jdbcType=DECIMAL},
        forecast_twenty_nineday_sales = #{record.forecastTwentyNinedaySales,jdbcType=DECIMAL},
        forecast_thirtyday_sales = #{record.forecastThirtydaySales,jdbcType=DECIMAL},
        k_variable = #{record.kVariable,jdbcType=DECIMAL},
        b_variable = #{record.bVariable,jdbcType=DECIMAL},
        r_variable = #{record.rVariable,jdbcType=DECIMAL},
        average_sales = #{record.averageSales,jdbcType=DECIMAL},
        details = #{record.details,jdbcType=VARCHAR},
        fit_a_variable = #{record.fitAVariable,jdbcType=DECIMAL},
        fit_b_variable = #{record.fitBVariable,jdbcType=DECIMAL},
        fit_r_variable = #{record.fitRVariable,jdbcType=DECIMAL},
        fit_forecast_formula = #{record.fitForecastFormula,jdbcType=VARCHAR},
        history_sales_details = #{record.historySalesDetails,jdbcType=VARCHAR},
        gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
        gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP}
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcAutoSales">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        update dc_auto_sales
        <set>
            <if test="forecastFormula != null">
                forecast_formula = #{forecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="bailunSku != null">
                bailun_sku = #{bailunSku,jdbcType=VARCHAR},
            </if>
            <if test="title != null">
                title = #{title,jdbcType=VARCHAR},
            </if>
            <if test="warehouseCode != null">
                warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
            </if>
            <if test="categoryId != null">
                category_id = #{categoryId,jdbcType=INTEGER},
            </if>
            <if test="onedaySales != null">
                oneday_sales = #{onedaySales,jdbcType=INTEGER},
            </if>
            <if test="twodaySales != null">
                twoday_sales = #{twodaySales,jdbcType=INTEGER},
            </if>
            <if test="threedaySales != null">
                threeday_sales = #{threedaySales,jdbcType=INTEGER},
            </if>
            <if test="fourthdaySales != null">
                fourthday_sales = #{fourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="fivedaySales != null">
                fiveday_sales = #{fivedaySales,jdbcType=INTEGER},
            </if>
            <if test="sixdaySales != null">
                sixday_sales = #{sixdaySales,jdbcType=INTEGER},
            </if>
            <if test="sevendaySales != null">
                sevenday_sales = #{sevendaySales,jdbcType=INTEGER},
            </if>
            <if test="eightdaySales != null">
                eightday_sales = #{eightdaySales,jdbcType=INTEGER},
            </if>
            <if test="ninedaySales != null">
                nineday_sales = #{ninedaySales,jdbcType=INTEGER},
            </if>
            <if test="tendaySales != null">
                tenday_sales = #{tendaySales,jdbcType=INTEGER},
            </if>
            <if test="elevendaySales != null">
                elevenday_sales = #{elevendaySales,jdbcType=INTEGER},
            </if>
            <if test="twelvedaySales != null">
                twelveday_sales = #{twelvedaySales,jdbcType=INTEGER},
            </if>
            <if test="thridteendaySales != null">
                thridteenday_sales = #{thridteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fourteendaySales != null">
                fourteenday_sales = #{fourteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fifteendaySales != null">
                fifteenday_sales = #{fifteendaySales,jdbcType=INTEGER},
            </if>
            <if test="sixteendaySales != null">
                sixteenday_sales = #{sixteendaySales,jdbcType=INTEGER},
            </if>
            <if test="seventeendaySales != null">
                seventeenday_sales = #{seventeendaySales,jdbcType=INTEGER},
            </if>
            <if test="eighteendaySales != null">
                eighteenday_sales = #{eighteendaySales,jdbcType=INTEGER},
            </if>
            <if test="nineteendaySales != null">
                nineteenday_sales = #{nineteendaySales,jdbcType=INTEGER},
            </if>
            <if test="twentydaySales != null">
                twentyday_sales = #{twentydaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyOnedaySales != null">
                twenty_oneday_sales = #{twentyOnedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyTwodaySales != null">
                twenty_twoday_sales = #{twentyTwodaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyThreedaySales != null">
                twenty_threeday_sales = #{twentyThreedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFourthdaySales != null">
                twenty_fourthday_sales = #{twentyFourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFivedaySales != null">
                twenty_fiveday_sales = #{twentyFivedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySixdaySales != null">
                twenty_sixday_sales = #{twentySixdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySevenedaySales != null">
                twenty_seveneday_sales = #{twentySevenedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyEightdaySales != null">
                twenty_eightday_sales = #{twentyEightdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyNinedaySales != null">
                twenty_nineday_sales = #{twentyNinedaySales,jdbcType=INTEGER},
            </if>
            <if test="thirtydaySales != null">
                thirtyday_sales = #{thirtydaySales,jdbcType=INTEGER},
            </if>
            <if test="warehouseName != null">
                warehouse_name = #{warehouseName,jdbcType=VARCHAR},
            </if>
            <if test="forecastTodaySales != null">
                forecast_today_sales = #{forecastTodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastOnedaySales != null">
                forecast_oneday_sales = #{forecastOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwodaySales != null">
                forecast_twoday_sales = #{forecastTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThreedaySales != null">
                forecast_threeday_sales = #{forecastThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourthdaySales != null">
                forecast_fourthday_sales = #{forecastFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFivedaySales != null">
                forecast_fiveday_sales = #{forecastFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixdaySales != null">
                forecast_sixday_sales = #{forecastSixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSevendaySales != null">
                forecast_sevenday_sales = #{forecastSevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEightdaySales != null">
                forecast_eightday_sales = #{forecastEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNinedaySales != null">
                forecast_nineday_sales = #{forecastNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTendaySales != null">
                forecast_tenday_sales = #{forecastTendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastElevendaySales != null">
                forecast_elevenday_sales = #{forecastElevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwelvedaySales != null">
                forecast_twelveday_sales = #{forecastTwelvedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThridteendaySales != null">
                forecast_thridteenday_sales = #{forecastThridteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourteendaySales != null">
                forecast_fourteenday_sales = #{forecastFourteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFifteendaySales != null">
                forecast_fifteenday_sales = #{forecastFifteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixteendaySales != null">
                forecast_sixteenday_sales = #{forecastSixteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSeventeendaySales != null">
                forecast_seventeenday_sales = #{forecastSeventeendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEighteendaySales != null">
                forecast_eighteenday_sales = #{forecastEighteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNineteendaySales != null">
                forecast_nineteenday_sales = #{forecastNineteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentydaySales != null">
                forecast_twentyday_sales = #{forecastTwentydaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyOnedaySales != null">
                forecast_twenty_oneday_sales = #{forecastTwentyOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyTwodaySales != null">
                forecast_twenty_twoday_sales = #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyThreedaySales != null">
                forecast_twenty_threeday_sales = #{forecastTwentyThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFourthdaySales != null">
                forecast_twenty_fourthday_sales = #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFivedaySales != null">
                forecast_twenty_fiveday_sales = #{forecastTwentyFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySixdaySales != null">
                forecast_twenty_sixday_sales = #{forecastTwentySixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySevenedaySales != null">
                forecast_twenty_seveneday_sales = #{forecastTwentySevenedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyEightdaySales != null">
                forecast_twenty_eightday_sales = #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyNinedaySales != null">
                forecast_twenty_nineday_sales = #{forecastTwentyNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThirtydaySales != null">
                forecast_thirtyday_sales = #{forecastThirtydaySales,jdbcType=DECIMAL},
            </if>
            <if test="kVariable != null">
                k_variable = #{kVariable,jdbcType=DECIMAL},
            </if>
            <if test="bVariable != null">
                b_variable = #{bVariable,jdbcType=DECIMAL},
            </if>
            <if test="rVariable != null">
                r_variable = #{rVariable,jdbcType=DECIMAL},
            </if>
            <if test="averageSales != null">
                average_sales = #{averageSales,jdbcType=DECIMAL},
            </if>
            <if test="details != null">
                details = #{details,jdbcType=VARCHAR},
            </if>
            <if test="fitAVariable != null">
                fit_a_variable = #{fitAVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitBVariable != null">
                fit_b_variable = #{fitBVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitRVariable != null">
                fit_r_variable = #{fitRVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitForecastFormula != null">
                fit_forecast_formula = #{fitForecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="historySalesDetails != null">
                history_sales_details = #{historySalesDetails,jdbcType=VARCHAR},
            </if>
            <if test="gmtCreate != null">
                gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
            </if>
            <if test="gmtModified != null">
                gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcAutoSales">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
        -->
        update dc_auto_sales
        set forecast_formula = #{forecastFormula,jdbcType=VARCHAR},
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
        title = #{title,jdbcType=VARCHAR},
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
        category_id = #{categoryId,jdbcType=INTEGER},
        oneday_sales = #{onedaySales,jdbcType=INTEGER},
        twoday_sales = #{twodaySales,jdbcType=INTEGER},
        threeday_sales = #{threedaySales,jdbcType=INTEGER},
        fourthday_sales = #{fourthdaySales,jdbcType=INTEGER},
        fiveday_sales = #{fivedaySales,jdbcType=INTEGER},
        sixday_sales = #{sixdaySales,jdbcType=INTEGER},
        sevenday_sales = #{sevendaySales,jdbcType=INTEGER},
        eightday_sales = #{eightdaySales,jdbcType=INTEGER},
        nineday_sales = #{ninedaySales,jdbcType=INTEGER},
        tenday_sales = #{tendaySales,jdbcType=INTEGER},
        elevenday_sales = #{elevendaySales,jdbcType=INTEGER},
        twelveday_sales = #{twelvedaySales,jdbcType=INTEGER},
        thridteenday_sales = #{thridteendaySales,jdbcType=INTEGER},
        fourteenday_sales = #{fourteendaySales,jdbcType=INTEGER},
        fifteenday_sales = #{fifteendaySales,jdbcType=INTEGER},
        sixteenday_sales = #{sixteendaySales,jdbcType=INTEGER},
        seventeenday_sales = #{seventeendaySales,jdbcType=INTEGER},
        eighteenday_sales = #{eighteendaySales,jdbcType=INTEGER},
        nineteenday_sales = #{nineteendaySales,jdbcType=INTEGER},
        twentyday_sales = #{twentydaySales,jdbcType=INTEGER},
        twenty_oneday_sales = #{twentyOnedaySales,jdbcType=INTEGER},
        twenty_twoday_sales = #{twentyTwodaySales,jdbcType=INTEGER},
        twenty_threeday_sales = #{twentyThreedaySales,jdbcType=INTEGER},
        twenty_fourthday_sales = #{twentyFourthdaySales,jdbcType=INTEGER},
        twenty_fiveday_sales = #{twentyFivedaySales,jdbcType=INTEGER},
        twenty_sixday_sales = #{twentySixdaySales,jdbcType=INTEGER},
        twenty_seveneday_sales = #{twentySevenedaySales,jdbcType=INTEGER},
        twenty_eightday_sales = #{twentyEightdaySales,jdbcType=INTEGER},
        twenty_nineday_sales = #{twentyNinedaySales,jdbcType=INTEGER},
        thirtyday_sales = #{thirtydaySales,jdbcType=INTEGER},
        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
        forecast_today_sales = #{forecastTodaySales,jdbcType=DECIMAL},
        forecast_oneday_sales = #{forecastOnedaySales,jdbcType=DECIMAL},
        forecast_twoday_sales = #{forecastTwodaySales,jdbcType=DECIMAL},
        forecast_threeday_sales = #{forecastThreedaySales,jdbcType=DECIMAL},
        forecast_fourthday_sales = #{forecastFourthdaySales,jdbcType=DECIMAL},
        forecast_fiveday_sales = #{forecastFivedaySales,jdbcType=DECIMAL},
        forecast_sixday_sales = #{forecastSixdaySales,jdbcType=DECIMAL},
        forecast_sevenday_sales = #{forecastSevendaySales,jdbcType=DECIMAL},
        forecast_eightday_sales = #{forecastEightdaySales,jdbcType=DECIMAL},
        forecast_nineday_sales = #{forecastNinedaySales,jdbcType=DECIMAL},
        forecast_tenday_sales = #{forecastTendaySales,jdbcType=DECIMAL},
        forecast_elevenday_sales = #{forecastElevendaySales,jdbcType=DECIMAL},
        forecast_twelveday_sales = #{forecastTwelvedaySales,jdbcType=DECIMAL},
        forecast_thridteenday_sales = #{forecastThridteendaySales,jdbcType=DECIMAL},
        forecast_fourteenday_sales = #{forecastFourteendaySales,jdbcType=DECIMAL},
        forecast_fifteenday_sales = #{forecastFifteendaySales,jdbcType=DECIMAL},
        forecast_sixteenday_sales = #{forecastSixteendaySales,jdbcType=DECIMAL},
        forecast_seventeenday_sales = #{forecastSeventeendaySales,jdbcType=DECIMAL},
        forecast_eighteenday_sales = #{forecastEighteendaySales,jdbcType=DECIMAL},
        forecast_nineteenday_sales = #{forecastNineteendaySales,jdbcType=DECIMAL},
        forecast_twentyday_sales = #{forecastTwentydaySales,jdbcType=DECIMAL},
        forecast_twenty_oneday_sales = #{forecastTwentyOnedaySales,jdbcType=DECIMAL},
        forecast_twenty_twoday_sales = #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
        forecast_twenty_threeday_sales = #{forecastTwentyThreedaySales,jdbcType=DECIMAL},
        forecast_twenty_fourthday_sales = #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
        forecast_twenty_fiveday_sales = #{forecastTwentyFivedaySales,jdbcType=DECIMAL},
        forecast_twenty_sixday_sales = #{forecastTwentySixdaySales,jdbcType=DECIMAL},
        forecast_twenty_seveneday_sales = #{forecastTwentySevenedaySales,jdbcType=DECIMAL},
        forecast_twenty_eightday_sales = #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
        forecast_twenty_nineday_sales = #{forecastTwentyNinedaySales,jdbcType=DECIMAL},
        forecast_thirtyday_sales = #{forecastThirtydaySales,jdbcType=DECIMAL},
        k_variable = #{kVariable,jdbcType=DECIMAL},
        b_variable = #{bVariable,jdbcType=DECIMAL},
        r_variable = #{rVariable,jdbcType=DECIMAL},
        average_sales = #{averageSales,jdbcType=DECIMAL},
        details = #{details,jdbcType=VARCHAR},
        fit_a_variable = #{fitAVariable,jdbcType=DECIMAL},
        fit_b_variable = #{fitBVariable,jdbcType=DECIMAL},
        fit_r_variable = #{fitRVariable,jdbcType=DECIMAL},
        fit_forecast_formula = #{fitForecastFormula,jdbcType=VARCHAR},
        history_sales_details = #{historySalesDetails,jdbcType=VARCHAR},
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
        where id = #{id,jdbcType=INTEGER}
    </update>
    <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcAutoSales">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
          @project https://github.com/itfsw/mybatis-generator-plugin
        -->
        insert into dc_auto_sales
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="forecastFormula != null">
                forecast_formula,
            </if>
            <if test="bailunSku != null">
                bailun_sku,
            </if>
            <if test="title != null">
                title,
            </if>
            <if test="warehouseCode != null">
                warehouse_code,
            </if>
            <if test="categoryId != null">
                category_id,
            </if>
            <if test="onedaySales != null">
                oneday_sales,
            </if>
            <if test="twodaySales != null">
                twoday_sales,
            </if>
            <if test="threedaySales != null">
                threeday_sales,
            </if>
            <if test="fourthdaySales != null">
                fourthday_sales,
            </if>
            <if test="fivedaySales != null">
                fiveday_sales,
            </if>
            <if test="sixdaySales != null">
                sixday_sales,
            </if>
            <if test="sevendaySales != null">
                sevenday_sales,
            </if>
            <if test="eightdaySales != null">
                eightday_sales,
            </if>
            <if test="ninedaySales != null">
                nineday_sales,
            </if>
            <if test="tendaySales != null">
                tenday_sales,
            </if>
            <if test="elevendaySales != null">
                elevenday_sales,
            </if>
            <if test="twelvedaySales != null">
                twelveday_sales,
            </if>
            <if test="thridteendaySales != null">
                thridteenday_sales,
            </if>
            <if test="fourteendaySales != null">
                fourteenday_sales,
            </if>
            <if test="fifteendaySales != null">
                fifteenday_sales,
            </if>
            <if test="sixteendaySales != null">
                sixteenday_sales,
            </if>
            <if test="seventeendaySales != null">
                seventeenday_sales,
            </if>
            <if test="eighteendaySales != null">
                eighteenday_sales,
            </if>
            <if test="nineteendaySales != null">
                nineteenday_sales,
            </if>
            <if test="twentydaySales != null">
                twentyday_sales,
            </if>
            <if test="twentyOnedaySales != null">
                twenty_oneday_sales,
            </if>
            <if test="twentyTwodaySales != null">
                twenty_twoday_sales,
            </if>
            <if test="twentyThreedaySales != null">
                twenty_threeday_sales,
            </if>
            <if test="twentyFourthdaySales != null">
                twenty_fourthday_sales,
            </if>
            <if test="twentyFivedaySales != null">
                twenty_fiveday_sales,
            </if>
            <if test="twentySixdaySales != null">
                twenty_sixday_sales,
            </if>
            <if test="twentySevenedaySales != null">
                twenty_seveneday_sales,
            </if>
            <if test="twentyEightdaySales != null">
                twenty_eightday_sales,
            </if>
            <if test="twentyNinedaySales != null">
                twenty_nineday_sales,
            </if>
            <if test="thirtydaySales != null">
                thirtyday_sales,
            </if>
            <if test="warehouseName != null">
                warehouse_name,
            </if>
            <if test="forecastTodaySales != null">
                forecast_today_sales,
            </if>
            <if test="forecastOnedaySales != null">
                forecast_oneday_sales,
            </if>
            <if test="forecastTwodaySales != null">
                forecast_twoday_sales,
            </if>
            <if test="forecastThreedaySales != null">
                forecast_threeday_sales,
            </if>
            <if test="forecastFourthdaySales != null">
                forecast_fourthday_sales,
            </if>
            <if test="forecastFivedaySales != null">
                forecast_fiveday_sales,
            </if>
            <if test="forecastSixdaySales != null">
                forecast_sixday_sales,
            </if>
            <if test="forecastSevendaySales != null">
                forecast_sevenday_sales,
            </if>
            <if test="forecastEightdaySales != null">
                forecast_eightday_sales,
            </if>
            <if test="forecastNinedaySales != null">
                forecast_nineday_sales,
            </if>
            <if test="forecastTendaySales != null">
                forecast_tenday_sales,
            </if>
            <if test="forecastElevendaySales != null">
                forecast_elevenday_sales,
            </if>
            <if test="forecastTwelvedaySales != null">
                forecast_twelveday_sales,
            </if>
            <if test="forecastThridteendaySales != null">
                forecast_thridteenday_sales,
            </if>
            <if test="forecastFourteendaySales != null">
                forecast_fourteenday_sales,
            </if>
            <if test="forecastFifteendaySales != null">
                forecast_fifteenday_sales,
            </if>
            <if test="forecastSixteendaySales != null">
                forecast_sixteenday_sales,
            </if>
            <if test="forecastSeventeendaySales != null">
                forecast_seventeenday_sales,
            </if>
            <if test="forecastEighteendaySales != null">
                forecast_eighteenday_sales,
            </if>
            <if test="forecastNineteendaySales != null">
                forecast_nineteenday_sales,
            </if>
            <if test="forecastTwentydaySales != null">
                forecast_twentyday_sales,
            </if>
            <if test="forecastTwentyOnedaySales != null">
                forecast_twenty_oneday_sales,
            </if>
            <if test="forecastTwentyTwodaySales != null">
                forecast_twenty_twoday_sales,
            </if>
            <if test="forecastTwentyThreedaySales != null">
                forecast_twenty_threeday_sales,
            </if>
            <if test="forecastTwentyFourthdaySales != null">
                forecast_twenty_fourthday_sales,
            </if>
            <if test="forecastTwentyFivedaySales != null">
                forecast_twenty_fiveday_sales,
            </if>
            <if test="forecastTwentySixdaySales != null">
                forecast_twenty_sixday_sales,
            </if>
            <if test="forecastTwentySevenedaySales != null">
                forecast_twenty_seveneday_sales,
            </if>
            <if test="forecastTwentyEightdaySales != null">
                forecast_twenty_eightday_sales,
            </if>
            <if test="forecastTwentyNinedaySales != null">
                forecast_twenty_nineday_sales,
            </if>
            <if test="forecastThirtydaySales != null">
                forecast_thirtyday_sales,
            </if>
            <if test="kVariable != null">
                k_variable,
            </if>
            <if test="bVariable != null">
                b_variable,
            </if>
            <if test="rVariable != null">
                r_variable,
            </if>
            <if test="averageSales != null">
                average_sales,
            </if>
            <if test="details != null">
                details,
            </if>
            <if test="fitAVariable != null">
                fit_a_variable,
            </if>
            <if test="fitBVariable != null">
                fit_b_variable,
            </if>
            <if test="fitRVariable != null">
                fit_r_variable,
            </if>
            <if test="fitForecastFormula != null">
                fit_forecast_formula,
            </if>
            <if test="historySalesDetails != null">
                history_sales_details,
            </if>
            <if test="gmtCreate != null">
                gmt_create,
            </if>
            <if test="gmtModified != null">
                gmt_modified,
            </if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="forecastFormula != null">
                #{forecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="bailunSku != null">
                #{bailunSku,jdbcType=VARCHAR},
            </if>
            <if test="title != null">
                #{title,jdbcType=VARCHAR},
            </if>
            <if test="warehouseCode != null">
                #{warehouseCode,jdbcType=VARCHAR},
            </if>
            <if test="categoryId != null">
                #{categoryId,jdbcType=INTEGER},
            </if>
            <if test="onedaySales != null">
                #{onedaySales,jdbcType=INTEGER},
            </if>
            <if test="twodaySales != null">
                #{twodaySales,jdbcType=INTEGER},
            </if>
            <if test="threedaySales != null">
                #{threedaySales,jdbcType=INTEGER},
            </if>
            <if test="fourthdaySales != null">
                #{fourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="fivedaySales != null">
                #{fivedaySales,jdbcType=INTEGER},
            </if>
            <if test="sixdaySales != null">
                #{sixdaySales,jdbcType=INTEGER},
            </if>
            <if test="sevendaySales != null">
                #{sevendaySales,jdbcType=INTEGER},
            </if>
            <if test="eightdaySales != null">
                #{eightdaySales,jdbcType=INTEGER},
            </if>
            <if test="ninedaySales != null">
                #{ninedaySales,jdbcType=INTEGER},
            </if>
            <if test="tendaySales != null">
                #{tendaySales,jdbcType=INTEGER},
            </if>
            <if test="elevendaySales != null">
                #{elevendaySales,jdbcType=INTEGER},
            </if>
            <if test="twelvedaySales != null">
                #{twelvedaySales,jdbcType=INTEGER},
            </if>
            <if test="thridteendaySales != null">
                #{thridteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fourteendaySales != null">
                #{fourteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fifteendaySales != null">
                #{fifteendaySales,jdbcType=INTEGER},
            </if>
            <if test="sixteendaySales != null">
                #{sixteendaySales,jdbcType=INTEGER},
            </if>
            <if test="seventeendaySales != null">
                #{seventeendaySales,jdbcType=INTEGER},
            </if>
            <if test="eighteendaySales != null">
                #{eighteendaySales,jdbcType=INTEGER},
            </if>
            <if test="nineteendaySales != null">
                #{nineteendaySales,jdbcType=INTEGER},
            </if>
            <if test="twentydaySales != null">
                #{twentydaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyOnedaySales != null">
                #{twentyOnedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyTwodaySales != null">
                #{twentyTwodaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyThreedaySales != null">
                #{twentyThreedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFourthdaySales != null">
                #{twentyFourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFivedaySales != null">
                #{twentyFivedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySixdaySales != null">
                #{twentySixdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySevenedaySales != null">
                #{twentySevenedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyEightdaySales != null">
                #{twentyEightdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyNinedaySales != null">
                #{twentyNinedaySales,jdbcType=INTEGER},
            </if>
            <if test="thirtydaySales != null">
                #{thirtydaySales,jdbcType=INTEGER},
            </if>
            <if test="warehouseName != null">
                #{warehouseName,jdbcType=VARCHAR},
            </if>
            <if test="forecastTodaySales != null">
                #{forecastTodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastOnedaySales != null">
                #{forecastOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwodaySales != null">
                #{forecastTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThreedaySales != null">
                #{forecastThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourthdaySales != null">
                #{forecastFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFivedaySales != null">
                #{forecastFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixdaySales != null">
                #{forecastSixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSevendaySales != null">
                #{forecastSevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEightdaySales != null">
                #{forecastEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNinedaySales != null">
                #{forecastNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTendaySales != null">
                #{forecastTendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastElevendaySales != null">
                #{forecastElevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwelvedaySales != null">
                #{forecastTwelvedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThridteendaySales != null">
                #{forecastThridteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourteendaySales != null">
                #{forecastFourteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFifteendaySales != null">
                #{forecastFifteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixteendaySales != null">
                #{forecastSixteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSeventeendaySales != null">
                #{forecastSeventeendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEighteendaySales != null">
                #{forecastEighteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNineteendaySales != null">
                #{forecastNineteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentydaySales != null">
                #{forecastTwentydaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyOnedaySales != null">
                #{forecastTwentyOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyTwodaySales != null">
                #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyThreedaySales != null">
                #{forecastTwentyThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFourthdaySales != null">
                #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFivedaySales != null">
                #{forecastTwentyFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySixdaySales != null">
                #{forecastTwentySixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySevenedaySales != null">
                #{forecastTwentySevenedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyEightdaySales != null">
                #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyNinedaySales != null">
                #{forecastTwentyNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThirtydaySales != null">
                #{forecastThirtydaySales,jdbcType=DECIMAL},
            </if>
            <if test="kVariable != null">
                #{kVariable,jdbcType=DECIMAL},
            </if>
            <if test="bVariable != null">
                #{bVariable,jdbcType=DECIMAL},
            </if>
            <if test="rVariable != null">
                #{rVariable,jdbcType=DECIMAL},
            </if>
            <if test="averageSales != null">
                #{averageSales,jdbcType=DECIMAL},
            </if>
            <if test="details != null">
                #{details,jdbcType=VARCHAR},
            </if>
            <if test="fitAVariable != null">
                #{fitAVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitBVariable != null">
                #{fitBVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitRVariable != null">
                #{fitRVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitForecastFormula != null">
                #{fitForecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="historySalesDetails != null">
                #{historySalesDetails,jdbcType=VARCHAR},
            </if>
            <if test="gmtCreate != null">
                #{gmtCreate,jdbcType=TIMESTAMP},
            </if>
            <if test="gmtModified != null">
                #{gmtModified,jdbcType=TIMESTAMP},
            </if>
        </trim>
        on duplicate key update
        <trim suffixOverrides=",">
            <if test="id != null">
                id = #{id,jdbcType=INTEGER},
            </if>
            <if test="forecastFormula != null">
                forecast_formula = #{forecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="bailunSku != null">
                bailun_sku = #{bailunSku,jdbcType=VARCHAR},
            </if>
            <if test="title != null">
                title = #{title,jdbcType=VARCHAR},
            </if>
            <if test="warehouseCode != null">
                warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
            </if>
            <if test="categoryId != null">
                category_id = #{categoryId,jdbcType=INTEGER},
            </if>
            <if test="onedaySales != null">
                oneday_sales = #{onedaySales,jdbcType=INTEGER},
            </if>
            <if test="twodaySales != null">
                twoday_sales = #{twodaySales,jdbcType=INTEGER},
            </if>
            <if test="threedaySales != null">
                threeday_sales = #{threedaySales,jdbcType=INTEGER},
            </if>
            <if test="fourthdaySales != null">
                fourthday_sales = #{fourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="fivedaySales != null">
                fiveday_sales = #{fivedaySales,jdbcType=INTEGER},
            </if>
            <if test="sixdaySales != null">
                sixday_sales = #{sixdaySales,jdbcType=INTEGER},
            </if>
            <if test="sevendaySales != null">
                sevenday_sales = #{sevendaySales,jdbcType=INTEGER},
            </if>
            <if test="eightdaySales != null">
                eightday_sales = #{eightdaySales,jdbcType=INTEGER},
            </if>
            <if test="ninedaySales != null">
                nineday_sales = #{ninedaySales,jdbcType=INTEGER},
            </if>
            <if test="tendaySales != null">
                tenday_sales = #{tendaySales,jdbcType=INTEGER},
            </if>
            <if test="elevendaySales != null">
                elevenday_sales = #{elevendaySales,jdbcType=INTEGER},
            </if>
            <if test="twelvedaySales != null">
                twelveday_sales = #{twelvedaySales,jdbcType=INTEGER},
            </if>
            <if test="thridteendaySales != null">
                thridteenday_sales = #{thridteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fourteendaySales != null">
                fourteenday_sales = #{fourteendaySales,jdbcType=INTEGER},
            </if>
            <if test="fifteendaySales != null">
                fifteenday_sales = #{fifteendaySales,jdbcType=INTEGER},
            </if>
            <if test="sixteendaySales != null">
                sixteenday_sales = #{sixteendaySales,jdbcType=INTEGER},
            </if>
            <if test="seventeendaySales != null">
                seventeenday_sales = #{seventeendaySales,jdbcType=INTEGER},
            </if>
            <if test="eighteendaySales != null">
                eighteenday_sales = #{eighteendaySales,jdbcType=INTEGER},
            </if>
            <if test="nineteendaySales != null">
                nineteenday_sales = #{nineteendaySales,jdbcType=INTEGER},
            </if>
            <if test="twentydaySales != null">
                twentyday_sales = #{twentydaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyOnedaySales != null">
                twenty_oneday_sales = #{twentyOnedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyTwodaySales != null">
                twenty_twoday_sales = #{twentyTwodaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyThreedaySales != null">
                twenty_threeday_sales = #{twentyThreedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFourthdaySales != null">
                twenty_fourthday_sales = #{twentyFourthdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyFivedaySales != null">
                twenty_fiveday_sales = #{twentyFivedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySixdaySales != null">
                twenty_sixday_sales = #{twentySixdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentySevenedaySales != null">
                twenty_seveneday_sales = #{twentySevenedaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyEightdaySales != null">
                twenty_eightday_sales = #{twentyEightdaySales,jdbcType=INTEGER},
            </if>
            <if test="twentyNinedaySales != null">
                twenty_nineday_sales = #{twentyNinedaySales,jdbcType=INTEGER},
            </if>
            <if test="thirtydaySales != null">
                thirtyday_sales = #{thirtydaySales,jdbcType=INTEGER},
            </if>
            <if test="warehouseName != null">
                warehouse_name = #{warehouseName,jdbcType=VARCHAR},
            </if>
            <if test="forecastTodaySales != null">
                forecast_today_sales = #{forecastTodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastOnedaySales != null">
                forecast_oneday_sales = #{forecastOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwodaySales != null">
                forecast_twoday_sales = #{forecastTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThreedaySales != null">
                forecast_threeday_sales = #{forecastThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourthdaySales != null">
                forecast_fourthday_sales = #{forecastFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFivedaySales != null">
                forecast_fiveday_sales = #{forecastFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixdaySales != null">
                forecast_sixday_sales = #{forecastSixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSevendaySales != null">
                forecast_sevenday_sales = #{forecastSevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEightdaySales != null">
                forecast_eightday_sales = #{forecastEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNinedaySales != null">
                forecast_nineday_sales = #{forecastNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTendaySales != null">
                forecast_tenday_sales = #{forecastTendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastElevendaySales != null">
                forecast_elevenday_sales = #{forecastElevendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwelvedaySales != null">
                forecast_twelveday_sales = #{forecastTwelvedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThridteendaySales != null">
                forecast_thridteenday_sales = #{forecastThridteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFourteendaySales != null">
                forecast_fourteenday_sales = #{forecastFourteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastFifteendaySales != null">
                forecast_fifteenday_sales = #{forecastFifteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSixteendaySales != null">
                forecast_sixteenday_sales = #{forecastSixteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastSeventeendaySales != null">
                forecast_seventeenday_sales = #{forecastSeventeendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastEighteendaySales != null">
                forecast_eighteenday_sales = #{forecastEighteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastNineteendaySales != null">
                forecast_nineteenday_sales = #{forecastNineteendaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentydaySales != null">
                forecast_twentyday_sales = #{forecastTwentydaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyOnedaySales != null">
                forecast_twenty_oneday_sales = #{forecastTwentyOnedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyTwodaySales != null">
                forecast_twenty_twoday_sales = #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyThreedaySales != null">
                forecast_twenty_threeday_sales = #{forecastTwentyThreedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFourthdaySales != null">
                forecast_twenty_fourthday_sales = #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyFivedaySales != null">
                forecast_twenty_fiveday_sales = #{forecastTwentyFivedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySixdaySales != null">
                forecast_twenty_sixday_sales = #{forecastTwentySixdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentySevenedaySales != null">
                forecast_twenty_seveneday_sales = #{forecastTwentySevenedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyEightdaySales != null">
                forecast_twenty_eightday_sales = #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastTwentyNinedaySales != null">
                forecast_twenty_nineday_sales = #{forecastTwentyNinedaySales,jdbcType=DECIMAL},
            </if>
            <if test="forecastThirtydaySales != null">
                forecast_thirtyday_sales = #{forecastThirtydaySales,jdbcType=DECIMAL},
            </if>
            <if test="kVariable != null">
                k_variable = #{kVariable,jdbcType=DECIMAL},
            </if>
            <if test="bVariable != null">
                b_variable = #{bVariable,jdbcType=DECIMAL},
            </if>
            <if test="rVariable != null">
                r_variable = #{rVariable,jdbcType=DECIMAL},
            </if>
            <if test="averageSales != null">
                average_sales = #{averageSales,jdbcType=DECIMAL},
            </if>
            <if test="details != null">
                details = #{details,jdbcType=VARCHAR},
            </if>
            <if test="fitAVariable != null">
                fit_a_variable = #{fitAVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitBVariable != null">
                fit_b_variable = #{fitBVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitRVariable != null">
                fit_r_variable = #{fitRVariable,jdbcType=DECIMAL},
            </if>
            <if test="fitForecastFormula != null">
                fit_forecast_formula = #{fitForecastFormula,jdbcType=VARCHAR},
            </if>
            <if test="historySalesDetails != null">
                history_sales_details = #{historySalesDetails,jdbcType=VARCHAR},
            </if>
            <if test="gmtCreate != null">
                gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
            </if>
            <if test="gmtModified != null">
                gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>
    <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcAutoSales">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
          @project https://github.com/itfsw/mybatis-generator-plugin
        -->
        insert into dc_auto_sales
        (id, forecast_formula, bailun_sku, title, warehouse_code, category_id, oneday_sales,
        twoday_sales, threeday_sales, fourthday_sales, fiveday_sales, sixday_sales, sevenday_sales,
        eightday_sales, nineday_sales, tenday_sales, elevenday_sales, twelveday_sales,
        thridteenday_sales, fourteenday_sales, fifteenday_sales, sixteenday_sales, seventeenday_sales,
        eighteenday_sales, nineteenday_sales, twentyday_sales, twenty_oneday_sales, twenty_twoday_sales,
        twenty_threeday_sales, twenty_fourthday_sales, twenty_fiveday_sales, twenty_sixday_sales,
        twenty_seveneday_sales, twenty_eightday_sales, twenty_nineday_sales, thirtyday_sales,
        warehouse_name, forecast_today_sales, forecast_oneday_sales, forecast_twoday_sales,
        forecast_threeday_sales, forecast_fourthday_sales, forecast_fiveday_sales, forecast_sixday_sales,
        forecast_sevenday_sales, forecast_eightday_sales, forecast_nineday_sales, forecast_tenday_sales,
        forecast_elevenday_sales, forecast_twelveday_sales, forecast_thridteenday_sales,
        forecast_fourteenday_sales, forecast_fifteenday_sales, forecast_sixteenday_sales,
        forecast_seventeenday_sales, forecast_eighteenday_sales, forecast_nineteenday_sales,
        forecast_twentyday_sales, forecast_twenty_oneday_sales, forecast_twenty_twoday_sales,
        forecast_twenty_threeday_sales, forecast_twenty_fourthday_sales, forecast_twenty_fiveday_sales,
        forecast_twenty_sixday_sales, forecast_twenty_seveneday_sales, forecast_twenty_eightday_sales,
        forecast_twenty_nineday_sales, forecast_thirtyday_sales, k_variable, b_variable,
        r_variable, average_sales, details, fit_a_variable, fit_b_variable, fit_r_variable,
        fit_forecast_formula, history_sales_details, gmt_create, gmt_modified)
        values
        (#{id,jdbcType=INTEGER}, #{forecastFormula,jdbcType=VARCHAR}, #{bailunSku,jdbcType=VARCHAR},
        #{title,jdbcType=VARCHAR}, #{warehouseCode,jdbcType=VARCHAR}, #{categoryId,jdbcType=INTEGER},
        #{onedaySales,jdbcType=INTEGER}, #{twodaySales,jdbcType=INTEGER}, #{threedaySales,jdbcType=INTEGER},
        #{fourthdaySales,jdbcType=INTEGER}, #{fivedaySales,jdbcType=INTEGER}, #{sixdaySales,jdbcType=INTEGER},
        #{sevendaySales,jdbcType=INTEGER}, #{eightdaySales,jdbcType=INTEGER}, #{ninedaySales,jdbcType=INTEGER},
        #{tendaySales,jdbcType=INTEGER}, #{elevendaySales,jdbcType=INTEGER}, #{twelvedaySales,jdbcType=INTEGER},
        #{thridteendaySales,jdbcType=INTEGER}, #{fourteendaySales,jdbcType=INTEGER},
        #{fifteendaySales,jdbcType=INTEGER},
        #{sixteendaySales,jdbcType=INTEGER}, #{seventeendaySales,jdbcType=INTEGER},
        #{eighteendaySales,jdbcType=INTEGER},
        #{nineteendaySales,jdbcType=INTEGER}, #{twentydaySales,jdbcType=INTEGER}, #{twentyOnedaySales,jdbcType=INTEGER},
        #{twentyTwodaySales,jdbcType=INTEGER}, #{twentyThreedaySales,jdbcType=INTEGER},
        #{twentyFourthdaySales,jdbcType=INTEGER}, #{twentyFivedaySales,jdbcType=INTEGER},
        #{twentySixdaySales,jdbcType=INTEGER}, #{twentySevenedaySales,jdbcType=INTEGER},
        #{twentyEightdaySales,jdbcType=INTEGER}, #{twentyNinedaySales,jdbcType=INTEGER},
        #{thirtydaySales,jdbcType=INTEGER}, #{warehouseName,jdbcType=VARCHAR}, #{forecastTodaySales,jdbcType=DECIMAL},
        #{forecastOnedaySales,jdbcType=DECIMAL}, #{forecastTwodaySales,jdbcType=DECIMAL},
        #{forecastThreedaySales,jdbcType=DECIMAL}, #{forecastFourthdaySales,jdbcType=DECIMAL},
        #{forecastFivedaySales,jdbcType=DECIMAL}, #{forecastSixdaySales,jdbcType=DECIMAL},
        #{forecastSevendaySales,jdbcType=DECIMAL}, #{forecastEightdaySales,jdbcType=DECIMAL},
        #{forecastNinedaySales,jdbcType=DECIMAL}, #{forecastTendaySales,jdbcType=DECIMAL},
        #{forecastElevendaySales,jdbcType=DECIMAL}, #{forecastTwelvedaySales,jdbcType=DECIMAL},
        #{forecastThridteendaySales,jdbcType=DECIMAL}, #{forecastFourteendaySales,jdbcType=DECIMAL},
        #{forecastFifteendaySales,jdbcType=DECIMAL}, #{forecastSixteendaySales,jdbcType=DECIMAL},
        #{forecastSeventeendaySales,jdbcType=DECIMAL}, #{forecastEighteendaySales,jdbcType=DECIMAL},
        #{forecastNineteendaySales,jdbcType=DECIMAL}, #{forecastTwentydaySales,jdbcType=DECIMAL},
        #{forecastTwentyOnedaySales,jdbcType=DECIMAL}, #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
        #{forecastTwentyThreedaySales,jdbcType=DECIMAL}, #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
        #{forecastTwentyFivedaySales,jdbcType=DECIMAL}, #{forecastTwentySixdaySales,jdbcType=DECIMAL},
        #{forecastTwentySevenedaySales,jdbcType=DECIMAL}, #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
        #{forecastTwentyNinedaySales,jdbcType=DECIMAL}, #{forecastThirtydaySales,jdbcType=DECIMAL},
        #{kVariable,jdbcType=DECIMAL}, #{bVariable,jdbcType=DECIMAL}, #{rVariable,jdbcType=DECIMAL},
        #{averageSales,jdbcType=DECIMAL}, #{details,jdbcType=VARCHAR}, #{fitAVariable,jdbcType=DECIMAL},
        #{fitBVariable,jdbcType=DECIMAL}, #{fitRVariable,jdbcType=DECIMAL}, #{fitForecastFormula,jdbcType=VARCHAR},
        #{historySalesDetails,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}
        )
        on duplicate key update
        id = #{id,jdbcType=INTEGER},
        forecast_formula = #{forecastFormula,jdbcType=VARCHAR},
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
        title = #{title,jdbcType=VARCHAR},
        warehouse_code = #{warehouseCode,jdbcType=VARCHAR},
        category_id = #{categoryId,jdbcType=INTEGER},
        oneday_sales = #{onedaySales,jdbcType=INTEGER},
        twoday_sales = #{twodaySales,jdbcType=INTEGER},
        threeday_sales = #{threedaySales,jdbcType=INTEGER},
        fourthday_sales = #{fourthdaySales,jdbcType=INTEGER},
        fiveday_sales = #{fivedaySales,jdbcType=INTEGER},
        sixday_sales = #{sixdaySales,jdbcType=INTEGER},
        sevenday_sales = #{sevendaySales,jdbcType=INTEGER},
        eightday_sales = #{eightdaySales,jdbcType=INTEGER},
        nineday_sales = #{ninedaySales,jdbcType=INTEGER},
        tenday_sales = #{tendaySales,jdbcType=INTEGER},
        elevenday_sales = #{elevendaySales,jdbcType=INTEGER},
        twelveday_sales = #{twelvedaySales,jdbcType=INTEGER},
        thridteenday_sales = #{thridteendaySales,jdbcType=INTEGER},
        fourteenday_sales = #{fourteendaySales,jdbcType=INTEGER},
        fifteenday_sales = #{fifteendaySales,jdbcType=INTEGER},
        sixteenday_sales = #{sixteendaySales,jdbcType=INTEGER},
        seventeenday_sales = #{seventeendaySales,jdbcType=INTEGER},
        eighteenday_sales = #{eighteendaySales,jdbcType=INTEGER},
        nineteenday_sales = #{nineteendaySales,jdbcType=INTEGER},
        twentyday_sales = #{twentydaySales,jdbcType=INTEGER},
        twenty_oneday_sales = #{twentyOnedaySales,jdbcType=INTEGER},
        twenty_twoday_sales = #{twentyTwodaySales,jdbcType=INTEGER},
        twenty_threeday_sales = #{twentyThreedaySales,jdbcType=INTEGER},
        twenty_fourthday_sales = #{twentyFourthdaySales,jdbcType=INTEGER},
        twenty_fiveday_sales = #{twentyFivedaySales,jdbcType=INTEGER},
        twenty_sixday_sales = #{twentySixdaySales,jdbcType=INTEGER},
        twenty_seveneday_sales = #{twentySevenedaySales,jdbcType=INTEGER},
        twenty_eightday_sales = #{twentyEightdaySales,jdbcType=INTEGER},
        twenty_nineday_sales = #{twentyNinedaySales,jdbcType=INTEGER},
        thirtyday_sales = #{thirtydaySales,jdbcType=INTEGER},
        warehouse_name = #{warehouseName,jdbcType=VARCHAR},
        forecast_today_sales = #{forecastTodaySales,jdbcType=DECIMAL},
        forecast_oneday_sales = #{forecastOnedaySales,jdbcType=DECIMAL},
        forecast_twoday_sales = #{forecastTwodaySales,jdbcType=DECIMAL},
        forecast_threeday_sales = #{forecastThreedaySales,jdbcType=DECIMAL},
        forecast_fourthday_sales = #{forecastFourthdaySales,jdbcType=DECIMAL},
        forecast_fiveday_sales = #{forecastFivedaySales,jdbcType=DECIMAL},
        forecast_sixday_sales = #{forecastSixdaySales,jdbcType=DECIMAL},
        forecast_sevenday_sales = #{forecastSevendaySales,jdbcType=DECIMAL},
        forecast_eightday_sales = #{forecastEightdaySales,jdbcType=DECIMAL},
        forecast_nineday_sales = #{forecastNinedaySales,jdbcType=DECIMAL},
        forecast_tenday_sales = #{forecastTendaySales,jdbcType=DECIMAL},
        forecast_elevenday_sales = #{forecastElevendaySales,jdbcType=DECIMAL},
        forecast_twelveday_sales = #{forecastTwelvedaySales,jdbcType=DECIMAL},
        forecast_thridteenday_sales = #{forecastThridteendaySales,jdbcType=DECIMAL},
        forecast_fourteenday_sales = #{forecastFourteendaySales,jdbcType=DECIMAL},
        forecast_fifteenday_sales = #{forecastFifteendaySales,jdbcType=DECIMAL},
        forecast_sixteenday_sales = #{forecastSixteendaySales,jdbcType=DECIMAL},
        forecast_seventeenday_sales = #{forecastSeventeendaySales,jdbcType=DECIMAL},
        forecast_eighteenday_sales = #{forecastEighteendaySales,jdbcType=DECIMAL},
        forecast_nineteenday_sales = #{forecastNineteendaySales,jdbcType=DECIMAL},
        forecast_twentyday_sales = #{forecastTwentydaySales,jdbcType=DECIMAL},
        forecast_twenty_oneday_sales = #{forecastTwentyOnedaySales,jdbcType=DECIMAL},
        forecast_twenty_twoday_sales = #{forecastTwentyTwodaySales,jdbcType=DECIMAL},
        forecast_twenty_threeday_sales = #{forecastTwentyThreedaySales,jdbcType=DECIMAL},
        forecast_twenty_fourthday_sales = #{forecastTwentyFourthdaySales,jdbcType=DECIMAL},
        forecast_twenty_fiveday_sales = #{forecastTwentyFivedaySales,jdbcType=DECIMAL},
        forecast_twenty_sixday_sales = #{forecastTwentySixdaySales,jdbcType=DECIMAL},
        forecast_twenty_seveneday_sales = #{forecastTwentySevenedaySales,jdbcType=DECIMAL},
        forecast_twenty_eightday_sales = #{forecastTwentyEightdaySales,jdbcType=DECIMAL},
        forecast_twenty_nineday_sales = #{forecastTwentyNinedaySales,jdbcType=DECIMAL},
        forecast_thirtyday_sales = #{forecastThirtydaySales,jdbcType=DECIMAL},
        k_variable = #{kVariable,jdbcType=DECIMAL},
        b_variable = #{bVariable,jdbcType=DECIMAL},
        r_variable = #{rVariable,jdbcType=DECIMAL},
        average_sales = #{averageSales,jdbcType=DECIMAL},
        details = #{details,jdbcType=VARCHAR},
        fit_a_variable = #{fitAVariable,jdbcType=DECIMAL},
        fit_b_variable = #{fitBVariable,jdbcType=DECIMAL},
        fit_r_variable = #{fitRVariable,jdbcType=DECIMAL},
        fit_forecast_formula = #{fitForecastFormula,jdbcType=VARCHAR},
        history_sales_details = #{historySalesDetails,jdbcType=VARCHAR},
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
    </insert>
    <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcAutoSalesExample"
            resultMap="BaseResultMap">
        <!--
          WARNING - @mbg.generated
          This element is automatically generated by MyBatis Generator, do not modify.
          @project https://github.com/itfsw/mybatis-generator-plugin
        -->
        select
        <include refid="Base_Column_List"/>
        from dc_auto_sales
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
        <if test="orderByClause != null">
            order by ${orderByClause}
        </if>
        limit 1
    </select>

    <select id="getSalesAvg" resultType="java.math.BigDecimal">
        SELECT (sum(case
                        when paid_time &lt; #{queryTime} and paid_time &gt;= DATE_SUB(#{queryTime}, INTERVAL 7 DAY)
                            then bailun_sku_quantity_ordered
                        else 0 end) / 7 +
                sum(case
                        when paid_time &lt; #{queryTime} and paid_time &gt;= DATE_SUB(#{queryTime}, INTERVAL 14 DAY)
                            then bailun_sku_quantity_ordered
                        else 0 end) / 14) / 2
        FROM dc_base_oms_sku_30
        where paid_time &gt;= DATE_SUB(#{queryTime}, INTERVAL 14 DAY)
          and paid_time &lt; #{queryTime}
          and bailun_order_status != 'Canceled'
          and has_fba_s = 0
          and has_delete = 0
          and has_scalp = 0
          and has_buyer_remark = 0
          and has_platsku_remark = 0
          and has_innersale = 0
          and bailun_sku = #{bailunSku}
          and warehouse_code = #{warehouseCode}
    </select>

    <select id="getSalesVolumeDTO" resultType="com.bailuntec.domain.dto.SalesVolumeDTO">
        SELECT bailun_sku,
               warehouse_code,
               warehouse_name,
               title,
               bailun_category_id                                                     as category_id,
               thirtyday_sales,
               twenty_nineday_sales,
               twenty_eightday_sales,
               twenty_seveneday_sales,
               twenty_sixday_sales,
               twenty_fiveday_sales,
               twenty_fourthday_sales,
               twenty_threeday_sales,
               twenty_twoday_sales,
               twenty_oneday_sales,
               twentyday_sales,
               nineteenday_sales,
               eighteenday_sales,
               seventeenday_sales,
               sixteenday_sales,
               fifteenday_sales,
               fourteenday_sales,
               thridteenday_sales,
               twelveday_sales,
               elevenday_sales,
               tenday_sales,
               nineday_sales,
               eightday_sales,
               sevenday_sales,
               sixday_sales,
               fiveday_sales,
               fourthday_sales,
               threeday_sales,
               twoday_sales,
               oneday_sales,
               CONCAT_WS(',', thirtyday_sales, twenty_nineday_sales, twenty_eightday_sales, twenty_seveneday_sales,
                         twenty_sixday_sales, twenty_fiveday_sales, twenty_fourthday_sales, twenty_threeday_sales,
                         twenty_twoday_sales, twenty_oneday_sales
                   , twentyday_sales, nineteenday_sales, eighteenday_sales, seventeenday_sales, sixteenday_sales,
                         fifteenday_sales, fourteenday_sales, thridteenday_sales, twelveday_sales, elevenday_sales
                   , tenday_sales, nineday_sales, eightday_sales, sevenday_sales, sixday_sales, fiveday_sales,
                         fourthday_sales, threeday_sales, twoday_sales, oneday_sales) as 'history_sales'
        from (SELECT bailun_sku,
                     warehouse_code,
                     warehouse_name,
                     bailun_sku_title_cn                                                                   title,
                     bailun_category_id,
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 1 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 1 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'oneday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 2 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 2 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twoday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 3 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 3 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'threeday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 4 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 4 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'fourthday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 5 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 5 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'fiveday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 6 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 6 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'sixday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 7 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 7 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'sevenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 8 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 8 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'eightday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 9 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 9 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'nineday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 10 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 10 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'tenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 11 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 11 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'elevenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 12 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 12 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twelveday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 13 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 13 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'thridteenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 14 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 14 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'fourteenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 15 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 15 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'fifteenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 16 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 16 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'sixteenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 17 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 17 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'seventeenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 18 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 18 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'eighteenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 19 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 19 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'nineteenday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 20 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 20 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twentyday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 21 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 21 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_oneday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 22 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 22 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_twoday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 23 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 23 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_threeday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 24 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 24 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_fourthday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 25 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 25 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_fiveday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 26 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 26 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_sixday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 27 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 27 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_seveneday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 28 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 28 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_eightday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 29 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 29 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'twenty_nineday_sales',
                     if(sum(case
                                when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-15 15:00:00' and
                                      paid_time &lt;= '2020-06-22 15:00:00') then 0
                                when (DATE_SUB(#{queryTime}, INTERVAL 30 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                    then bailun_sku_quantity_ordered
                                else 0 end) &gt; #{compareSales}, #{compareSales}, sum(case
                                                                                           when (platform_type = 'Aliexpress' and
                                                                                                 paid_time &gt;= '2020-06-15 15:00:00' and
                                                                                                 paid_time &lt;= '2020-06-22 15:00:00')
                                                                                               then 0
                                                                                           when (DATE_SUB(#{queryTime}, INTERVAL 30 DAY) =
                                                                                                 DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                                                                               then bailun_sku_quantity_ordered
                                                                                           else 0 end)) as 'thirtyday_sales'
              FROM dc_base_oms_sku_30
              where paid_time >= DATE_SUB(#{queryTime}, INTERVAL 30 DAY)
                and paid_time &lt; #{queryTime}
                and bailun_order_status != 'Canceled'
                and has_fba_s = 0
                and has_delete = 0
                and has_scalp = 0
                and has_buyer_remark = 0
                and has_platsku_remark = 0
                and has_innersale = 0
                and bailun_sku = #{bailunSku}
                and warehouse_code = #{warehouseCode}
                and !(paid_time &gt;= '2020-11-11 00:00:00' and paid_time &lt;= '2020-11-13 00:00:00' and
                      platform_type = 'Aliexpress')
                and !(paid_time &gt;= '2020-11-23 00:00:00' and paid_time &lt;= '2020-11-28 00:00:00' and
                      platform_type = 'Aliexpress')
                and !(paid_time &gt;= '2020-11-23 00:00:00' and paid_time &lt;= '2020-12-06 00:00:00' and
                      platform_type = 'FBA')
                and platform_order_type != '手工单'
             ) sales_table
    </select>

    <select id="getSalesVolumeDTONoCompare" resultType="com.bailuntec.domain.dto.SalesVolumeDTO">
        SELECT bailun_sku,
               warehouse_code,
               warehouse_name,
               title,
               bailun_category_id                                                     as category_id,
               thirtyday_sales,
               twenty_nineday_sales,
               twenty_eightday_sales,
               twenty_seveneday_sales,
               twenty_sixday_sales,
               twenty_fiveday_sales,
               twenty_fourthday_sales,
               twenty_threeday_sales,
               twenty_twoday_sales,
               twenty_oneday_sales,
               twentyday_sales,
               nineteenday_sales,
               eighteenday_sales,
               seventeenday_sales,
               sixteenday_sales,
               fifteenday_sales,
               fourteenday_sales,
               thridteenday_sales,
               twelveday_sales,
               elevenday_sales,
               tenday_sales,
               nineday_sales,
               eightday_sales,
               sevenday_sales,
               sixday_sales,
               fiveday_sales,
               fourthday_sales,
               threeday_sales,
               twoday_sales,
               oneday_sales,
               CONCAT_WS(',', thirtyday_sales, twenty_nineday_sales, twenty_eightday_sales, twenty_seveneday_sales,
                         twenty_sixday_sales, twenty_fiveday_sales, twenty_fourthday_sales, twenty_threeday_sales,
                         twenty_twoday_sales, twenty_oneday_sales
                   , twentyday_sales, nineteenday_sales, eighteenday_sales, seventeenday_sales, sixteenday_sales,
                         fifteenday_sales, fourteenday_sales, thridteenday_sales, twelveday_sales, elevenday_sales
                   , tenday_sales, nineday_sales, eightday_sales, sevenday_sales, sixday_sales, fiveday_sales,
                         fourthday_sales, threeday_sales, twoday_sales, oneday_sales) as 'history_sales'
        from (SELECT bailun_sku,
                     warehouse_code,
                     warehouse_name,
                     bailun_sku_title_cn    title,
                     bailun_category_id,
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 1 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'oneday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 2 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twoday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 3 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'threeday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 4 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'fourthday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 5 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'fiveday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 6 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'sixday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 7 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'sevenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 8 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'eightday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 9 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'nineday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 10 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'tenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 11 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'elevenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 12 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twelveday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 13 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'thridteenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 14 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'fourteenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 15 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'fifteenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 16 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'sixteenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 17 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'seventeenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 18 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'eighteenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 19 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'nineteenday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 20 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twentyday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 21 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_oneday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 22 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_twoday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 23 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_threeday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 24 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_fourthday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 25 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_fiveday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 26 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_sixday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 27 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_seveneday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 28 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_eightday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 29 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'twenty_nineday_sales',
                     sum(case
                             when (platform_type = 'Aliexpress' and paid_time &gt;= '2020-06-16 15:00:00' and
                                   paid_time &lt;= '2020-06-22 15:00:00') then 0
                             when (DATE_SUB(#{queryTime}, INTERVAL 30 DAY) = DATE_FORMAT(paid_time, '%Y-%m-%d'))
                                 then bailun_sku_quantity_ordered
                             else 0 end) as 'thirtyday_sales'
              FROM dc_base_oms_sku_30
              where paid_time >= DATE_SUB(#{queryTime}, INTERVAL 30 DAY)
                and paid_time &lt; #{queryTime}
                and bailun_order_status != 'Canceled'
                and has_fba_s = 0
                and has_delete = 0
                and has_scalp = 0
                and has_buyer_remark = 0
                and has_platsku_remark = 0
                and has_innersale = 0
                and bailun_sku = #{bailunSku}
                and warehouse_code = #{warehouseCode}
                and !(paid_time &gt;= '2020-11-11 00:00:00' and paid_time &lt;= '2020-11-13 00:00:00' and
                      platform_type = 'Aliexpress')
                and !(paid_time &gt;= '2020-11-23 00:00:00' and paid_time &lt;= '2020-11-28 00:00:00' and
                      platform_type = 'Aliexpress')
                and !(paid_time &gt;= '2020-11-23 00:00:00' and paid_time &lt;= '2020-12-06 00:00:00' and
                      platform_type = 'FBA')
                and platform_order_type != '手工单'
             ) sales_table

    </select>

    <select id="getSalesVolumeWeekDTO" resultType="com.bailuntec.domain.dto.SalesVolumeWeekDTO">
        select
        bailun_sku,
        warehouse_code,oneWeekRate,twoWeekRate,threeWeekRate,fourthWeekRate,fiveWeekRate,sixWeekRate,sevenWeekRate,eightWeekRate,nineWeekRate,tenWeekRate,elevenWeekRate,twelveWeekRate,
        thridteenWeekRate, fourteenWeekRate,fifteenWeekRate,
        sixteenWeekRate,seventeenWeekRate,eighteenWeekRate, nineteenWeekRate, twentyWeekRate,
        twentyOneWeekRate,twentyTwoWeekRate, twentyThreeWeekRate,twentyFourthWeekRate,twentyFiveWeekRate,
        twentySixWeekRate,twentySeveneWeekRate,
        twentyEightWeekRate, twentyNineWeekRate,thirtyWeekRate,thirtyOneWeekRate,thirtyTwoWeekRate,thirtyThreeWeekRate,
        thirtyFourthWeekRate, thirtyFiveWeekRate, thirtySixWeekRate,thirtySeveneWeekRate, thirtyEightWeekRate,
        thirtyNineWeekRate, fortyWeekRate,
        fortyOneWeekRate,fortyTwoWeekRate,fortyThreeWeekRate, fortyFourthWeekRate, fortyFiveWeekRate, fortySixWeekRate,
        fortySeveneWeekRate,fortyEightWeekRate, fortyNineWeekRate, fiftyWeekRate,fiftyOneWeekRate,
        fiftyTwoWeekRate,salesDetail,
        CONCAT_WS(
        ',',
        oneWeekRate,
        twoWeekRate ,
        threeWeekRate ,
        fourthWeekRate ,
        fiveWeekRate ,
        sixWeekRate ,
        sevenWeekRate ,
        eightWeekRate ,
        nineWeekRate ,
        tenWeekRate ,
        elevenWeekRate ,
        twelveWeekRate ,
        thridteenWeekRate ,
        fourteenWeekRate ,
        fifteenWeekRate ,
        sixteenWeekRate ,
        seventeenWeekRate ,
        eighteenWeekRate ,
        nineteenWeekRate ,
        twentyWeekRate ,
        twentyOneWeekRate ,
        twentyTwoWeekRate ,
        twentyThreeWeekRate ,
        twentyFourthWeekRate ,
        twentyFiveWeekRate ,
        twentySixWeekRate ,
        twentySeveneWeekRate ,
        twentyEightWeekRate ,
        twentyNineWeekRate ,
        thirtyWeekRate ,
        thirtyOneWeekRate ,
        thirtyTwoWeekRate ,
        thirtyThreeWeekRate ,
        thirtyFourthWeekRate ,
        thirtyFiveWeekRate ,
        thirtySixWeekRate ,
        thirtySeveneWeekRate ,
        thirtyEightWeekRate ,
        thirtyNineWeekRate ,
        fortyWeekRate ,
        fortyOneWeekRate ,
        fortyTwoWeekRate ,
        fortyThreeWeekRate ,
        fortyFourthWeekRate ,
        fortyFiveWeekRate ,
        fortySixWeekRate ,
        fortySeveneWeekRate ,
        fortyEightWeekRate ,
        fortyNineWeekRate ,
        fiftyWeekRate ,
        fiftyOneWeekRate ,
        fiftyTwoWeekRate
        ) AS 'rateDetail'
        from (SELECT bailun_sku,
        warehouse_code,
        round(case when oneWeekSales = 0 then 0 else 1 end, 2) as oneWeekRate,
        round(case when (oneWeekSales = 0 and twoWeekSales = 0) then 0 when (oneWeekSales = 0 and twoWeekSales != 0)
        then 1 else twoWeekSales/oneWeekSales end, 2) as twoWeekRate,
        round(case when (twoWeekSales = 0 and threeWeekSales = 0) then 0 when (twoWeekSales = 0 and threeWeekSales != 0)
        then 1 else threeWeekSales/twoWeekSales end, 2) as threeWeekRate,
        round(case when (threeWeekSales = 0 and fourthWeekSales = 0) then 0 when (threeWeekSales = 0 and fourthWeekSales
        != 0) then 1 else fourthWeekSales/threeWeekSales end, 2) as fourthWeekRate,
        round(case when (fourthWeekSales = 0 and fiveWeekSales = 0) then 0 when (fourthWeekSales = 0 and fiveWeekSales
        != 0) then 1 else fiveWeekSales/fourthWeekSales end, 2) as fiveWeekRate,
        round(case when (fiveWeekSales = 0 and sixWeekSales = 0) then 0 when (fiveWeekSales = 0 and sixWeekSales != 0)
        then 1 else sixWeekSales/fiveWeekSales end, 2) as sixWeekRate,
        round(case when (sixWeekSales = 0 and sevenWeekSales = 0) then 0 when (sixWeekSales = 0 and sevenWeekSales != 0)
        then 1 else sevenWeekSales/sixWeekSales end, 2) as sevenWeekRate,
        round(case when (sevenWeekSales = 0 and eightWeekSales = 0) then 0 when (sevenWeekSales = 0 and eightWeekSales
        != 0) then 1 else eightWeekSales/sevenWeekSales end, 2) as eightWeekRate,
        round(case when (eightWeekSales = 0 and nineWeekSales = 0) then 0 when (eightWeekSales = 0 and nineWeekSales !=
        0) then 1 else nineWeekSales/eightWeekSales end, 2) as nineWeekRate,
        round(case when (nineWeekSales = 0 and tenWeekSales = 0) then 0 when (nineWeekSales = 0 and tenWeekSales != 0)
        then 1 else tenWeekSales/nineWeekSales end, 2) as tenWeekRate,
        round(case when (tenWeekSales = 0 and elevenWeekSales = 0) then 0 when (tenWeekSales = 0 and elevenWeekSales !=
        0) then 1 else elevenWeekSales/tenWeekSales end, 2) as elevenWeekRate,
        round(case when (elevenWeekSales = 0 and twelveWeekSales = 0) then 0 when (elevenWeekSales = 0 and
        twelveWeekSales != 0) then 1 else twelveWeekSales/elevenWeekSales end, 2) as twelveWeekRate,
        round(case when (twelveWeekSales = 0 and thridteenWeekSales = 0) then 0 when (twelveWeekSales = 0 and
        thridteenWeekSales != 0) then 1 else thridteenWeekSales/twelveWeekSales end, 2) as thridteenWeekRate,
        round(case when (thridteenWeekSales = 0 and fourteenWeekSales = 0) then 0 when (thridteenWeekSales = 0 and
        fourteenWeekSales != 0) then 1 else fourteenWeekSales/thridteenWeekSales end, 2) as fourteenWeekRate,
        round(case when (fourteenWeekSales = 0 and fifteenWeekSales = 0) then 0 when (fourteenWeekSales = 0 and
        fifteenWeekSales != 0) then 1 else fifteenWeekSales/fourteenWeekSales end, 2) as fifteenWeekRate,
        round(case when (fifteenWeekSales = 0 and sixteenWeekSales = 0) then 0 when (fifteenWeekSales = 0 and
        sixteenWeekSales != 0) then 1 else sixteenWeekSales/fifteenWeekSales end, 2) as sixteenWeekRate,
        round(case when (sixteenWeekSales = 0 and seventeenWeekSales = 0) then 0 when (sixteenWeekSales = 0 and
        seventeenWeekSales != 0) then 1 else seventeenWeekSales/sixteenWeekSales end, 2) as seventeenWeekRate,
        round(case when (seventeenWeekSales = 0 and eighteenWeekSales = 0) then 0 when (seventeenWeekSales = 0 and
        eighteenWeekSales != 0) then 1 else eighteenWeekSales/seventeenWeekSales end, 2) as eighteenWeekRate,
        round(case when (eighteenWeekSales = 0 and nineteenWeekSales = 0) then 0 when (eighteenWeekSales = 0 and
        nineteenWeekSales != 0) then 1 else nineteenWeekSales/eighteenWeekSales end, 2) as nineteenWeekRate,
        round(case when (nineteenWeekSales = 0 and twentyWeekSales = 0) then 0 when (nineteenWeekSales = 0 and
        twentyWeekSales != 0) then 1 else twentyWeekSales/nineteenWeekSales end, 2) as twentyWeekRate,
        round(case when (twentyWeekSales = 0 and twentyOneWeekSales = 0) then 0 when (twentyWeekSales = 0 and
        twentyOneWeekSales != 0) then 1 else twentyOneWeekSales/twentyWeekSales end, 2) as twentyOneWeekRate,
        round(case when (twentyOneWeekSales = 0 and twentyTwoWeekSales = 0) then 0 when (twentyOneWeekSales = 0 and
        twentyTwoWeekSales != 0) then 1 else twentyTwoWeekSales/twentyOneWeekSales end, 2) as twentyTwoWeekRate,
        round(case when (twentyTwoWeekSales = 0 and twentyThreeWeekSales = 0) then 0 when (twentyTwoWeekSales = 0 and
        twentyThreeWeekSales != 0) then 1 else twentyThreeWeekSales/twentyTwoWeekSales end, 2) as twentyThreeWeekRate,
        round(case when (twentyThreeWeekSales = 0 and twentyFourthWeekSales = 0) then 0 when (twentyThreeWeekSales = 0
        and twentyFourthWeekSales != 0) then 1 else twentyFourthWeekSales/twentyThreeWeekSales end, 2) as
        twentyFourthWeekRate,
        round(case when (twentyFourthWeekSales = 0 and twentyFiveWeekSales = 0) then 0 when (twentyFourthWeekSales = 0
        and twentyFiveWeekSales != 0) then 1 else twentyFiveWeekSales/twentyFourthWeekSales end, 2) as
        twentyFiveWeekRate,
        round(case when (twentyFiveWeekSales = 0 and twentySixWeekSales = 0) then 0 when (twentyFiveWeekSales = 0 and
        twentySixWeekSales != 0) then 1 else twentySixWeekSales/twentyFiveWeekSales end, 2) as twentySixWeekRate,
        round(case when (twentySixWeekSales = 0 and twentySeveneWeekSales = 0) then 0 when (twentySixWeekSales = 0 and
        twentySeveneWeekSales != 0) then 1 else twentySeveneWeekSales/twentySixWeekSales end, 2) as
        twentySeveneWeekRate,
        round(case when (twentySeveneWeekSales = 0 and twentyEightWeekSales = 0) then 0 when (twentySeveneWeekSales = 0
        and twentyEightWeekSales != 0) then 1 else twentyEightWeekSales/twentySeveneWeekSales end, 2) as
        twentyEightWeekRate,
        round(case when (twentyEightWeekSales = 0 and twentyNineWeekSales = 0) then 0 when (twentyEightWeekSales = 0 and
        twentyNineWeekSales != 0) then 1 else twentyNineWeekSales/twentyEightWeekSales end, 2) as twentyNineWeekRate,
        round(case when (twentyNineWeekSales = 0 and thirtyWeekSales = 0) then 0 when (twentyNineWeekSales = 0 and
        thirtyWeekSales != 0) then 1 else thirtyWeekSales/twentyNineWeekSales end, 2) as thirtyWeekRate,
        round(case when (thirtyWeekSales = 0 and thirtyOneWeekSales = 0) then 0 when (thirtyWeekSales = 0 and
        thirtyOneWeekSales != 0) then 1 else thirtyOneWeekSales/thirtyWeekSales end, 2) as thirtyOneWeekRate,
        round(case when (thirtyOneWeekSales = 0 and thirtyTwoWeekSales = 0) then 0 when (thirtyOneWeekSales = 0 and
        thirtyTwoWeekSales != 0) then 1 else thirtyTwoWeekSales/thirtyOneWeekSales end, 2) as thirtyTwoWeekRate,
        round(case when (thirtyTwoWeekSales = 0 and thirtyThreeWeekSales = 0) then 0 when (thirtyTwoWeekSales = 0 and
        thirtyThreeWeekSales != 0) then 1 else thirtyThreeWeekSales/thirtyTwoWeekSales end, 2) as thirtyThreeWeekRate,
        round(case when (thirtyThreeWeekSales = 0 and thirtyFourthWeekSales = 0) then 0 when (thirtyThreeWeekSales = 0
        and thirtyFourthWeekSales != 0) then 1 else thirtyFourthWeekSales/thirtyThreeWeekSales end, 2) as
        thirtyFourthWeekRate,
        round(case when (thirtyFourthWeekSales = 0 and thirtyFiveWeekSales = 0) then 0 when (thirtyFourthWeekSales = 0
        and thirtyFiveWeekSales != 0) then 1 else thirtyFiveWeekSales/thirtyFourthWeekSales end, 2) as
        thirtyFiveWeekRate,
        round(case when (thirtyFiveWeekSales = 0 and thirtySixWeekSales = 0) then 0 when (thirtyFiveWeekSales = 0 and
        thirtySixWeekSales != 0) then 1 else thirtySixWeekSales/thirtyFiveWeekSales end, 2) as thirtySixWeekRate,
        round(case when (thirtySixWeekSales = 0 and thirtySeveneWeekSales = 0) then 0 when (thirtySixWeekSales = 0 and
        thirtySeveneWeekSales != 0) then 1 else thirtySeveneWeekSales/thirtySixWeekSales end, 2) as
        thirtySeveneWeekRate,
        round(case when (thirtySeveneWeekSales = 0 and thirtyEightWeekSales = 0) then 0 when (thirtySeveneWeekSales = 0
        and thirtyEightWeekSales != 0) then 1 else thirtyEightWeekSales/thirtySeveneWeekSales end, 2) as
        thirtyEightWeekRate,
        round(case when (thirtyEightWeekSales = 0 and thirtyNineWeekSales = 0) then 0 when (thirtyEightWeekSales = 0 and
        thirtyNineWeekSales != 0) then 1 else thirtyNineWeekSales/thirtyEightWeekSales end, 2) as thirtyNineWeekRate,
        round(case when (thirtyNineWeekSales = 0 and fortyWeekSales = 0) then 0 when (thirtyNineWeekSales = 0 and
        fortyWeekSales != 0) then 1 else fortyWeekSales/thirtyNineWeekSales end, 2) as fortyWeekRate,
        round(case when (fortyWeekSales = 0 and fortyOneWeekSales = 0) then 0 when (fortyWeekSales = 0 and
        fortyOneWeekSales != 0) then 1 else fortyOneWeekSales/fortyWeekSales end, 2) as fortyOneWeekRate,
        round(case when (fortyOneWeekSales = 0 and fortyTwoWeekSales = 0) then 0 when (fortyOneWeekSales = 0 and
        fortyTwoWeekSales != 0) then 1 else fortyTwoWeekSales/fortyOneWeekSales end, 2) as fortyTwoWeekRate,
        round(case when (fortyTwoWeekSales = 0 and fortyThreeWeekSales = 0) then 0 when (fortyTwoWeekSales = 0 and
        fortyThreeWeekSales != 0) then 1 else fortyThreeWeekSales/fortyTwoWeekSales end, 2) as fortyThreeWeekRate,
        round(case when (fortyThreeWeekSales = 0 and fortyFourthWeekSales = 0) then 0 when (fortyThreeWeekSales = 0 and
        fortyFourthWeekSales != 0) then 1 else fortyFourthWeekSales/fortyThreeWeekSales end, 2) as fortyFourthWeekRate,
        round(case when (fortyFourthWeekSales = 0 and fortyFiveWeekSales = 0) then 0 when (fortyFourthWeekSales = 0 and
        fortyFiveWeekSales != 0) then 1 else fortyFiveWeekSales/fortyFourthWeekSales end, 2) as fortyFiveWeekRate,
        round(case when (fortyFiveWeekSales = 0 and fortySixWeekSales = 0) then 0 when (fortyFiveWeekSales = 0 and
        fortySixWeekSales != 0) then 1 else fortySixWeekSales/fortyFiveWeekSales end, 2) as fortySixWeekRate,
        round(case when (fortySixWeekSales = 0 and fortySeveneWeekSales = 0) then 0 when (fortySixWeekSales = 0 and
        fortySeveneWeekSales != 0) then 1 else fortySeveneWeekSales/fortySixWeekSales end, 2) as fortySeveneWeekRate,
        round(case when (fortySeveneWeekSales = 0 and fortyEightWeekSales = 0) then 0 when (fortySeveneWeekSales = 0 and
        fortyEightWeekSales != 0) then 1 else fortyEightWeekSales/fortySeveneWeekSales end, 2) as fortyEightWeekRate,
        round(case when (fortyEightWeekSales = 0 and fortyNineWeekSales = 0) then 0 when (fortyEightWeekSales = 0 and
        fortyNineWeekSales != 0) then 1 else fortyNineWeekSales/fortyEightWeekSales end, 2) as fortyNineWeekRate,
        round(case when (fortyNineWeekSales = 0 and fiftyWeekSales = 0) then 0 when (fortyNineWeekSales = 0 and
        fiftyWeekSales != 0) then 1 else fiftyWeekSales/fortyNineWeekSales end, 2) as fiftyWeekRate,
        round(case when (fiftyWeekSales = 0 and fiftyOneWeekSales = 0) then 0 when (fiftyWeekSales = 0 and
        fiftyOneWeekSales != 0) then 1 else fiftyOneWeekSales/fiftyWeekSales end, 2) as fiftyOneWeekRate,
        round(case when (fiftyOneWeekSales = 0 and fiftyTwoWeekSales = 0) then 0 when (fiftyOneWeekSales = 0 and
        fiftyTwoWeekSales != 0) then 1 else fiftyTwoWeekSales/fiftyOneWeekSales end, 2) as fiftyTwoWeekRate,
        CONCAT_WS(
        ',',
        oneWeekSales,
        twoWeekSales,
        threeWeekSales,
        fourthWeekSales,
        fiveWeekSales,
        sixWeekSales,
        sevenWeekSales,
        eightWeekSales,
        nineWeekSales,
        tenWeekSales,
        elevenWeekSales,
        twelveWeekSales,
        thridteenWeekSales,
        fourteenWeekSales,
        fifteenWeekSales,
        sixteenWeekSales,
        seventeenWeekSales,
        eighteenWeekSales,
        nineteenWeekSales,
        twentyWeekSales,
        twentyOneWeekSales,
        twentyTwoWeekSales,
        twentyThreeWeekSales,
        twentyFourthWeekSales,
        twentyFiveWeekSales,
        twentySixWeekSales,
        twentySeveneWeekSales,
        twentyEightWeekSales,
        twentyNineWeekSales,
        thirtyWeekSales,
        thirtyOneWeekSales,
        thirtyTwoWeekSales,
        thirtyThreeWeekSales,
        thirtyFourthWeekSales,
        thirtyFiveWeekSales,
        thirtySixWeekSales,
        thirtySeveneWeekSales,
        thirtyEightWeekSales,
        thirtyNineWeekSales,
        fortyWeekSales,
        fortyOneWeekSales,
        fortyTwoWeekSales,
        fortyThreeWeekSales,
        fortyFourthWeekSales,
        fortyFiveWeekSales,
        fortySixWeekSales,
        fortySeveneWeekSales,
        fortyEightWeekSales,
        fortyNineWeekSales,
        fiftyWeekSales,
        fiftyOneWeekSales,
        fiftyTwoWeekSales
        ) AS 'salesDetail'
        from
        (select bailun_sku, warehouse_code,
        sum(case when week(paid_time) = 1 then bailun_sku_quantity_ordered else 0 end) as 'oneWeekSales',
        sum(case when week(paid_time) = 2 then bailun_sku_quantity_ordered else 0 end) as 'twoWeekSales',
        sum(case when week(paid_time) = 3 then bailun_sku_quantity_ordered else 0 end) as 'threeWeekSales',
        sum(case when week(paid_time) = 4 then bailun_sku_quantity_ordered else 0 end) as 'fourthWeekSales',
        sum(case when week(paid_time) = 5 then bailun_sku_quantity_ordered else 0 end) as 'fiveWeekSales',
        sum(case when week(paid_time) = 6 then bailun_sku_quantity_ordered else 0 end) as 'sixWeekSales',
        sum(case when week(paid_time) = 7 then bailun_sku_quantity_ordered else 0 end) as 'sevenWeekSales',
        sum(case when week(paid_time) = 8 then bailun_sku_quantity_ordered else 0 end) as 'eightWeekSales',
        sum(case when week(paid_time) = 9 then bailun_sku_quantity_ordered else 0 end) as 'nineWeekSales',
        sum(case when week(paid_time) = 10 then bailun_sku_quantity_ordered else 0 end) as 'tenWeekSales',
        sum(case when week(paid_time) = 11 then bailun_sku_quantity_ordered else 0 end) as 'elevenWeekSales',
        sum(case when week(paid_time) = 12 then bailun_sku_quantity_ordered else 0 end) as 'twelveWeekSales',
        sum(case when week(paid_time) = 13 then bailun_sku_quantity_ordered else 0 end) as 'thridteenWeekSales',
        sum(case when week(paid_time) = 14 then bailun_sku_quantity_ordered else 0 end) as 'fourteenWeekSales',
        sum(case when week(paid_time) = 15 then bailun_sku_quantity_ordered else 0 end) as 'fifteenWeekSales',
        sum(case when week(paid_time) = 16 then bailun_sku_quantity_ordered else 0 end) as 'sixteenWeekSales',
        sum(case when week(paid_time) = 17 then bailun_sku_quantity_ordered else 0 end) as 'seventeenWeekSales',
        sum(case when week(paid_time) = 18 then bailun_sku_quantity_ordered else 0 end) as 'eighteenWeekSales',
        sum(case when week(paid_time) = 19 then bailun_sku_quantity_ordered else 0 end) as 'nineteenWeekSales',
        sum(case when week(paid_time) = 20 then bailun_sku_quantity_ordered else 0 end) as 'twentyWeekSales',
        sum(case when week(paid_time) = 21 then bailun_sku_quantity_ordered else 0 end) as 'twentyOneWeekSales',
        sum(case when week(paid_time) = 22 then bailun_sku_quantity_ordered else 0 end) as 'twentyTwoWeekSales',
        sum(case when week(paid_time) = 23 then bailun_sku_quantity_ordered else 0 end) as 'twentyThreeWeekSales',
        sum(case when week(paid_time) = 24 then bailun_sku_quantity_ordered else 0 end) as 'twentyFourthWeekSales',
        sum(case when week(paid_time) = 25 then bailun_sku_quantity_ordered else 0 end) as 'twentyFiveWeekSales',
        sum(case when week(paid_time) = 26 then bailun_sku_quantity_ordered else 0 end) as 'twentySixWeekSales',
        sum(case when week(paid_time) = 27 then bailun_sku_quantity_ordered else 0 end) as 'twentySeveneWeekSales',
        sum(case when week(paid_time) = 28 then bailun_sku_quantity_ordered else 0 end) as 'twentyEightWeekSales',
        sum(case when week(paid_time) = 29 then bailun_sku_quantity_ordered else 0 end) as 'twentyNineWeekSales',
        sum(case when week(paid_time) = 30 then bailun_sku_quantity_ordered else 0 end) as 'thirtyWeekSales',
        sum(case when week(paid_time) = 31 then bailun_sku_quantity_ordered else 0 end) as 'thirtyOneWeekSales',
        sum(case when week(paid_time) = 32 then bailun_sku_quantity_ordered else 0 end) as 'thirtyTwoWeekSales',
        sum(case when week(paid_time) = 33 then bailun_sku_quantity_ordered else 0 end) as 'thirtyThreeWeekSales',
        sum(case when week(paid_time) = 34 then bailun_sku_quantity_ordered else 0 end) as 'thirtyFourthWeekSales',
        sum(case when week(paid_time) = 35 then bailun_sku_quantity_ordered else 0 end) as 'thirtyFiveWeekSales',
        sum(case when week(paid_time) = 36 then bailun_sku_quantity_ordered else 0 end) as 'thirtySixWeekSales',
        sum(case when week(paid_time) = 37 then bailun_sku_quantity_ordered else 0 end) as 'thirtySeveneWeekSales',
        sum(case when week(paid_time) = 38 then bailun_sku_quantity_ordered else 0 end) as 'thirtyEightWeekSales',
        sum(case when week(paid_time) = 39 then bailun_sku_quantity_ordered else 0 end) as 'thirtyNineWeekSales',
        sum(case when week(paid_time) = 40 then bailun_sku_quantity_ordered else 0 end) as 'fortyWeekSales',
        sum(case when week(paid_time) = 41 then bailun_sku_quantity_ordered else 0 end) as 'fortyOneWeekSales',
        sum(case when week(paid_time) = 42 then bailun_sku_quantity_ordered else 0 end) as 'fortyTwoWeekSales',
        sum(case when week(paid_time) = 43 then bailun_sku_quantity_ordered else 0 end) as 'fortyThreeWeekSales',
        sum(case when week(paid_time) = 44 then bailun_sku_quantity_ordered else 0 end) as 'fortyFourthWeekSales',
        sum(case when week(paid_time) = 45 then bailun_sku_quantity_ordered else 0 end) as 'fortyFiveWeekSales',
        sum(case when week(paid_time) = 46 then bailun_sku_quantity_ordered else 0 end) as 'fortySixWeekSales',
        sum(case when week(paid_time) = 47 then bailun_sku_quantity_ordered else 0 end) as 'fortySeveneWeekSales',
        sum(case when week(paid_time) = 48 then bailun_sku_quantity_ordered else 0 end) as 'fortyEightWeekSales',
        sum(case when week(paid_time) = 49 then bailun_sku_quantity_ordered else 0 end) as 'fortyNineWeekSales',
        sum(case when week(paid_time) = 50 then bailun_sku_quantity_ordered else 0 end) as 'fiftyWeekSales',
        sum(case when week(paid_time) = 51 then bailun_sku_quantity_ordered else 0 end) as 'fiftyOneWeekSales',
        sum(case when week(paid_time) = 52 then bailun_sku_quantity_ordered else 0 end) as 'fiftyTwoWeekSales'
        FROM `dc_base_oms_sku`
        where paid_time &gt;= '2019-01-01 00:00:00'
        and paid_time &lt;= '2019-12-31 23:59:59'
        and bailun_order_status != 'Canceled'
        and has_fba_s = 0
        and has_delete = 0
        and has_scalp = 0
        and has_buyer_remark = 0
        and has_platsku_remark = 0
        and has_innersale = 0
        and platform_order_type != '手工单'
        and !(paid_time &gt;= '2020-11-11 00:00:00' and paid_time &lt;= '2020-11-13 00:00:00' and
        platform_type = 'Aliexpress')
        <if test="bailunSku != null and bailunSku != ''">
            and bailun_sku = #{bailunSku}
        </if>
        and warehouse_code = #{warehouseCode})sales_table)sales_table1
    </select>

    <!--<select id="getSalesVolumeWeekDTO" resultType="com.bailuntec.domain.dto.SalesVolumeWeekDTO">
        select
        bailun_sku,
        warehouse_code,oneWeekRate,twoWeekRate,threeWeekRate,fourthWeekRate,fiveWeekRate,sixWeekRate,sevenWeekRate,eightWeekRate,nineWeekRate,tenWeekRate,elevenWeekRate,twelveWeekRate, thridteenWeekRate, fourteenWeekRate,fifteenWeekRate,
        sixteenWeekRate,seventeenWeekRate,eighteenWeekRate, nineteenWeekRate, twentyWeekRate, twentyOneWeekRate,twentyTwoWeekRate, twentyThreeWeekRate,twentyFourthWeekRate,twentyFiveWeekRate, twentySixWeekRate,twentySeveneWeekRate,
        twentyEightWeekRate, twentyNineWeekRate,thirtyWeekRate,thirtyOneWeekRate,thirtyTwoWeekRate,thirtyThreeWeekRate, thirtyFourthWeekRate, thirtyFiveWeekRate, thirtySixWeekRate,thirtySeveneWeekRate,  thirtyEightWeekRate, thirtyNineWeekRate, fortyWeekRate,
        fortyOneWeekRate,fortyTwoWeekRate,fortyThreeWeekRate, fortyFourthWeekRate, fortyFiveWeekRate, fortySixWeekRate, fortySeveneWeekRate,fortyEightWeekRate, fortyNineWeekRate, fiftyWeekRate,fiftyOneWeekRate,
        fiftyTwoWeekRate,salesDetail,
        CONCAT_WS(
        ',',
        oneWeekRate,
        twoWeekRate ,
        threeWeekRate ,
        fourthWeekRate ,
        fiveWeekRate ,
        sixWeekRate ,
        sevenWeekRate ,
        eightWeekRate ,
        nineWeekRate ,
        tenWeekRate ,
        elevenWeekRate ,
        twelveWeekRate ,
        thridteenWeekRate ,
        fourteenWeekRate ,
        fifteenWeekRate ,
        sixteenWeekRate ,
        seventeenWeekRate ,
        eighteenWeekRate ,
        nineteenWeekRate ,
        twentyWeekRate ,
        twentyOneWeekRate ,
        twentyTwoWeekRate ,
        twentyThreeWeekRate ,
        twentyFourthWeekRate ,
        twentyFiveWeekRate ,
        twentySixWeekRate ,
        twentySeveneWeekRate ,
        twentyEightWeekRate ,
        twentyNineWeekRate ,
        thirtyWeekRate ,
        thirtyOneWeekRate ,
        thirtyTwoWeekRate ,
        thirtyThreeWeekRate ,
        thirtyFourthWeekRate ,
        thirtyFiveWeekRate ,
        thirtySixWeekRate ,
        thirtySeveneWeekRate ,
        thirtyEightWeekRate ,
        thirtyNineWeekRate ,
        fortyWeekRate ,
        fortyOneWeekRate ,
        fortyTwoWeekRate ,
        fortyThreeWeekRate ,
        fortyFourthWeekRate ,
        fortyFiveWeekRate ,
        fortySixWeekRate ,
        fortySeveneWeekRate ,
        fortyEightWeekRate ,
        fortyNineWeekRate ,
        fiftyWeekRate ,
        fiftyOneWeekRate ,
        fiftyTwoWeekRate
        ) AS 'rateDetail'
        from (SELECT bailun_sku,
        warehouse_code,
        round(case when oneWeekSales = 0 then 0 else 1 end, 2) as oneWeekRate,
        round(case when (oneWeekSales = 0 and twoWeekSales = 0) then 0 when (oneWeekSales = 0 and twoWeekSales != 0) then 1 else twoWeekSales/oneWeekSales end, 2) as twoWeekRate,
        round(case when (twoWeekSales = 0 and threeWeekSales = 0) then 0 when (twoWeekSales = 0 and threeWeekSales != 0) then 1 else threeWeekSales/twoWeekSales end, 2) as threeWeekRate,
        round(case when (threeWeekSales = 0 and fourthWeekSales = 0) then 0 when (threeWeekSales = 0 and fourthWeekSales != 0) then 1 else fourthWeekSales/threeWeekSales end, 2) as fourthWeekRate,
        round(case when (fourthWeekSales = 0 and fiveWeekSales = 0) then 0 when (fourthWeekSales = 0 and fiveWeekSales != 0) then 1 else fiveWeekSales/fourthWeekSales end, 2) as fiveWeekRate,
        round(case when (fiveWeekSales = 0 and sixWeekSales = 0) then 0 when (fiveWeekSales = 0 and sixWeekSales != 0) then 1 else sixWeekSales/fiveWeekSales end, 2) as sixWeekRate,
        round(case when (sixWeekSales = 0 and sevenWeekSales = 0) then 0 when (sixWeekSales = 0 and sevenWeekSales != 0) then 1 else sevenWeekSales/sixWeekSales end, 2) as sevenWeekRate,
        round(case when (sevenWeekSales = 0 and eightWeekSales = 0) then 0 when (sevenWeekSales = 0 and eightWeekSales != 0) then 1 else eightWeekSales/sevenWeekSales end, 2) as eightWeekRate,
        round(case when (eightWeekSales = 0 and nineWeekSales = 0) then 0 when (eightWeekSales = 0 and nineWeekSales != 0) then 1 else nineWeekSales/eightWeekSales end, 2) as nineWeekRate,
        round(case when (nineWeekSales = 0 and tenWeekSales = 0) then 0 when (nineWeekSales = 0 and tenWeekSales != 0) then 1 else tenWeekSales/nineWeekSales end, 2) as tenWeekRate,
        round(case when (tenWeekSales = 0 and elevenWeekSales = 0) then 0 when (tenWeekSales = 0 and elevenWeekSales != 0) then 1 else elevenWeekSales/tenWeekSales end, 2) as elevenWeekRate,
        round(case when (elevenWeekSales = 0 and twelveWeekSales = 0) then 0 when (elevenWeekSales = 0 and twelveWeekSales != 0) then 1 else twelveWeekSales/elevenWeekSales end, 2) as twelveWeekRate,
        round(case when (twelveWeekSales = 0 and thridteenWeekSales = 0) then 0 when (twelveWeekSales = 0 and thridteenWeekSales != 0) then 1 else thridteenWeekSales/twelveWeekSales end, 2) as thridteenWeekRate,
        round(case when (thridteenWeekSales = 0 and fourteenWeekSales = 0) then 0 when (thridteenWeekSales = 0 and fourteenWeekSales != 0) then 1 else fourteenWeekSales/thridteenWeekSales end, 2) as fourteenWeekRate,
        round(case when (fourteenWeekSales = 0 and fifteenWeekSales = 0) then 0 when (fourteenWeekSales = 0 and fifteenWeekSales != 0) then 1 else fifteenWeekSales/fourteenWeekSales end, 2) as fifteenWeekRate,
        round(case when (fifteenWeekSales = 0 and sixteenWeekSales = 0) then 0 when (fifteenWeekSales = 0 and sixteenWeekSales != 0) then 1 else sixteenWeekSales/fifteenWeekSales end, 2) as sixteenWeekRate,
        round(case when (sixteenWeekSales = 0 and seventeenWeekSales = 0) then 0 when (sixteenWeekSales = 0 and seventeenWeekSales != 0) then 1 else seventeenWeekSales/sixteenWeekSales end, 2) as seventeenWeekRate,
        round(case when (seventeenWeekSales = 0 and eighteenWeekSales = 0) then 0 when (seventeenWeekSales = 0 and eighteenWeekSales != 0) then 1 else eighteenWeekSales/seventeenWeekSales end, 2) as eighteenWeekRate,
        round(case when (eighteenWeekSales = 0 and nineteenWeekSales = 0) then 0 when (eighteenWeekSales = 0 and nineteenWeekSales != 0) then 1 else nineteenWeekSales/eighteenWeekSales end, 2) as nineteenWeekRate,
        round(case when (nineteenWeekSales = 0 and twentyWeekSales = 0) then 0 when (nineteenWeekSales = 0 and twentyWeekSales != 0) then 1 else twentyWeekSales/nineteenWeekSales end, 2) as twentyWeekRate,
        round(case when (twentyWeekSales = 0 and twentyOneWeekSales = 0) then 0 when (twentyWeekSales = 0 and twentyOneWeekSales != 0) then 1 else twentyOneWeekSales/twentyWeekSales end, 2) as twentyOneWeekRate,
        round(case when (twentyOneWeekSales = 0 and twentyTwoWeekSales = 0) then 0 when (twentyOneWeekSales = 0 and twentyTwoWeekSales != 0) then 1 else twentyTwoWeekSales/twentyOneWeekSales end, 2) as twentyTwoWeekRate,
        round(case when (twentyTwoWeekSales = 0 and twentyThreeWeekSales = 0) then 0 when (twentyTwoWeekSales = 0 and twentyThreeWeekSales != 0) then 1 else twentyThreeWeekSales/twentyTwoWeekSales end, 2) as twentyThreeWeekRate,
        round(case when (twentyThreeWeekSales = 0 and twentyFourthWeekSales = 0) then 0 when (twentyThreeWeekSales = 0 and twentyFourthWeekSales != 0) then 1 else twentyFourthWeekSales/twentyThreeWeekSales end, 2) as twentyFourthWeekRate,
        round(case when (twentyFourthWeekSales = 0 and twentyFiveWeekSales = 0) then 0 when (twentyFourthWeekSales = 0 and twentyFiveWeekSales != 0) then 1 else twentyFiveWeekSales/twentyFourthWeekSales end, 2) as twentyFiveWeekRate,
        round(case when (twentyFiveWeekSales = 0 and twentySixWeekSales = 0) then 0 when (twentyFiveWeekSales = 0 and twentySixWeekSales != 0) then 1 else twentySixWeekSales/twentyFiveWeekSales end, 2) as twentySixWeekRate,
        round(case when (twentySixWeekSales = 0 and twentySeveneWeekSales = 0) then 0 when (twentySixWeekSales = 0 and twentySeveneWeekSales != 0) then 1 else twentySeveneWeekSales/twentySixWeekSales end, 2) as twentySeveneWeekRate,
        round(case when (twentySeveneWeekSales = 0 and twentyEightWeekSales = 0) then 0 when (twentySeveneWeekSales = 0 and twentyEightWeekSales != 0) then 1 else twentyEightWeekSales/twentySeveneWeekSales end, 2) as twentyEightWeekRate,
        round(case when (twentyEightWeekSales = 0 and twentyNineWeekSales = 0) then 0 when (twentyEightWeekSales = 0 and twentyNineWeekSales != 0) then 1 else twentyNineWeekSales/twentyEightWeekSales end, 2) as twentyNineWeekRate,
        round(case when (twentyNineWeekSales = 0 and thirtyWeekSales = 0) then 0 when (twentyNineWeekSales = 0 and thirtyWeekSales != 0) then 1 else thirtyWeekSales/twentyNineWeekSales end, 2) as thirtyWeekRate,
        round(case when (thirtyWeekSales = 0 and thirtyOneWeekSales = 0) then 0 when (thirtyWeekSales = 0 and thirtyOneWeekSales != 0) then 1 else thirtyOneWeekSales/thirtyWeekSales end, 2) as thirtyOneWeekRate,
        round(case when (thirtyOneWeekSales = 0 and thirtyTwoWeekSales = 0) then 0 when (thirtyOneWeekSales = 0 and thirtyTwoWeekSales != 0) then 1 else thirtyTwoWeekSales/thirtyOneWeekSales end, 2) as thirtyTwoWeekRate,
        round(case when (thirtyTwoWeekSales = 0 and thirtyThreeWeekSales = 0) then 0 when (thirtyTwoWeekSales = 0 and thirtyThreeWeekSales != 0) then 1 else thirtyThreeWeekSales/thirtyTwoWeekSales end, 2) as thirtyThreeWeekRate,
        round(case when (thirtyThreeWeekSales = 0 and thirtyFourthWeekSales = 0) then 0 when (thirtyThreeWeekSales = 0 and thirtyFourthWeekSales != 0) then 1 else thirtyFourthWeekSales/thirtyThreeWeekSales end, 2) as thirtyFourthWeekRate,
        round(case when (thirtyFourthWeekSales = 0 and thirtyFiveWeekSales = 0) then 0 when (thirtyFourthWeekSales = 0 and thirtyFiveWeekSales != 0) then 1 else thirtyFiveWeekSales/thirtyFourthWeekSales end, 2) as thirtyFiveWeekRate,
        round(case when (thirtyFiveWeekSales = 0 and thirtySixWeekSales = 0) then 0 when (thirtyFiveWeekSales = 0 and thirtySixWeekSales != 0) then 1 else thirtySixWeekSales/thirtyFiveWeekSales end, 2) as thirtySixWeekRate,
        round(case when (thirtySixWeekSales = 0 and thirtySeveneWeekSales = 0) then 0 when (thirtySixWeekSales = 0 and thirtySeveneWeekSales != 0) then 1 else thirtySeveneWeekSales/thirtySixWeekSales end, 2) as thirtySeveneWeekRate,
        round(case when (thirtySeveneWeekSales = 0 and thirtyEightWeekSales = 0) then 0 when (thirtySeveneWeekSales = 0 and thirtyEightWeekSales != 0) then 1 else thirtyEightWeekSales/thirtySeveneWeekSales end, 2) as thirtyEightWeekRate,
        round(case when (thirtyEightWeekSales = 0 and thirtyNineWeekSales = 0) then 0 when (thirtyEightWeekSales = 0 and thirtyNineWeekSales != 0) then 1 else thirtyNineWeekSales/thirtyEightWeekSales end, 2) as thirtyNineWeekRate,
        round(case when (thirtyNineWeekSales = 0 and fortyWeekSales = 0) then 0 when (thirtyNineWeekSales = 0 and fortyWeekSales != 0) then 1 else fortyWeekSales/thirtyNineWeekSales end, 2) as fortyWeekRate,
        round(case when (fortyWeekSales = 0 and fortyOneWeekSales = 0) then 0 when (fortyWeekSales = 0 and fortyOneWeekSales != 0) then 1 else fortyOneWeekSales/fortyWeekSales end, 2) as fortyOneWeekRate,
        round(case when (fortyOneWeekSales = 0 and fortyTwoWeekSales = 0) then 0 when (fortyOneWeekSales = 0 and fortyTwoWeekSales != 0) then 1 else fortyTwoWeekSales/fortyOneWeekSales end, 2) as fortyTwoWeekRate,
        round(case when (fortyTwoWeekSales = 0 and fortyThreeWeekSales = 0) then 0 when (fortyTwoWeekSales = 0 and fortyThreeWeekSales != 0) then 1 else fortyThreeWeekSales/fortyTwoWeekSales end, 2) as fortyThreeWeekRate,
        round(case when (fortyThreeWeekSales = 0 and fortyFourthWeekSales = 0) then 0 when (fortyThreeWeekSales = 0 and fortyFourthWeekSales != 0) then 1 else fortyFourthWeekSales/fortyThreeWeekSales end, 2) as fortyFourthWeekRate,
        round(case when (fortyFourthWeekSales = 0 and fortyFiveWeekSales = 0) then 0 when (fortyFourthWeekSales = 0 and fortyFiveWeekSales != 0) then 1 else fortyFiveWeekSales/fortyFourthWeekSales end, 2) as  fortyFiveWeekRate,
        round(case when (fortyFiveWeekSales = 0 and fortySixWeekSales = 0) then 0 when (fortyFiveWeekSales = 0 and fortySixWeekSales != 0) then 1 else fortySixWeekSales/fortyFiveWeekSales end, 2) as fortySixWeekRate,
        round(case when (fortySixWeekSales = 0 and fortySeveneWeekSales = 0) then 0 when (fortySixWeekSales = 0 and fortySeveneWeekSales != 0) then 1 else fortySeveneWeekSales/fortySixWeekSales end, 2) as fortySeveneWeekRate,
        round(case when (fortySeveneWeekSales = 0 and fortyEightWeekSales = 0) then 0 when (fortySeveneWeekSales = 0 and fortyEightWeekSales != 0) then 1 else fortyEightWeekSales/fortySeveneWeekSales end, 2) as fortyEightWeekRate,
        round(case when (fortyEightWeekSales = 0 and fortyNineWeekSales = 0) then 0 when (fortyEightWeekSales = 0 and fortyNineWeekSales != 0) then 1 else fortyNineWeekSales/fortyEightWeekSales end, 2) as fortyNineWeekRate,
        round(case when (fortyNineWeekSales = 0 and fiftyWeekSales = 0) then 0 when (fortyNineWeekSales = 0 and fiftyWeekSales != 0) then 1 else fiftyWeekSales/fortyNineWeekSales end, 2) as fiftyWeekRate,
        round(case when (fiftyWeekSales = 0 and fiftyOneWeekSales = 0) then 0 when (fiftyWeekSales = 0 and fiftyOneWeekSales != 0) then 1 else fiftyOneWeekSales/fiftyWeekSales end, 2) as fiftyOneWeekRate,
        round(case when (fiftyOneWeekSales = 0 and fiftyTwoWeekSales = 0) then 0 when (fiftyOneWeekSales = 0 and fiftyTwoWeekSales != 0) then 1 else fiftyTwoWeekSales/fiftyOneWeekSales end, 2) as fiftyTwoWeekRate,
        CONCAT_WS(
        ',',
        oneWeekSales,
        twoWeekSales,
        threeWeekSales,
        fourthWeekSales,
        fiveWeekSales,
        sixWeekSales,
        sevenWeekSales,
        eightWeekSales,
        nineWeekSales,
        tenWeekSales,
        elevenWeekSales,
        twelveWeekSales,
        thridteenWeekSales,
        fourteenWeekSales,
        fifteenWeekSales,
        sixteenWeekSales,
        seventeenWeekSales,
        eighteenWeekSales,
        nineteenWeekSales,
        twentyWeekSales,
        twentyOneWeekSales,
        twentyTwoWeekSales,
        twentyThreeWeekSales,
        twentyFourthWeekSales,
        twentyFiveWeekSales,
        twentySixWeekSales,
        twentySeveneWeekSales,
        twentyEightWeekSales,
        twentyNineWeekSales,
        thirtyWeekSales,
        thirtyOneWeekSales,
        thirtyTwoWeekSales,
        thirtyThreeWeekSales,
        thirtyFourthWeekSales,
        thirtyFiveWeekSales,
        thirtySixWeekSales,
        thirtySeveneWeekSales,
        thirtyEightWeekSales,
        thirtyNineWeekSales,
        fortyWeekSales,
        fortyOneWeekSales,
        fortyTwoWeekSales,
        fortyThreeWeekSales,
        fortyFourthWeekSales,
        fortyFiveWeekSales,
        fortySixWeekSales,
        fortySeveneWeekSales,
        fortyEightWeekSales,
        fortyNineWeekSales,
        fiftyWeekSales,
        fiftyOneWeekSales,
        fiftyTwoWeekSales
        ) AS 'salesDetail'
        from
        (select dc0.ProductCode bailun_sku, dc0.ShipWarehouseCode warehouse_code,
        sum(case when week(dc1.BjPayTime) = 1 then dc0.ProductShipCount else 0 end) as 'oneWeekSales',
        sum(case when week(dc1.BjPayTime) = 2 then dc0.ProductShipCount else 0 end) as 'twoWeekSales',
        sum(case when week(dc1.BjPayTime) = 3 then dc0.ProductShipCount else 0 end) as 'threeWeekSales',
        sum(case when week(dc1.BjPayTime) = 4 then dc0.ProductShipCount else 0 end) as 'fourthWeekSales',
        sum(case when week(dc1.BjPayTime) = 5 then dc0.ProductShipCount else 0 end) as 'fiveWeekSales',
        sum(case when week(dc1.BjPayTime) = 6 then dc0.ProductShipCount else 0 end) as 'sixWeekSales',
        sum(case when week(dc1.BjPayTime) = 7 then dc0.ProductShipCount else 0 end) as 'sevenWeekSales',
        sum(case when week(dc1.BjPayTime) = 8 then dc0.ProductShipCount else 0 end) as 'eightWeekSales',
        sum(case when week(dc1.BjPayTime) = 9 then dc0.ProductShipCount else 0 end) as 'nineWeekSales',
        sum(case when week(dc1.BjPayTime) = 10 then dc0.ProductShipCount else 0 end) as 'tenWeekSales',
        sum(case when week(dc1.BjPayTime) = 11 then dc0.ProductShipCount else 0 end) as 'elevenWeekSales',
        sum(case when week(dc1.BjPayTime) = 12 then dc0.ProductShipCount else 0 end) as 'twelveWeekSales',
        sum(case when week(dc1.BjPayTime) = 13 then dc0.ProductShipCount else 0 end) as 'thridteenWeekSales',
        sum(case when week(dc1.BjPayTime) = 14 then dc0.ProductShipCount else 0 end) as 'fourteenWeekSales',
        sum(case when week(dc1.BjPayTime) = 15 then dc0.ProductShipCount else 0 end) as 'fifteenWeekSales',
        sum(case when week(dc1.BjPayTime) = 16 then dc0.ProductShipCount else 0 end) as 'sixteenWeekSales',
        sum(case when week(dc1.BjPayTime) = 17 then dc0.ProductShipCount else 0 end) as 'seventeenWeekSales',
        sum(case when week(dc1.BjPayTime) = 18 then dc0.ProductShipCount else 0 end) as 'eighteenWeekSales',
        sum(case when week(dc1.BjPayTime) = 19 then dc0.ProductShipCount else 0 end) as 'nineteenWeekSales',
        sum(case when week(dc1.BjPayTime) = 20 then dc0.ProductShipCount else 0 end) as 'twentyWeekSales',
        sum(case when week(dc1.BjPayTime) = 21 then dc0.ProductShipCount else 0 end) as 'twentyOneWeekSales',
        sum(case when week(dc1.BjPayTime) = 22 then dc0.ProductShipCount else 0 end) as 'twentyTwoWeekSales',
        sum(case when week(dc1.BjPayTime) = 23 then dc0.ProductShipCount else 0 end) as 'twentyThreeWeekSales',
        sum(case when week(dc1.BjPayTime) = 24 then dc0.ProductShipCount else 0 end) as 'twentyFourthWeekSales',
        sum(case when week(dc1.BjPayTime) = 25 then dc0.ProductShipCount else 0 end) as 'twentyFiveWeekSales',
        sum(case when week(dc1.BjPayTime) = 26 then dc0.ProductShipCount else 0 end) as 'twentySixWeekSales',
        sum(case when week(dc1.BjPayTime) = 27 then dc0.ProductShipCount else 0 end) as 'twentySeveneWeekSales',
        sum(case when week(dc1.BjPayTime) = 28 then dc0.ProductShipCount else 0 end) as 'twentyEightWeekSales',
        sum(case when week(dc1.BjPayTime) = 29 then dc0.ProductShipCount else 0 end) as 'twentyNineWeekSales',
        sum(case when week(dc1.BjPayTime) = 30 then dc0.ProductShipCount else 0 end) as 'thirtyWeekSales',
        sum(case when week(dc1.BjPayTime) = 31 then dc0.ProductShipCount else 0 end) as 'thirtyOneWeekSales',
        sum(case when week(dc1.BjPayTime) = 32 then dc0.ProductShipCount else 0 end) as 'thirtyTwoWeekSales',
        sum(case when week(dc1.BjPayTime) = 33 then dc0.ProductShipCount else 0 end) as 'thirtyThreeWeekSales',
        sum(case when week(dc1.BjPayTime) = 34 then dc0.ProductShipCount else 0 end) as 'thirtyFourthWeekSales',
        sum(case when week(dc1.BjPayTime) = 35 then dc0.ProductShipCount else 0 end) as 'thirtyFiveWeekSales',
        sum(case when week(dc1.BjPayTime) = 36 then dc0.ProductShipCount else 0 end) as 'thirtySixWeekSales',
        sum(case when week(dc1.BjPayTime) = 37 then dc0.ProductShipCount else 0 end) as 'thirtySeveneWeekSales',
        sum(case when week(dc1.BjPayTime) = 38 then dc0.ProductShipCount else 0 end) as 'thirtyEightWeekSales',
        sum(case when week(dc1.BjPayTime) = 39 then dc0.ProductShipCount else 0 end) as 'thirtyNineWeekSales',
        sum(case when week(dc1.BjPayTime) = 40 then dc0.ProductShipCount else 0 end) as 'fortyWeekSales',
        sum(case when week(dc1.BjPayTime) = 41 then dc0.ProductShipCount else 0 end) as 'fortyOneWeekSales',
        sum(case when week(dc1.BjPayTime) = 42 then dc0.ProductShipCount else 0 end) as 'fortyTwoWeekSales',
        sum(case when week(dc1.BjPayTime) = 43 then dc0.ProductShipCount else 0 end) as 'fortyThreeWeekSales',
        sum(case when week(dc1.BjPayTime) = 44 then dc0.ProductShipCount else 0 end) as 'fortyFourthWeekSales',
        sum(case when week(dc1.BjPayTime) = 45 then dc0.ProductShipCount else 0 end) as 'fortyFiveWeekSales',
        sum(case when week(dc1.BjPayTime) = 46 then dc0.ProductShipCount else 0 end) as 'fortySixWeekSales',
        sum(case when week(dc1.BjPayTime) = 47 then dc0.ProductShipCount else 0 end) as 'fortySeveneWeekSales',
        sum(case when week(dc1.BjPayTime) = 48 then dc0.ProductShipCount else 0 end) as 'fortyEightWeekSales',
        sum(case when week(dc1.BjPayTime) = 49 then dc0.ProductShipCount else 0 end) as 'fortyNineWeekSales',
        sum(case when week(dc1.BjPayTime) = 50 then dc0.ProductShipCount else 0 end) as 'fiftyWeekSales',
        sum(case when week(dc1.BjPayTime) = 51 then dc0.ProductShipCount else 0 end) as 'fiftyOneWeekSales',
        sum(case when week(dc1.BjPayTime) = 52 then dc0.ProductShipCount else 0 end) as 'fiftyTwoWeekSales'
        FROM t_order_product_bk1906061724 dc0 join t_order_original_bk1906061724 dc1
        on dc0.OrderNo = dc1.OrderNoSystem
        where dc1.BjPayTime &gt;= '2018-01-01 00:00:00' and dc1.BjPayTime &lt;= '2018-12-31 23:59:59' and dc1.OrderStatus != '已取消'
        and dc0.IsDelete = 0 and dc1.InterceptStatus = 0
        <if test="bailunSku != null and bailunSku != ''">
            and bailun_sku = #{bailunSku}
        </if>
        and dc0.ShipWarehouseCode = #{warehouseCode})sales_table)sales_table1
    </select>-->

    <select id="getPlatformHistorySales" resultType="com.bailuntec.domain.dto.SalesVolumeAvgDTO">
        SELECT sum(CASE
                       WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)) THEN bailun_sku_quantity_ordered
                       ELSE 0 END) AS 'sevenday_sales',
               sum(CASE
                       WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 14 DAY)) THEN bailun_sku_quantity_ordered
                       ELSE 0 END) AS 'fourteenday_sales',
               sum(CASE
                       WHEN (paid_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)) THEN bailun_sku_quantity_ordered
                       ELSE 0 END) AS 'thirtyday_sales'
        FROM dc_base_oms_sku_30
        WHERE platform_type = #{platform}
          AND bailun_sku = #{bailunSku,jdbcType=VARCHAR}
          AND warehouse_code = #{warehouseCode,jdbcType=VARCHAR}
          AND paid_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
          AND paid_time &lt; CURDATE()
          AND bailun_order_status != 'Canceled'
          AND has_delete = 0
          AND has_scalp = 0
          AND has_buyer_remark = 0
          AND has_platsku_remark = 0
          AND has_fba_s = 0
          AND has_innersale = 0
    </select>
</mapper>
