yumeng il y a 4 ans
Parent
commit
b63986c5c8

+ 19 - 13
jeecg-boot-base-common/src/main/java/org/jeecg/common/constant/AccountReportConstants.java

@@ -6,18 +6,20 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- *  Created by JQ.bi on 2020.5.30
+ * Created by JQ.bi on 2020.5.30
  */
 public class AccountReportConstants {
 
     /**
      * 私有构造器
      */
-    private AccountReportConstants(){
+    private AccountReportConstants() {
 
     }
 
-    /** 单体实例 */
+    /**
+     * 单体实例
+     */
     private static AccountReportConstants instance;
 
     /**
@@ -34,22 +36,26 @@ public class AccountReportConstants {
      * 字典数据
      */
     //头条字段映射
-    public static Map<String, Map<String,Object>> dicMapBy = new HashMap<>();
+    public static Map<String, Map<String, Object>> dicMapBy = new HashMap<>();
     //快手字段映射
-    public static Map<String, Map<String,Object>> dicMapKs = new HashMap<>();
+    public static Map<String, Map<String, Object>> dicMapKs = new HashMap<>();
     //头条视频报表字段映射
-    public static Map<String, Map<String,Object>> dicMapByVideo= new HashMap<>();
+    public static Map<String, Map<String, Object>> dicMapByVideo = new HashMap<>();
+    public static Map<String, Map<String, Object>> kuaishouVideoReportMap = new HashMap<>();
+
     /**
      * 初始化字典
      */
-    public void init(){
+    public void init() {
         //加载json文件
-        Object jsonBy=JsonResourceUtil.getJsonObjFromResource("/json_template/bytedance_filed_mapping.json");
-        Object jsonKs=JsonResourceUtil.getJsonObjFromResource("/json_template/kuaishou_filed_mapping.json");
-        Object jsonByVideo=JsonResourceUtil.getJsonObjFromResource("/json_template/bytedance_video_report_mapping.json");
+        Object jsonBy = JsonResourceUtil.getJsonObjFromResource("/json_template/bytedance_filed_mapping.json");
+        Object jsonKs = JsonResourceUtil.getJsonObjFromResource("/json_template/kuaishou_filed_mapping.json");
+        Object KuaiShouVideoJson = JsonResourceUtil.getJsonObjFromResource("/json_template/kuaishou_video_report_filed_mapping.json");
+        Object jsonByVideo = JsonResourceUtil.getJsonObjFromResource("/json_template/bytedance_video_report_mapping.json");
         //json 转为map存为静态常量
-        dicMapBy=JsonResourceUtil.jsonToMap(jsonBy);
-        dicMapKs=JsonResourceUtil.jsonToMap(jsonKs);
-        dicMapByVideo=JsonResourceUtil.jsonToMap(jsonByVideo);
+        dicMapBy = JsonResourceUtil.jsonToMap(jsonBy);
+        dicMapKs = JsonResourceUtil.jsonToMap(jsonKs);
+        dicMapByVideo = JsonResourceUtil.jsonToMap(jsonByVideo);
+        kuaishouVideoReportMap = JsonResourceUtil.jsonToMap(KuaiShouVideoJson);
     }
 }

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -190,6 +190,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ai/aiKuaiShouAppInfo/*", "anon");
         filterChainDefinitionMap.put("/explore/*", "anon");
         filterChainDefinitionMap.put("/ai/batchUpdate/*", "anon");
+        filterChainDefinitionMap.put("/ctop/kuaishou/videoReport/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

+ 4 - 4
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8080
+  port: 8081
   tomcat:
     max-swallow-size: -1
   servlet:
@@ -135,9 +135,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.151.174:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true
-          username: hcst
-          password: hcst@2020
+          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true
+          username: data
+          password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           #multi-datasource1:

+ 9 - 9
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsVideoReportCtrl.java

@@ -45,7 +45,6 @@ public class KsVideoReportCtrl {
             if (Check.isNull(requestBody)) {
                 throw new Exception("入参不能为空");
             }
-
             int pageSize = requestBody.getInteger("pageSize");
             if (Check.isNull(pageSize)) {
                 throw new Exception("请输入查询每页条数");
@@ -58,23 +57,22 @@ public class KsVideoReportCtrl {
             if (Check.isNull(startDate)) {
                 throw new Exception("请输入查询开始时间");
             }
-
             String endDate = requestBody.getString("endDate");
             if (Check.isNull(endDate)) {
                 throw new Exception("请输入查询结束时间");
             }
-            String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.dicMapKs);
+            String filedAll = JsonResourceUtil.joinAllFiled(AccountReportConstants.kuaishouVideoReportMap);
+            System.err.println(filedAll);
             if (Check.isNull(filedAll)) {
                 throw new Exception("初始化查询 字段返回为空");
             }
-
             Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("filed", filedAll);
             requestMap.put("startDate", startDate);
             requestMap.put("endDate", endDate);
             if (!Check.isNull(requestBody.getJSONArray("accountIds"))) {
                 requestMap.put("accountIds", requestBody.getJSONArray("accountIds"));
             }
-
             if (!Check.isNull(requestBody.getString("clipId"))) {
                 requestMap.put("clipId", requestBody.getString("clipId"));
             }
@@ -93,10 +91,12 @@ public class KsVideoReportCtrl {
             if (!Check.isNull(requestBody.getString("order"))) {
                 requestMap.put("order", requestBody.getString("order"));
             }
-
-
             PageInfo<JSONObject> listData = ksVideoReportService.getKuaiShouVideoReportByMap(requestMap, pageSize, pageNo);
-
+            if (Check.isNull(listData)) {
+                throw new Exception("暂无素材相关信息,请检查账户");
+            }
+            result.setSuccess(true);
+            result.setResult(listData);
         } catch (Exception e) {
             e.printStackTrace();
             log.error(e.getMessage(), e);
@@ -105,7 +105,7 @@ public class KsVideoReportCtrl {
         }
 
 
-       /* if (requestBody.isEmpty()) {
+     /*   if (requestBody.isEmpty()) {
             log.error("request body is empty");
             result.setSuccess(false);
         } else {

+ 4 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KsVideoReportMapper.java

@@ -5,11 +5,13 @@ import com.alibaba.fastjson.JSONObject;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 public interface KsVideoReportMapper {
 
-    List<JSONObject> queryVideoReportBy(@Param("accountIds") JSONArray accountIds,@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("filed") String filed,@Param("target") String target,@Param("order") String order,@Param("clip") String clip,@Param("shot") String shot,@Param("plan") String plan);
+    List<JSONObject> queryVideoReportBy(@Param("accountIds") JSONArray accountIds, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("filed") String filed, @Param("target") String target, @Param("order") String order, @Param("clip") String clip, @Param("shot") String shot, @Param("plan") String plan);
 
-    List<JSONObject> queryVideoDetailBy(@Param("accountIds") JSONArray accountIds,@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("filed") String filed,@Param("signature") String signature);
+    List<JSONObject> queryVideoDetailBy(@Param("accountIds") JSONArray accountIds, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("filed") String filed, @Param("signature") String signature);
 
+    List<JSONObject> getKuaiShouVideoReportByMap(Map<String, Object> requestMap);
 }

+ 47 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KsVideoReportMapper.xml

@@ -2,13 +2,56 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KsVideoReportMapper">
 
+    <select id="getKuaiShouVideoReportByMap" resultType="com.alibaba.fastjson.JSONObject" parameterType="map">
+        select t3.* from (
+        SELECT
+        ${filed}
+        FROM
+        ctop_etl_kuaishou_account_material_report_daily t1
+        LEFT JOIN ctop_etl_kuaishou_video_info t2 ON t1.signature = t2.video_code
+        WHERE
+        1 = 1
+        <if test="accountIds !=null and accountIds != ''">
+            and t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="startDate !=null and startDate != ''">
+            AND t1.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate !=null and endDate != ''">
+            AND t1.stat_date &lt;= #{endDate}
+        </if>
+        <if test="designTeamLeaderId !=null and designTeamLeaderId != ''">
+            AND t2.design_team_leader_id = #{designTeamLeaderId}
+        </if>
+        <if test="clipId !=null and clipId != ''">
+            AND t2.clip_id = #{clipId}
+        </if>
+        <if test="planId !=null and planId != ''">
+            AND t2.plan_id = #{planId}
+        </if>
+        <if test="shotId !=null and shotId != ''">
+            AND t2.shot_id = #{shotId}
+        </if>
+        GROUP BY t1.signature
+        ) t3
+        ORDER BY #{target} #{order}
+    </select>
+
+
     <select id="queryVideoReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT * from (SELECT
         t1.signature,
         t1.photo_url as url,
-        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where t3.material_id=t1.signature limit 1),'') AS clip,
-        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1),'') AS shot,
-        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where
+        t3.material_id=t1.signature limit 1),'') AS clip,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where
+        t3.material_id=t1.signature limit 1),'') AS shot,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where
+        t3.material_id=t1.signature limit 1),'') AS plan,
         t1.cover_url as converUrl,
         (select t2.material_name from ctop_material_info t2 where t2.code=t1.signature limit 1) AS materialName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
@@ -76,4 +119,5 @@
         GROUP BY t1.signature,t1.stat_date
         order by t1.stat_date desc
     </select>
+
 </mapper>

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKsVideoReportService.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageInfo;
 
 import java.util.List;
+import java.util.Map;
 
 public interface IKsVideoReportService {
 
@@ -13,4 +14,6 @@ public interface IKsVideoReportService {
     List<JSONObject> getVideoDetailBy(JSONArray accountIds, String startDate, String endDate, String filed, String signature);
 
     List<JSONObject> exportExcelReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan);
+
+    PageInfo<JSONObject> getKuaiShouVideoReportByMap(Map<String, Object> requestMap, int pageSize, int pageNo);
 }

+ 14 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KsVideoReportServiceImpl.java

@@ -1,7 +1,7 @@
 package cn.com.ctop.kuaishou.modules.report.service.impl;
 
-import cn.com.ctop.kuaishou.modules.report.service.IKsVideoReportService;
 import cn.com.ctop.kuaishou.modules.report.mapper.KsVideoReportMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IKsVideoReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class KsVideoReportServiceImpl implements IKsVideoReportService {
@@ -19,19 +20,27 @@ public class KsVideoReportServiceImpl implements IKsVideoReportService {
 
     @Override
     public PageInfo<JSONObject> getVideoReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan, int pageSize, int pageNo) {
-        PageHelper.startPage(pageNo,pageSize);
-        List<JSONObject> jsonObjectList=ksVideoReportMapper.queryVideoReportBy(accountIds,startDate,endDate,filed,target,order,clip,shot,plan);
+        PageHelper.startPage(pageNo, pageSize);
+        List<JSONObject> jsonObjectList = ksVideoReportMapper.queryVideoReportBy(accountIds, startDate, endDate, filed, target, order, clip, shot, plan);
         return new PageInfo<>(jsonObjectList);
     }
 
     @Override
     public List<JSONObject> getVideoDetailBy(JSONArray accountIds, String startDate, String endDate, String filed, String signature) {
-        return ksVideoReportMapper.queryVideoDetailBy(accountIds,startDate,endDate,filed,signature);
+        return ksVideoReportMapper.queryVideoDetailBy(accountIds, startDate, endDate, filed, signature);
     }
 
     @Override
     public List<JSONObject> exportExcelReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan) {
-        return ksVideoReportMapper.queryVideoReportBy(accountIds,startDate,endDate,filed,target,order,clip,shot,plan);
+        return ksVideoReportMapper.queryVideoReportBy(accountIds, startDate, endDate, filed, target, order, clip, shot, plan);
+    }
+
+    @Override
+    public PageInfo<JSONObject> getKuaiShouVideoReportByMap(Map<String, Object> requestMap, int pageSize, int pageNo) {
+        PageHelper.startPage(pageNo, pageSize);
+        List<JSONObject> jsonObjectList = ksVideoReportMapper.getKuaiShouVideoReportByMap(requestMap);
+        return new PageInfo<>(jsonObjectList);
+
     }
 
 }

+ 251 - 0
module-kuaishou/src/main/resources/json_template/kuaishou_video_report_filed_mapping.json

@@ -0,0 +1,251 @@
+{
+  "signature": {
+    "filed": "t1.signature as signature ",
+    "comment": "素材标识"
+  },
+
+  "clip": {
+    "filed": "t2.clip_name as clip ",
+    "comment": "剪辑"
+  },
+  "plan": {
+    "filed": "t2.plan_name as plan ",
+    "comment": "编导"
+  },
+  "shot": {
+    "filed": "t2.shot_name as shot ",
+    "comment": "拍摄"
+  },
+  "designLeader": {
+    "filed": "t2.design_team_leader_name as designLeader ",
+    "comment": "设计负责人"
+  },
+  "materialName": {
+    "filed": "t2.video_name as materialName ",
+    "comment": "素材名称"
+  },
+  "projectName": {
+    "filed": "t1.project_name as projectName ",
+    "comment": "项目名称"
+  },
+  "createTime": {
+    "filed": "t1.stat_date as createTime ",
+    "comment": "上线日期"
+  },
+  "coverUrl": {
+    "filed": "t2.cover_url as coverUrl ",
+    "comment": "封面"
+  },
+  "url": {
+    "filed": "t2.url as url ",
+    "comment": "视频"
+  },
+  "channel": {
+    "filed": "t2.channel_name AS channel",
+    "comment": "素材来源"
+  },
+  "cost": {
+    "filed": "IFNULL(sum(t1.charge),0) as cost ",
+    "comment": "消耗"
+  },
+  "photoShow": {
+    "filed": "IFNULL(sum(t1.photo_show),0) as photoShow ",
+    "comment": "封面曝光数"
+  },
+  "photoClick": {
+    "filed": "IFNULL(sum(t1.photo_click),0) as photoClick ",
+    "comment": "封面点击数"
+  },
+  "aClick": {
+    "filed": "IFNULL(sum(t1.aclick),0) as aClick ",
+    "comment": "素材曝光数"
+  },
+  "bClick": {
+    "filed": "IFNULL(sum(t1.bclick),0) as bClick ",
+    "comment": "行为数"
+  },
+  "clickRate": {
+    "filed": "CASE WHEN sum(t1.photo_click) / sum(t1.photo_show) IS NULL THEN 0 ELSE CONCAT( ROUND((sum(t1.photo_click) / sum(t1.photo_show)) * 100,2),'%') END AS clickRate ",
+    "comment": "封面点击率"
+  },
+  "bClickRate": {
+    "filed": "CASE WHEN sum(t1.bclick) / sum(t1.aclick) IS NULL THEN 0 ELSE CONCAT( ROUND((sum(t1.bclick) / sum(t1.aclick)) * 100,2),'%') END AS bClickRate ",
+    "comment": "行为率"
+  },
+  "cpm": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.photo_show) IS NULL THEN 0 ELSE ROUND((sum(t1.charge) / sum(t1.photo_show)) * 1000, 2 ) END AS cpm ",
+    "comment": "平均千次封面曝光花费"
+  },
+  "cpc": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.photo_click) IS NULL THEN 0 ELSE ROUND((sum(t1.charge) / sum(t1.photo_click)), 2) END AS cpc ",
+    "comment": "平均封面点击单价"
+  },
+  "cpb": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.bclick) IS NULL THEN 0 ELSE ROUND((sum(t1.charge) / sum(t1.bclick)), 2) END AS cpb ",
+    "comment": "平均行为单价"
+  },
+  "downloadStart": {
+    "filed": "IFNULL(sum(download_started),0) as downloadStart ",
+    "comment": "安卓开始下载数"
+  },
+  "downloadStartCost": {
+    "filed": "CASE WHEN sum(t1.charge) / (t1.download_started) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.download_started) end AS downloadStartCost ",
+    "comment": "安卓开始下载单价"
+  },
+  "downloadStartRate": {
+    "filed": "CASE WHEN sum(t1.download_started) / sum(t1.bclick) IS NULL THEN 0 ELSE concat(round(sum(t1.download_started) / sum(t1.bclick)*100,2),'%') end AS downloadStartRate ",
+    "comment": "安卓开始下载率"
+  },
+  "downloadFinish": {
+    "filed": "IFNULL(sum(download_completed),0) as downloadFinish ",
+    "comment": "安卓下载完成数"
+  },
+  "downloadFinishCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.download_completed) IS NULL THEN 0 ELSE  sum(t1.charge) / sum(t1.download_completed) end AS downloadFinishCost ",
+    "comment": "安卓下载完成单价"
+  },
+  "downloadFinishRate": {
+    "filed": "CASE WHEN sum(t1.download_completed) / sum(t1.download_started) IS NULL THEN 0 ELSE  concat(round(sum(t1.download_completed) / sum(t1.download_started)*100,2),'%') end AS downloadFinishRate ",
+    "comment": "安卓下载完成率"
+  },
+  "active": {
+    "filed": "IFNULL(sum(activation),0) as active ",
+    "comment": "激活数"
+  },
+  "activeCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.activation) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.activation) end AS activeCost ",
+    "comment": "激活单价"
+  },
+  "activeRate": {
+    "filed": "CASE WHEN sum(t1.activation) / sum(t1.download_completed) IS NULL THEN 0 ELSE concat(round(sum(t1.activation) / sum(t1.download_completed)*100,2),'%') end as activeRate ",
+    "comment": "下载完成激活率"
+  },
+  "firstDayPay": {
+    "filed": "IFNULL(sum(t1.event_pay_first_day),0) as firstDayPay  ",
+    "comment": "首日付费次数"
+  },
+  "firstDayPayAmount": {
+    "filed": "IFNULL(sum(t1.event_pay_purchase_amount_first_day),0) as firstDayPayAmount  ",
+    "comment": "首日付费金额"
+  },
+  "firstDayPayCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_pay_first_day) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.event_pay_first_day) end AS firstDayPayCost ",
+    "comment": "首日付费成本"
+  },
+  "firstDayPayROI": {
+    "filed": "CASE WHEN sum(t1.event_pay_purchase_amount_first_day) / sum(t1.charge) IS NULL THEN 0 ELSE sum(t1.event_pay_purchase_amount_first_day) / sum(t1.charge) end AS firstDayPayROI ",
+    "comment": "首日ROI"
+  },
+  "eventPay": {
+    "filed": "IFNULL(sum(t1.event_pay),0) as eventPay  ",
+    "comment": "付费次数"
+  },
+  "eventPayPurchaseAmount": {
+    "filed": "IFNULL(sum(t1.event_pay_purchase_amount),0) as eventPayPurchaseAmount  ",
+    "comment": "付费金额"
+  },
+  "eventPayCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_pay) IS NULL THEN 0 ELSE sum(t1.charge) / sum(t1.event_pay) end AS eventPayCost ",
+    "comment": "付费次数成本"
+  },
+  "ROI": {
+    "filed": "CASE WHEN sum(t1.event_pay_purchase_amount) / sum(t1.charge) IS NULL THEN 0 ELSE sum(t1.event_pay_purchase_amount) / sum(t1.charge) end AS ROI ",
+    "comment": "ROI"
+  },
+  "register": {
+    "filed": "IFNULL(sum(t1.event_register),0) as register ",
+    "comment": "注册数"
+  },
+  "activeRegisterCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_register) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.event_register),3) end as activeRegisterCost ",
+    "comment": "注册成本"
+  },
+  "activeRegisterRate": {
+    "filed": " CASE WHEN sum(t1.event_register) / sum(t1.activation) IS NULL THEN 0 ELSE concat(round(sum(t1.event_register) / sum(t1.activation)*100,2),'%') end as activeRegisterRate ",
+    "comment": "注册率"
+  },
+  "eventJinJianApp": {
+    "filed": "IFNULL(sum(event_jin_jian_app),0) as eventJinJianApp ",
+    "comment": "完件数"
+  },
+  "eventJinJianAppCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_jin_jian_app) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.event_jin_jian_app),3) end as eventJinJianAppCost ",
+    "comment": "完件成本"
+  },
+  "eventCreditGrantApp": {
+    "filed": "IFNULL(sum(event_credit_grant_app),0) as eventCreditGrantApp ",
+    "comment": "授信数"
+  },
+  "eventCreditGrantAppCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_credit_grant_app) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.event_credit_grant_app),3) end as eventCreditGrantAppCost ",
+    "comment": "授信成本"
+  },
+  "eventCreditGrantAppRate": {
+    "filed": "CASE WHEN sum(t1.event_credit_grant_app) / sum(t1.event_jin_jian_app) IS NULL THEN 0 ELSE concat(round(sum(t1.event_credit_grant_app) / sum(t1.event_jin_jian_app)*100,2),'%') end as eventCreditGrantAppRate ",
+    "comment": "授信率"
+  },
+  "formCount": {
+    "filed": "IFNULL(sum(t1.form_count),0) as formCount ",
+    "comment": "表单提交数"
+  },
+  "formCountRate": {
+    "filed": "CASE WHEN sum(t1.form_count) / sum(t1.activation) IS NULL THEN 0 ELSE concat(round(sum(t1.form_count) / sum(t1.activation)*100,2),'%') end as formCountRate ",
+    "comment": "表单提交率"
+  },
+  "formCountCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.form_count) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.form_count),3) end as formCountCost ",
+    "comment": "表单提交成本"
+  },
+  "nextDayOpen": {
+    "filed": "IFNULL(sum(t1.event_next_day_stay),0) as nextDayOpen ",
+    "comment": "次留数"
+  },
+  "nextDayOpenCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_next_day_stay) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.event_next_day_stay),3) end as nextDayOpenCost ",
+    "comment": "次留成本"
+  },
+  "nextDayOpenRate": {
+    "filed": "CASE WHEN sum(t1.event_next_day_stay) / sum(t1.activation) IS NULL THEN 0 ELSE concat(round(sum(t1.event_next_day_stay) / sum(t1.activation)*100,2),'%') end as nextDayOpenRate ",
+    "comment": "次留率"
+  },
+  "eventJinJianLandingPage": {
+    "filed": "IFNULL(sum(t1.event_jin_jian_landing_page),0) as eventJinJianLandingPage ",
+    "comment": "落地页完件数"
+  },
+  "eventJinJianLandingPageCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_jin_jian_landing_page) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.event_jin_jian_landing_page),3) end as eventJinJianLandingPageCost ",
+    "comment": "落地页完件成本"
+  },
+  "eventCreditGrantLandingPage": {
+    "filed": "IFNULL(sum(t1.event_credit_grant_landing_page),0) as eventCreditGrantLandingPage ",
+    "comment": "落地页授信数"
+  },
+  "eventCreditGrantLandingPageCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.event_credit_grant_landing_page) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.event_credit_grant_landing_page),3) end as eventCreditGrantLandingPageCost ",
+    "comment": "落地页授信成本"
+  },
+  "eventCreditGrantLandingPageRate": {
+    "filed": "CASE WHEN sum(t1.event_credit_grant_landing_page) / sum(t1.event_jin_jian_landing_page) IS NULL THEN 0 ELSE concat(round(sum(t1.event_credit_grant_landing_page) / sum(t1.event_jin_jian_landing_page)*100,2),'%') end as eventCreditGrantLandingPageRate ",
+    "comment": "落地页授信率"
+  },
+  "submit": {
+    "filed": "IFNULL(sum(t1.submit),0) as submit ",
+    "comment": "按钮点击数"
+  },
+  "submitCost": {
+    "filed": "CASE WHEN sum(t1.charge) / sum(t1.submit) IS NULL THEN 0 ELSE round(sum(t1.charge)/sum(t1.submit),3) end as submitCost ",
+    "comment": "按钮点击成本"
+  },
+  "submitRate": {
+    "filed": "CASE WHEN sum(t1.submit) / sum(t1.bclick) IS NULL THEN 0 ELSE concat(round(sum(t1.submit) / sum(t1.bclick)*100,2),'%') end as submitRate ",
+    "comment": "按钮点击率"
+  },
+  "play3sCount": {
+    "filed": "sum(t1.play_3s_count) as play3sCount",
+    "comment": "3s播放率"
+  },
+  "play3sRate": {
+    "filed": "CASE WHEN sum(photo_show) != 0 THEN CONCAT( ROUND( sum(t1.play_3s_count) / sum(t1.photo_show),2 ) * 100, '%' ) ELSE '-' END AS play3sRate",
+    "comment": "3s播放率"
+  }
+}