zhouzeyu@c-top.com.cn 3 anni fa
parent
commit
492a69e065

+ 12 - 30
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialReportOverViewV3Mapper.xml

@@ -655,38 +655,20 @@
     </select>
     </select>
 
 
     <select id="queryKuaishouTopDesign" resultType="com.alibaba.fastjson.JSONObject">
     <select id="queryKuaishouTopDesign" resultType="com.alibaba.fastjson.JSONObject">
-        select SUM(t1.charge ) as 'cost',
-        <if test="type == 1">t1.shot_name as userName, "摄像" as roleName,</if>
-        <if test="type == 2">t1.clip_name as userName, "剪辑" as roleName,</if>
-        <if test="type == 3">t1.plan_name as userName, "编导" as roleName,</if>
-        IFNULL(t2.size,0) as 'videoHotCount',
-
-        IFNULL(t2.size/(SELECT COUNT(1) from application.app_kuaishou_video_list WHERE hot_video_date BETWEEN
-        #{startDate} and #{endDate} )*0.04,0)+
-        IFNULL(t1.charge/(SELECT SUM(charge) from application.kuaishou_material_video_report_daily_dw where stat_date
-        BETWEEN
-        #{startDate} and #{endDate} )*0.06,0) as 'sort'
 
 
+        select SUM(t1.charge ) as 'cost',
+        <if test="type == 1">t1.shot_name as userName, "摄像" as roleName</if>
+        <if test="type == 2">t1.clip_name as userName, "剪辑" as roleName</if>
+        <if test="type == 3">t1.plan_name as userName, "编导" as roleName</if>
         from
         from
-        (SELECT * from application.app_kuaishou_video_list GROUP BY signature,account_id) t
-        LEFT JOIN application.kuaishou_material_video_report_daily_dw t1 on t.signature=t1.signature and
-        t.account_id=t1.account_id
-        LEFT JOIN
-        (SELECT COUNT(1) as 'size',clip_id,shot_id,plan_id from application.app_kuaishou_video_list where
-        hot_video_date
-        BETWEEN #{startDate}
-        and #{endDate}
-        <if test="type == 1">and shot_id is not null GROUP BY shot_id)t2 on t.shot_id =t2.shot_id</if>
-        <if test="type == 2">and clip_id is not null GROUP BY clip_id)t2 on t.clip_id =t2.clip_id</if>
-        <if test="type == 3">and plan_id is not null GROUP BY plan_id)t2 on t.plan_id =t2.plan_id</if>
+        application.kuaishou_material_video_report_daily_dw t1
         <where>
         <where>
-            t1.stat_date &gt;=#{startDate}
-            AND t1.stat_date &gt;=#{endDate}
+            t1.stat_date  between #{startDate} and  #{endDate}
         </where>
         </where>
-        <if test="type == 1">AND t.shot_id is not null and t.shot_id != '' GROUP BY t.shot_id</if>
-        <if test="type == 2">AND t.clip_id is not null and t.clip_id != '' GROUP BY t.clip_id</if>
-        <if test="type == 3">AND t.plan_id is not null and t.plan_id != '' GROUP BY t.plan_id</if>
-        ORDER BY sort desc
+        <if test="type == 1">AND t1.shot_id is not null and t1.shot_id != '' GROUP BY t1.shot_id</if>
+        <if test="type == 2">AND t1.clip_id is not null and t1.clip_id != '' GROUP BY t1.clip_id</if>
+        <if test="type == 3">AND t1.plan_id is not null and t1.plan_id != '' GROUP BY t1.plan_id</if>
+        ORDER BY cost desc
 
 
     </select>
     </select>
 
 
@@ -699,7 +681,7 @@
 
 
         IFNULL(t2.size/(SELECT COUNT(1) from application.app_bytedance_file_video_get WHERE hot_video_date BETWEEN
         IFNULL(t2.size/(SELECT COUNT(1) from application.app_bytedance_file_video_get WHERE hot_video_date BETWEEN
         #{startDate} and #{endDate} )*0.04,0)+
         #{startDate} and #{endDate} )*0.04,0)+
-        IFNULL(t1.cost/(SELECT SUM(cost) from application.bytedance_material_video_report_daily_dw where stat_datetime
+        IFNULL(SUM(t1.cost)/(SELECT SUM(cost) from application.bytedance_material_video_report_daily_dw where stat_datetime
         BETWEEN
         BETWEEN
         #{startDate} and #{endDate} )*0.06,0) as 'sort'
         #{startDate} and #{endDate} )*0.06,0) as 'sort'
 
 
@@ -717,7 +699,7 @@
         <if test="type == 3">and plan_id is not null GROUP BY plan_id)t2 on t.plan_id =t2.plan_id</if>
         <if test="type == 3">and plan_id is not null GROUP BY plan_id)t2 on t.plan_id =t2.plan_id</if>
         <where>
         <where>
             t1.stat_datetime &gt;=#{startDate}
             t1.stat_datetime &gt;=#{startDate}
-            AND t1.stat_datetime &gt;=#{endDate}
+            AND t1.stat_datetime &lt;=#{endDate}
         </where>
         </where>
         <if test="type == 1">AND t.shot_id is not null and t.shot_id != '' GROUP BY t.shot_id</if>
         <if test="type == 1">AND t.shot_id is not null and t.shot_id != '' GROUP BY t.shot_id</if>
         <if test="type == 2">AND t.clip_id is not null and t.clip_id != '' GROUP BY t.clip_id</if>
         <if test="type == 2">AND t.clip_id is not null and t.clip_id != '' GROUP BY t.clip_id</if>

+ 12 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialReportOverViewV2ServiceImpl.java

@@ -473,14 +473,25 @@ public class MaterialReportOverViewV2ServiceImpl implements IMaterialReportOverV
         startDate = startDate.replace("-", "");
         startDate = startDate.replace("-", "");
         endDate = endDate.replace("-", "");
         endDate = endDate.replace("-", "");
         List<JSONObject> result = new ArrayList<>();
         List<JSONObject> result = new ArrayList<>();
-        PageHelper.startPage(pageNumber, pageSize);
+        int total=0;
+        int page=pageNumber;
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
+            total=materialReportOverViewV3Mapper.queryBytedanceTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type).size();
+            PageHelper.startPage(pageNumber, pageSize,false);
             result = materialReportOverViewV3Mapper.queryBytedanceTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type);
             result = materialReportOverViewV3Mapper.queryBytedanceTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type);
 
 
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
+            total= materialReportOverViewV3Mapper.queryKuaishouTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type).size();
+            PageHelper.startPage(pageNumber, pageSize,false);
             result = materialReportOverViewV3Mapper.queryKuaishouTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type);
             result = materialReportOverViewV3Mapper.queryKuaishouTopDesign(Long.parseLong(startDate), Long.parseLong(endDate), type);
         }
         }
+        int number=(page-1)*10+1;
+        for (JSONObject jsonObject : result) {
+            jsonObject.put("number",number);
+            number++;
+        }
         PageInfo info = new PageInfo(result);
         PageInfo info = new PageInfo(result);
+        info.setTotal(total);
         return info;
         return info;
     }
     }