DatavMapper.xml 6.19 KB
<?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.glsk.mapper.DatavMapper">
  <resultMap id="BaseResultMap" type="com.glsk.entity.MemberOrderMonthly">

    <result column="stat_month" jdbcType="VARCHAR" property="statMonth" />
    <result column="module_name" jdbcType="VARCHAR" property="moduleName" />
    <result column="order_num" jdbcType="INTEGER" property="orderNum" />
    <result column="price_monthly" jdbcType="DOUBLE" property="priceMonthly" />
    <result column="aver_price_monthly" jdbcType="DOUBLE" property="averPriceMonthly" />
  </resultMap>


  <!-- 自定义SQL语句 -->
  <select id="sqlBySelf" resultType="map" parameterType="java.lang.String" >
    ${_parameter}
  </select>


  <insert id="batchInsertOrUpdateStaffStaticData" parameterType="com.glsk.entity.StaffStaticData">
    insert into business_analysis_staff(
    stat_date,staff_id,staff_name,staff_phone,merchant_id,merchant_name,business_type,output,ordernum,
    total_ordernum,to_store,aftersales_to_store,buynum,finishday,totalday,targetzhuanhualv,targetatv,targetstartday,targetendday,check_month_period,
    daily_contribution_traffic,created_date
    ) values (
    #{stat_date},#{staff_id},#{staff_name},#{staff_phone},#{merchant_id},#{merchant_name},#{business_type},#{output},#{ordernum},#{total_ordernum},
    #{to_store},#{aftersales_to_store},#{buynum},#{finishday},#{totalday},#{targetzhuanhualv},#{targetatv},#{targetstartday},#{targetendday},
    #{check_month_period},#{daily_contribution_traffic},#{created_date}
    )
    ON DUPLICATE KEY UPDATE
    stat_date=#{stat_date},
    staff_id=#{staff_id},
    staff_name=#{staff_name},
    staff_phone=#{staff_phone},
    merchant_id=#{merchant_id},
    merchant_name=#{merchant_name},
    business_type=#{business_type},
    output=#{output},
    ordernum=#{ordernum},
    total_ordernum=#{total_ordernum},
    to_store=#{to_store},
    aftersales_to_store=#{aftersales_to_store},
    buynum=#{buynum},
    finishday=#{finishday},
    totalday=#{totalday},
    targetzhuanhualv=#{targetzhuanhualv},
    targetatv=#{targetatv},
    targetstartday=#{targetstartday},
    targetendday=#{targetendday},
    check_month_period=#{check_month_period},
    daily_contribution_traffic=#{daily_contribution_traffic},
    created_date=#{created_date}
  </insert>


    <insert id="batchInsertOrUpdateMerchantStaticData" parameterType="com.glsk.entity.MerchantStaticData">
    insert into business_analysis_overview(
    stat_date,merchant_id,merchant_name,business_type,item_name,output,ordernum,
    total_ordernum,to_store,aftersales_to_store,buynum,created_date
    ) values (
    #{stat_date},#{merchant_id},#{merchant_name},#{business_type},#{item_name},#{output},#{ordernum},#{total_ordernum},
    #{to_store},#{aftersales_to_store},#{buynum},#{created_date}
    )
    ON DUPLICATE KEY UPDATE
    stat_date=#{stat_date},
    merchant_id=#{merchant_id},
    merchant_name=#{merchant_name},
    business_type=#{business_type},
    item_name=#{item_name},
    output=#{output},
    ordernum=#{ordernum},
    total_ordernum=#{total_ordernum},
    to_store=#{to_store},
    aftersales_to_store=#{aftersales_to_store},
    buynum=#{buynum},
    created_date=#{created_date}
  </insert>


  <insert id="batchInsertOrUpdateMerchantStaticDatatmp" parameterType="com.glsk.entity.MerchantStaticData">
    insert into business_analysis_overview_tmp(
    stat_date,merchant_id,merchant_name,business_type,item_name,output,ordernum,
    total_ordernum,to_store,aftersales_to_store,buynum,created_date
    ) values (
    #{stat_date},#{merchant_id},#{merchant_name},#{business_type},#{item_name},#{output},#{ordernum},#{total_ordernum},
    #{to_store},#{aftersales_to_store},#{buynum},#{created_date}
    )
    ON DUPLICATE KEY UPDATE
    stat_date=#{stat_date},
    merchant_id=#{merchant_id},
    merchant_name=#{merchant_name},
    business_type=#{business_type},
    item_name=#{item_name},
    output=#{output},
    ordernum=#{ordernum},
    total_ordernum=#{total_ordernum},
    to_store=#{to_store},
    aftersales_to_store=#{aftersales_to_store},
    buynum=#{buynum},
    created_date=#{created_date}
  </insert>


  <insert id="batchInsertOrUpdateEmployeeFlowData" parameterType="com.glsk.entity.EmployeeFlowData">
    insert into business_analysis_employee_flow(
    stat_date,staff_id,staff_name,staff_phone,merchant_id,merchant_name,business_type,ordernum,
    total_ordernum,daily_contribution_traffic,created_date
    ) values (
    #{stat_date},#{staff_id},#{staff_name},#{staff_phone},#{merchant_id},#{merchant_name},#{business_type},#{ordernum},
    #{total_ordernum},#{daily_contribution_traffic},#{created_date}
    )
    ON DUPLICATE KEY UPDATE
    stat_date=#{stat_date},
    staff_id=#{staff_id},
    staff_name=#{staff_name},
    staff_phone=#{staff_phone},
    merchant_id=#{merchant_id},
    merchant_name=#{merchant_name},
    business_type=#{business_type},
    ordernum=#{ordernum},
    total_ordernum=#{total_ordernum},
    daily_contribution_traffic=#{daily_contribution_traffic},
    created_date=#{created_date}
  </insert>




  <insert id="batchInsertOrUpdateStaffToStoreData" parameterType="com.glsk.entity.StaffToStoreData">
    insert into business_analysis_staff_tostore(
    stat_date,staff_id,merchant_id,business_type,to_store,aftersales_to_store,buynum,created_date
    ) values (
    #{stat_date},#{staff_id},#{merchant_id},#{business_type},
    #{to_store},#{aftersales_to_store},#{buynum},#{created_date}
    )
    ON DUPLICATE KEY UPDATE
    stat_date=#{stat_date},
    staff_id=#{staff_id},
    merchant_id=#{merchant_id},
    business_type=#{business_type},
    to_store=#{to_store},
    aftersales_to_store=#{aftersales_to_store},
    buynum=#{buynum},
    created_date=#{created_date}
  </insert>

  <insert id="batchInsertOrUpdateMerchantBuyNum" parameterType="com.glsk.entity.MerchantBuyNum">
    insert into business_analysis_merchant_buynum(
    stat_date,merchant_id,buynum,created_date
    ) values (
    #{stat_date},#{merchant_id},#{buynum},#{created_date}
    )
    ON DUPLICATE KEY UPDATE
    stat_date=#{stat_date},
    merchant_id=#{merchant_id},
    buynum=#{buynum},
    created_date=#{created_date}
  </insert>



</mapper>