浏览代码

头条素材top数据增加筛选条件

jiequan.bi 5 年之前
父节点
当前提交
99863a2d9d

+ 80 - 80
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialTopMapper.xml

@@ -2,27 +2,27 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.ctop.mapper.MaterialTopMapper">
     <select id="selectMapsPage" resultType="org.jeecg.modules.ctop.vo.MaterialTopVO">
-       SELECT
-          url,
-          cover_url,
-          name,
-          stat_date ,
-          sum(cost) as cost,
-          sum(click) as click,
-          sum(show_num) as show_num,
-          sum(active) as active,
-          sum(register) as register,
-          sum(pay) as pay,
-          sum(phone_convert) as phone_convert,
-          sum(form_convert) as form_convert,
-          convert_rate,
-          sum(residue) as residue,
-          sum(play3s) as play3s,
-          sum(play10s) as play10s
-       FROM
-          ctop_material_report_total_result
-       where
-        ${ew.sqlSegment}
+        SELECT
+            url,
+            cover_url,
+            name,
+            stat_date ,
+            sum(cost) as cost,
+            sum(click) as click,
+            sum(show_num) as show_num,
+            sum(active) as active,
+            sum(register) as register,
+            sum(pay) as pay,
+            sum(phone_convert) as phone_convert,
+            sum(form_convert) as form_convert,
+            convert_rate,
+            sum(residue) as residue,
+            sum(play3s) as play3s,
+            sum(play10s) as play10s
+        FROM
+            ctop_material_report_total_result
+        where
+            ${ew.sqlSegment}
     </select>
 
     <insert id="insertByteDanceMaterialReportAccountByDate">
@@ -47,35 +47,35 @@
         ) SELECT
               t2.signature,
               IFNULL((SELECT
-                              info.url
-                          FROM
-                              ctop_material_info info
-                          WHERE
-                              info.CODE = t2.signature
-                          ORDER BY
-                              create_time DESC
-                          LIMIT 1),'') AS url,
-              			IFNULL((SELECT
-                              info.cover_url
-                          FROM
-                              ctop_material_info info
-                          WHERE
-                              info.CODE = t2.signature
-                          ORDER BY
-                              create_time DESC
-                          LIMIT 1),'') AS cover_url,
-                      IFNULL((
-                          SELECT
-                              info.material_name
-                          FROM
-                              ctop_material_info info
-                          WHERE
-                              info.CODE = t2.signature
-                          ORDER BY
-                              create_time DESC
-                          LIMIT 1
-                      ),'')
-                   AS NAME,
+                          info.url
+                      FROM
+                          ctop_material_info info
+                      WHERE
+                          info.CODE = t2.signature
+                      ORDER BY
+                          create_time DESC
+                      LIMIT 1),'') AS url,
+              IFNULL((SELECT
+                          info.cover_url
+                      FROM
+                          ctop_material_info info
+                      WHERE
+                          info.CODE = t2.signature
+                      ORDER BY
+                          create_time DESC
+                      LIMIT 1),'') AS cover_url,
+              IFNULL((
+                         SELECT
+                             info.material_name
+                         FROM
+                             ctop_material_info info
+                         WHERE
+                             info.CODE = t2.signature
+                         ORDER BY
+                             create_time DESC
+                         LIMIT 1
+                     ),'')
+                                   AS NAME,
               t1.stat_datetime AS statDate,
               sum(t1.cost) AS cost,
               sum(t1.click) click,
@@ -95,7 +95,7 @@
         WHERE
             1 = 1
           AND t1.stat_datetime = #{statDate}
-          AND t1.image_mode != 'MATERIAL_IMAGE_MODE_TITLE'
+          AND t1.image_mode in ('CREATIVE_IMAGE_MODE_VIDEO','CREATIVE_IMAGE_MODE_VIDEO_VERTICAL')
           AND t2.signature IS NOT NULL
           AND t2.signature != ""
         GROUP BY
@@ -120,35 +120,35 @@
         ) SELECT
               t1.signature AS 'code',
               IFNULL((SELECT
-                              info.url
-                          FROM
-                              ctop_material_info info
-                          WHERE
-                              info.CODE = t2.signature
-                          ORDER BY
-                              create_time DESC
-                          LIMIT 1),'') AS url,
-              			IFNULL((SELECT
-                              info.cover_url
-                          FROM
-                              ctop_material_info info
-                          WHERE
-                              info.CODE = t2.signature
-                          ORDER BY
-                              create_time DESC
-                          LIMIT 1),'') AS cover_url,
-                      IFNULL((
-                          SELECT
-                              info.material_name
-                          FROM
-                              ctop_material_info info
-                          WHERE
-                              info.CODE = t2.signature
-                          ORDER BY
-                              create_time DESC
-                          LIMIT 1
-                      ),'')
-                   AS NAME,
+                          info.url
+                      FROM
+                          ctop_material_info info
+                      WHERE
+                          info.CODE = t2.signature
+                      ORDER BY
+                          create_time DESC
+                      LIMIT 1),'') AS url,
+              IFNULL((SELECT
+                          info.cover_url
+                      FROM
+                          ctop_material_info info
+                      WHERE
+                          info.CODE = t2.signature
+                      ORDER BY
+                          create_time DESC
+                      LIMIT 1),'') AS cover_url,
+              IFNULL((
+                         SELECT
+                             info.material_name
+                         FROM
+                             ctop_material_info info
+                         WHERE
+                             info.CODE = t2.signature
+                         ORDER BY
+                             create_time DESC
+                         LIMIT 1
+                     ),'')
+                  AS NAME,
               t1.stat_date AS 'stat_date',
               sum(t1.charge) AS 'cost',
               sum(t1.photo_click) AS 'click',