“KP工作台数据漏斗”的版本间的差异

来自qingwei personal wiki
跳转至: 导航搜索
展现的条目
sql
第17行: 第17行:
 
     uv_1d_169,
 
     uv_1d_169,
 
     fb_cnt_1d_013,
 
     fb_cnt_1d_013,
     fst_reply_rate_1m_003
+
     fst_reply_rate_1m_003,
 +
    terminal_type
 
FROM
 
FROM
 
     dwp_en_dm_comp_term_catelv2_eff_d
 
     dwp_en_dm_comp_term_catelv2_eff_d
 
where
 
where
     stat_date>="2018-10-8"
+
     ( stat_date="2018-10-8"
    and stat_date<="2018-10-9"
+
      or stat_date="2018-10-9" )
    and statistic_type="ALL"
 
 
     and admin_mbr_seq="14"
 
     and admin_mbr_seq="14"
    and terminal_type="PC"
 
 
     and is_main_cate="Y"
 
     and is_main_cate="Y"
 
     and cate_lv2_id=100010695
 
     and cate_lv2_id=100010695
 
</source>
 
</source>
 +
 
=== 展现的条目 ===
 
=== 展现的条目 ===
 
*  (投)---  未加工(投的钱)
 
*  (投)---  未加工(投的钱)

2018年11月12日 (一) 11:53的版本

描述

aone

aone

RPC接口

接口

需求

接口

external/kpwork/overview

sql

  • terminal_type: PC, TOTAL, WS
SELECT
    stat_date,
    imps_cnt_1d_027,
    clk_cnt_1d_092,
    uv_1d_169,
    fb_cnt_1d_013,
    fst_reply_rate_1m_003,
    terminal_type
FROM
    dwp_en_dm_comp_term_catelv2_eff_d
where
    ( stat_date="2018-10-8"
      or stat_date="2018-10-9" )
    and admin_mbr_seq="14"
    and is_main_cate="Y"
    and cate_lv2_id=100010695

展现的条目

  • (投)--- 未加工(投的钱)
  • (曝)imps_cnt_1d_027  : 最近1天排除联盟的搜索item和p4p商品曝光量
  • (访)uv_1d_169  : 最近1天访客数
  • (点)clk_cnt_1d_092 : 最近1天排除联盟的搜索item和p4p商品相关点击次数
  • (反)fb_cnt_1d_013  : 最近1天有效MC询盘数
  • (?)fst_reply_rate_1m_003: 最近30天及时回复率

oneService

参数

  • statDate (根据statisticsType校验,返回相应错误) 
  • terminalType
  • statisticsType
  • adminMemberSeq

SQL配置

  • external.kpwork.overview
select
    ${returnFields}    
from
    <if test='statisticsType == "day"'> 
        dwp_en_dm_comp_term_catelv2_eff_d
    </if>  
    <if test='statisticsType == "week"'> 
        dwp_en_dm_comp_term_catelv2_eff_w
    </if>
    <if test='statisticsType == "month"'> 
        dwp_en_dm_comp_term_catelv2_eff_m
    </if>         
where
    ( stat_date = #{statDate} 
       or stat_date = #{prevDate} )
    and admin_mbr_seq = #{adminMemberSeq}
    and terminal_type = #{terminalType}
    and is_main_cate = #{isMainCate}
    and cate_lv2_id = #{cateLv2Id}

java脚本

  • 计算前一天/周/月
import java.text.SimpleDateFormat;
import org.apache.commons.lang.time.DateUtils;


SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date statDate = new Date(sdf.parse(statDateStr).getTime());
Date prevDate = statDate;
if ("day".equalsIgnoreCase(statisticsType)) {
    prevDate = DateUtils.addDays(statDate, -1);
} else if ("week".equalsIgnoreCase(statisticsType)) {
    prevDate = DateUtils.addWeeks(statDate, -1);
} else if ("month".equalsIgnoreCase(statisticsType)) {
    prevDate = DateUtils.addMonths(statDate, -1);
}

return sdf.format(prevDate);