yumeng 4 سال پیش
والد
کامیت
8ac4be4dd9

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

@@ -16,4 +16,6 @@ public interface KsVideoReportMapper {
     List<JSONObject> getKuaiShouVideoReportByMap(Map<String, Object> requestMap);
 
     List<JSONObject> getDesignList();
+
+    Long getTotalByMap(Map<String, Object> requestMap);
 }

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

@@ -53,6 +53,50 @@
     </select>
 
 
+    <select id="getTotalByMap" resultType="java.lang.Long">
+        SELECT
+        count(1)
+        FROM
+        (select
+        t1.signature
+        from ctop_etl_kuaishou_account_material_report_daily t1
+        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>
+        GROUP BY t1.signature
+        ) t1
+        LEFT JOIN ctop_etl_kuaishou_video_info t2
+        ON t1.signature = t2.video_code
+        WHERE
+        1 = 1
+        <if test="leaderId !=null and leaderId != ''">
+            AND t2.design_team_leader_id = #{leaderId}
+        </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>
+
+
+    </select>
+
+
     <select id="queryVideoReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT * from (SELECT
         t1.signature,
@@ -150,4 +194,5 @@
 	)
     </select>
 
+
 </mapper>

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

@@ -37,9 +37,11 @@ public class KsVideoReportServiceImpl implements IKsVideoReportService {
 
     @Override
     public PageInfo<JSONObject> getKuaiShouVideoPageReportByMap(Map<String, Object> requestMap, int pageSize, int pageNo) {
-        PageHelper.startPage(pageNo, pageSize);
-        List<JSONObject> jsonObjectList = ksVideoReportMapper.getKuaiShouVideoReportByMap(requestMap);
-        return new PageInfo<>(jsonObjectList);
+        Long total = ksVideoReportMapper.getTotalByMap(requestMap);
+        PageHelper.startPage(pageNo, pageSize, false);
+        PageInfo pageInfo = new PageInfo(ksVideoReportMapper.getKuaiShouVideoReportByMap(requestMap));
+        pageInfo.setTotal(total);
+        return pageInfo;
 
     }