<?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.DcAutoJitTagLogMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcAutoJitTagLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="bailun_sku" jdbcType="VARCHAR" property="bailunSku" />
    <result column="date" jdbcType="DATE" property="date" />
    <result column="tag_id" jdbcType="INTEGER" property="tagId" />
    <result column="tag_json" jdbcType="VARCHAR" property="tagJson" />
    <result column="quantity_sales7" jdbcType="DECIMAL" property="quantitySales7" />
    <result column="quantity_sales14" jdbcType="DECIMAL" property="quantitySales14" />
    <result column="quantity_sales30" jdbcType="DECIMAL" property="quantitySales30" />
  </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, bailun_sku, date, tag_id, tag_json, quantity_sales7, quantity_sales14, quantity_sales30
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcAutoJitTagLogExample" 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_jit_tag_log
    <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_jit_tag_log
    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_jit_tag_log
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcAutoJitTagLogExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_auto_jit_tag_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcAutoJitTagLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_auto_jit_tag_log (id, bailun_sku, date, 
      tag_id, tag_json, quantity_sales7, 
      quantity_sales14, quantity_sales30)
    values (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{date,jdbcType=DATE}, 
      #{tagId,jdbcType=INTEGER}, #{tagJson,jdbcType=VARCHAR}, #{quantitySales7,jdbcType=DECIMAL}, 
      #{quantitySales14,jdbcType=DECIMAL}, #{quantitySales30,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcAutoJitTagLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_auto_jit_tag_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="date != null">
        date,
      </if>
      <if test="tagId != null">
        tag_id,
      </if>
      <if test="tagJson != null">
        tag_json,
      </if>
      <if test="quantitySales7 != null">
        quantity_sales7,
      </if>
      <if test="quantitySales14 != null">
        quantity_sales14,
      </if>
      <if test="quantitySales30 != null">
        quantity_sales30,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="date != null">
        #{date,jdbcType=DATE},
      </if>
      <if test="tagId != null">
        #{tagId,jdbcType=INTEGER},
      </if>
      <if test="tagJson != null">
        #{tagJson,jdbcType=VARCHAR},
      </if>
      <if test="quantitySales7 != null">
        #{quantitySales7,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales14 != null">
        #{quantitySales14,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales30 != null">
        #{quantitySales30,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcAutoJitTagLogExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_auto_jit_tag_log
    <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_jit_tag_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.bailunSku != null">
        bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="record.date != null">
        date = #{record.date,jdbcType=DATE},
      </if>
      <if test="record.tagId != null">
        tag_id = #{record.tagId,jdbcType=INTEGER},
      </if>
      <if test="record.tagJson != null">
        tag_json = #{record.tagJson,jdbcType=VARCHAR},
      </if>
      <if test="record.quantitySales7 != null">
        quantity_sales7 = #{record.quantitySales7,jdbcType=DECIMAL},
      </if>
      <if test="record.quantitySales14 != null">
        quantity_sales14 = #{record.quantitySales14,jdbcType=DECIMAL},
      </if>
      <if test="record.quantitySales30 != null">
        quantity_sales30 = #{record.quantitySales30,jdbcType=DECIMAL},
      </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_jit_tag_log
    set id = #{record.id,jdbcType=INTEGER},
      bailun_sku = #{record.bailunSku,jdbcType=VARCHAR},
      date = #{record.date,jdbcType=DATE},
      tag_id = #{record.tagId,jdbcType=INTEGER},
      tag_json = #{record.tagJson,jdbcType=VARCHAR},
      quantity_sales7 = #{record.quantitySales7,jdbcType=DECIMAL},
      quantity_sales14 = #{record.quantitySales14,jdbcType=DECIMAL},
      quantity_sales30 = #{record.quantitySales30,jdbcType=DECIMAL}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcAutoJitTagLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_auto_jit_tag_log
    <set>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="date != null">
        date = #{date,jdbcType=DATE},
      </if>
      <if test="tagId != null">
        tag_id = #{tagId,jdbcType=INTEGER},
      </if>
      <if test="tagJson != null">
        tag_json = #{tagJson,jdbcType=VARCHAR},
      </if>
      <if test="quantitySales7 != null">
        quantity_sales7 = #{quantitySales7,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales14 != null">
        quantity_sales14 = #{quantitySales14,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales30 != null">
        quantity_sales30 = #{quantitySales30,jdbcType=DECIMAL},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcAutoJitTagLog">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_auto_jit_tag_log
    set bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      date = #{date,jdbcType=DATE},
      tag_id = #{tagId,jdbcType=INTEGER},
      tag_json = #{tagJson,jdbcType=VARCHAR},
      quantity_sales7 = #{quantitySales7,jdbcType=DECIMAL},
      quantity_sales14 = #{quantitySales14,jdbcType=DECIMAL},
      quantity_sales30 = #{quantitySales30,jdbcType=DECIMAL}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcAutoJitTagLog">
    <!--
      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_jit_tag_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="bailunSku != null">
        bailun_sku,
      </if>
      <if test="date != null">
        date,
      </if>
      <if test="tagId != null">
        tag_id,
      </if>
      <if test="tagJson != null">
        tag_json,
      </if>
      <if test="quantitySales7 != null">
        quantity_sales7,
      </if>
      <if test="quantitySales14 != null">
        quantity_sales14,
      </if>
      <if test="quantitySales30 != null">
        quantity_sales30,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="date != null">
        #{date,jdbcType=DATE},
      </if>
      <if test="tagId != null">
        #{tagId,jdbcType=INTEGER},
      </if>
      <if test="tagJson != null">
        #{tagJson,jdbcType=VARCHAR},
      </if>
      <if test="quantitySales7 != null">
        #{quantitySales7,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales14 != null">
        #{quantitySales14,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales30 != null">
        #{quantitySales30,jdbcType=DECIMAL},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="bailunSku != null">
        bailun_sku = #{bailunSku,jdbcType=VARCHAR},
      </if>
      <if test="date != null">
        date = #{date,jdbcType=DATE},
      </if>
      <if test="tagId != null">
        tag_id = #{tagId,jdbcType=INTEGER},
      </if>
      <if test="tagJson != null">
        tag_json = #{tagJson,jdbcType=VARCHAR},
      </if>
      <if test="quantitySales7 != null">
        quantity_sales7 = #{quantitySales7,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales14 != null">
        quantity_sales14 = #{quantitySales14,jdbcType=DECIMAL},
      </if>
      <if test="quantitySales30 != null">
        quantity_sales30 = #{quantitySales30,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcAutoJitTagLog">
    <!--
      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_jit_tag_log
    (id, bailun_sku, date, tag_id, tag_json, quantity_sales7, quantity_sales14, quantity_sales30
      )
    values
    (#{id,jdbcType=INTEGER}, #{bailunSku,jdbcType=VARCHAR}, #{date,jdbcType=DATE}, #{tagId,jdbcType=INTEGER}, 
      #{tagJson,jdbcType=VARCHAR}, #{quantitySales7,jdbcType=DECIMAL}, #{quantitySales14,jdbcType=DECIMAL}, 
      #{quantitySales30,jdbcType=DECIMAL})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    bailun_sku = #{bailunSku,jdbcType=VARCHAR}, 
    date = #{date,jdbcType=DATE}, 
    tag_id = #{tagId,jdbcType=INTEGER}, 
    tag_json = #{tagJson,jdbcType=VARCHAR}, 
    quantity_sales7 = #{quantitySales7,jdbcType=DECIMAL}, 
    quantity_sales14 = #{quantitySales14,jdbcType=DECIMAL}, 
    quantity_sales30 = #{quantitySales30,jdbcType=DECIMAL}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcAutoJitTagLogExample" 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_jit_tag_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>