<?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="cn.superdesk.uniorder.dao.mapper.marketing.UnifiedStatisticsVirtDimDayMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDay">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="virt_id" jdbcType="BIGINT" property="virtId" />
    <result column="s_year" jdbcType="INTEGER" property="sYear" />
    <result column="s_month" jdbcType="INTEGER" property="sMonth" />
    <result column="s_day" jdbcType="INTEGER" property="sDay" />
    <result column="payable_amount" jdbcType="DECIMAL" property="payableAmount" />
    <result column="quantity" jdbcType="INTEGER" property="quantity" />
    <result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
    <result column="order_cost_amount" jdbcType="DECIMAL" property="orderCostAmount" />
    <result column="order_transport_amount" jdbcType="DECIMAL" property="orderTransportAmount" />
    <result column="order_refund_amount" jdbcType="DECIMAL" property="orderRefundAmount" />
    <result column="order_refund_cost_amount" jdbcType="DECIMAL" property="orderRefundCostAmount" />
    <result column="goods_amount" jdbcType="DECIMAL" property="goodsAmount" />
    <result column="goods_cost_amount" jdbcType="DECIMAL" property="goodsCostAmount" />
    <result column="goods_transport_amount" jdbcType="DECIMAL" property="goodsTransportAmount" />
    <result column="goods_refund_amount" jdbcType="DECIMAL" property="goodsRefundAmount" />
    <result column="goods_refund_cost_amount" jdbcType="DECIMAL" property="goodsRefundCostAmount" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, service_no, virt_id, s_year, s_month, s_day, payable_amount, quantity, order_amount, 
    order_cost_amount, order_transport_amount, order_refund_amount, order_refund_cost_amount, 
    goods_amount, goods_cost_amount, goods_transport_amount, goods_refund_amount, goods_refund_cost_amount, 
    create_time, create_user_id, update_time, update_user_id
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDayExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from unified_statistics_virt_dim_day
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from unified_statistics_virt_dim_day
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from unified_statistics_virt_dim_day
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDayExample">
    delete from unified_statistics_virt_dim_day
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDay">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_statistics_virt_dim_day (service_no, virt_id, s_year, 
      s_month, s_day, payable_amount, 
      quantity, order_amount, order_cost_amount, 
      order_transport_amount, order_refund_amount, 
      order_refund_cost_amount, goods_amount, goods_cost_amount, 
      goods_transport_amount, goods_refund_amount, 
      goods_refund_cost_amount, create_time, create_user_id, 
      update_time, update_user_id)
    values (#{serviceNo,jdbcType=VARCHAR}, #{virtId,jdbcType=BIGINT}, #{sYear,jdbcType=INTEGER}, 
      #{sMonth,jdbcType=INTEGER}, #{sDay,jdbcType=INTEGER}, #{payableAmount,jdbcType=DECIMAL}, 
      #{quantity,jdbcType=INTEGER}, #{orderAmount,jdbcType=DECIMAL}, #{orderCostAmount,jdbcType=DECIMAL}, 
      #{orderTransportAmount,jdbcType=DECIMAL}, #{orderRefundAmount,jdbcType=DECIMAL}, 
      #{orderRefundCostAmount,jdbcType=DECIMAL}, #{goodsAmount,jdbcType=DECIMAL}, #{goodsCostAmount,jdbcType=DECIMAL}, 
      #{goodsTransportAmount,jdbcType=DECIMAL}, #{goodsRefundAmount,jdbcType=DECIMAL}, 
      #{goodsRefundCostAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDay">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into unified_statistics_virt_dim_day
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="virtId != null">
        virt_id,
      </if>
      <if test="sYear != null">
        s_year,
      </if>
      <if test="sMonth != null">
        s_month,
      </if>
      <if test="sDay != null">
        s_day,
      </if>
      <if test="payableAmount != null">
        payable_amount,
      </if>
      <if test="quantity != null">
        quantity,
      </if>
      <if test="orderAmount != null">
        order_amount,
      </if>
      <if test="orderCostAmount != null">
        order_cost_amount,
      </if>
      <if test="orderTransportAmount != null">
        order_transport_amount,
      </if>
      <if test="orderRefundAmount != null">
        order_refund_amount,
      </if>
      <if test="orderRefundCostAmount != null">
        order_refund_cost_amount,
      </if>
      <if test="goodsAmount != null">
        goods_amount,
      </if>
      <if test="goodsCostAmount != null">
        goods_cost_amount,
      </if>
      <if test="goodsTransportAmount != null">
        goods_transport_amount,
      </if>
      <if test="goodsRefundAmount != null">
        goods_refund_amount,
      </if>
      <if test="goodsRefundCostAmount != null">
        goods_refund_cost_amount,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="virtId != null">
        #{virtId,jdbcType=BIGINT},
      </if>
      <if test="sYear != null">
        #{sYear,jdbcType=INTEGER},
      </if>
      <if test="sMonth != null">
        #{sMonth,jdbcType=INTEGER},
      </if>
      <if test="sDay != null">
        #{sDay,jdbcType=INTEGER},
      </if>
      <if test="payableAmount != null">
        #{payableAmount,jdbcType=DECIMAL},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="orderAmount != null">
        #{orderAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderCostAmount != null">
        #{orderCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderTransportAmount != null">
        #{orderTransportAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderRefundAmount != null">
        #{orderRefundAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderRefundCostAmount != null">
        #{orderRefundCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsAmount != null">
        #{goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsCostAmount != null">
        #{goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsTransportAmount != null">
        #{goodsTransportAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsRefundAmount != null">
        #{goodsRefundAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsRefundCostAmount != null">
        #{goodsRefundCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDayExample" resultType="java.lang.Long">
    select count(*) from unified_statistics_virt_dim_day
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update unified_statistics_virt_dim_day
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.virtId != null">
        virt_id = #{record.virtId,jdbcType=BIGINT},
      </if>
      <if test="record.sYear != null">
        s_year = #{record.sYear,jdbcType=INTEGER},
      </if>
      <if test="record.sMonth != null">
        s_month = #{record.sMonth,jdbcType=INTEGER},
      </if>
      <if test="record.sDay != null">
        s_day = #{record.sDay,jdbcType=INTEGER},
      </if>
      <if test="record.payableAmount != null">
        payable_amount = #{record.payableAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.quantity != null">
        quantity = #{record.quantity,jdbcType=INTEGER},
      </if>
      <if test="record.orderAmount != null">
        order_amount = #{record.orderAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.orderCostAmount != null">
        order_cost_amount = #{record.orderCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.orderTransportAmount != null">
        order_transport_amount = #{record.orderTransportAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.orderRefundAmount != null">
        order_refund_amount = #{record.orderRefundAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.orderRefundCostAmount != null">
        order_refund_cost_amount = #{record.orderRefundCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsAmount != null">
        goods_amount = #{record.goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsCostAmount != null">
        goods_cost_amount = #{record.goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsTransportAmount != null">
        goods_transport_amount = #{record.goodsTransportAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsRefundAmount != null">
        goods_refund_amount = #{record.goodsRefundAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.goodsRefundCostAmount != null">
        goods_refund_cost_amount = #{record.goodsRefundCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update unified_statistics_virt_dim_day
    set id = #{record.id,jdbcType=BIGINT},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      virt_id = #{record.virtId,jdbcType=BIGINT},
      s_year = #{record.sYear,jdbcType=INTEGER},
      s_month = #{record.sMonth,jdbcType=INTEGER},
      s_day = #{record.sDay,jdbcType=INTEGER},
      payable_amount = #{record.payableAmount,jdbcType=DECIMAL},
      quantity = #{record.quantity,jdbcType=INTEGER},
      order_amount = #{record.orderAmount,jdbcType=DECIMAL},
      order_cost_amount = #{record.orderCostAmount,jdbcType=DECIMAL},
      order_transport_amount = #{record.orderTransportAmount,jdbcType=DECIMAL},
      order_refund_amount = #{record.orderRefundAmount,jdbcType=DECIMAL},
      order_refund_cost_amount = #{record.orderRefundCostAmount,jdbcType=DECIMAL},
      goods_amount = #{record.goodsAmount,jdbcType=DECIMAL},
      goods_cost_amount = #{record.goodsCostAmount,jdbcType=DECIMAL},
      goods_transport_amount = #{record.goodsTransportAmount,jdbcType=DECIMAL},
      goods_refund_amount = #{record.goodsRefundAmount,jdbcType=DECIMAL},
      goods_refund_cost_amount = #{record.goodsRefundCostAmount,jdbcType=DECIMAL},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDay">
    update unified_statistics_virt_dim_day
    <set>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="virtId != null">
        virt_id = #{virtId,jdbcType=BIGINT},
      </if>
      <if test="sYear != null">
        s_year = #{sYear,jdbcType=INTEGER},
      </if>
      <if test="sMonth != null">
        s_month = #{sMonth,jdbcType=INTEGER},
      </if>
      <if test="sDay != null">
        s_day = #{sDay,jdbcType=INTEGER},
      </if>
      <if test="payableAmount != null">
        payable_amount = #{payableAmount,jdbcType=DECIMAL},
      </if>
      <if test="quantity != null">
        quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="orderAmount != null">
        order_amount = #{orderAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderCostAmount != null">
        order_cost_amount = #{orderCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderTransportAmount != null">
        order_transport_amount = #{orderTransportAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderRefundAmount != null">
        order_refund_amount = #{orderRefundAmount,jdbcType=DECIMAL},
      </if>
      <if test="orderRefundCostAmount != null">
        order_refund_cost_amount = #{orderRefundCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsAmount != null">
        goods_amount = #{goodsAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsCostAmount != null">
        goods_cost_amount = #{goodsCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsTransportAmount != null">
        goods_transport_amount = #{goodsTransportAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsRefundAmount != null">
        goods_refund_amount = #{goodsRefundAmount,jdbcType=DECIMAL},
      </if>
      <if test="goodsRefundCostAmount != null">
        goods_refund_cost_amount = #{goodsRefundCostAmount,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirtDimDay">
    update unified_statistics_virt_dim_day
    set service_no = #{serviceNo,jdbcType=VARCHAR},
      virt_id = #{virtId,jdbcType=BIGINT},
      s_year = #{sYear,jdbcType=INTEGER},
      s_month = #{sMonth,jdbcType=INTEGER},
      s_day = #{sDay,jdbcType=INTEGER},
      payable_amount = #{payableAmount,jdbcType=DECIMAL},
      quantity = #{quantity,jdbcType=INTEGER},
      order_amount = #{orderAmount,jdbcType=DECIMAL},
      order_cost_amount = #{orderCostAmount,jdbcType=DECIMAL},
      order_transport_amount = #{orderTransportAmount,jdbcType=DECIMAL},
      order_refund_amount = #{orderRefundAmount,jdbcType=DECIMAL},
      order_refund_cost_amount = #{orderRefundCostAmount,jdbcType=DECIMAL},
      goods_amount = #{goodsAmount,jdbcType=DECIMAL},
      goods_cost_amount = #{goodsCostAmount,jdbcType=DECIMAL},
      goods_transport_amount = #{goodsTransportAmount,jdbcType=DECIMAL},
      goods_refund_amount = #{goodsRefundAmount,jdbcType=DECIMAL},
      goods_refund_cost_amount = #{goodsRefundCostAmount,jdbcType=DECIMAL},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>