xuzuoyun 5 lat temu
rodzic
commit
7e819f788a

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

@@ -4,6 +4,7 @@
     <select id="selectMapsPage" resultType="org.jeecg.modules.ctop.vo.MaterialTopVO">
        SELECT
           url,
+          cover_url,
           name,
           stat_date ,
           sum(cost) as cost,
@@ -28,6 +29,7 @@
         INSERT INTO ctop_material_report_total_result (
             CODE,
             url,
+            cover_url,
             NAME,
             stat_date,
             cost,
@@ -44,58 +46,36 @@
             media_type
         ) SELECT
               t2.signature,
-              CASE
-                  WHEN (
-                      SELECT
-                          info.url
-                      FROM
-                          ctop_material_info info
-                      WHERE
-                          info. CODE = t2.signature
-                      ORDER BY
-                          create_time DESC
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
-                          SELECT
+              IFNULL((SELECT
                               info.url
                           FROM
                               ctop_material_info info
                           WHERE
-                              info. CODE = t2.signature
+                              info.CODE = t2.signature
                           ORDER BY
                               create_time DESC
-                          LIMIT 1
-                      )
-                  END AS url,
-              CASE
-                  WHEN (
-                      SELECT
-                          info.material_name
-                      FROM
-                          ctop_material_info info
-                      WHERE
-                          info. CODE = t2.signature
-                      ORDER BY
-                          create_time DESC
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
+                          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
+                              info.CODE = t2.signature
                           ORDER BY
                               create_time DESC
                           LIMIT 1
-                      )
-                  END AS NAME,
+                      ),'')
+                   AS NAME,
               t1.stat_datetime AS statDate,
               sum(t1.cost) AS cost,
               sum(t1.click) click,
@@ -127,6 +107,7 @@
         INSERT INTO ctop_material_report_total_result (
             CODE,
             url,
+            cover_url,
             NAME,
             stat_date,
             cost,
@@ -138,50 +119,36 @@
             media_type
         ) SELECT
               t1.signature AS 'code',
-              CASE
-                  WHEN (
-                      SELECT
-                          url
-                      FROM
-                          ctop_material_info
-                      WHERE
-                          `code` = t1.signature
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
-                          SELECT
-                              url
+              IFNULL((SELECT
+                              info.url
                           FROM
-                              ctop_material_info
+                              ctop_material_info info
                           WHERE
-                              `code` = t1.signature
-                          LIMIT 1
-                      )
-                  END AS 'url',
-              CASE
-                  WHEN (
-                      SELECT
-                          material_name
-                      FROM
-                          ctop_material_info
-                      WHERE
-                          `code` = t1.signature
-                      LIMIT 1
-                  ) IS NULL THEN
-                      ""
-                  ELSE
-                      (
+                              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
-                              material_name
+                              info.material_name
                           FROM
-                              ctop_material_info
+                              ctop_material_info info
                           WHERE
-                              `code` = t1.signature
+                              info.CODE = t2.signature
+                          ORDER BY
+                              create_time DESC
                           LIMIT 1
-                      )
-                  END AS 'name',
+                      ),'')
+                   AS NAME,
               t1.stat_date AS 'stat_date',
               sum(t1.charge) AS 'cost',
               sum(t1.photo_click) AS 'click',

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/MaterialTopVO.java

@@ -7,6 +7,7 @@ import java.math.BigDecimal;
 @Data
 public class MaterialTopVO {
     private String url;
+    private String coverUrl;
     private String name ;
     private String statDate;
     private BigDecimal cost;

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -48,6 +48,10 @@ public class MaterialInfo {
     @Excel(name = "url", width = 15)
     @ApiModelProperty(value = "url")
     private String url;
+    /**
+     * 封面url
+     */
+    private String coverUrl;
 
     /**
      * 水印素材链接

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/ByteDanceVideoReportDaily.java

@@ -62,6 +62,8 @@ public class ByteDanceVideoReportDaily {
 	@Excel(name = "公司素材库提供", width = 15)
     @ApiModelProperty(value = "公司素材库提供")
 	private String url;
+
+	private String coverUrl;
 	/**环比*/
 	@Excel(name = "环比", width = 15)
     @ApiModelProperty(value = "环比")

+ 1 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceVideoReportDailyMapper.xml

@@ -39,6 +39,7 @@
         a.video_url                              as videoUrl,
         '-'                                      as materialDesc,
         (select info.url from ctop_material_info info where info.code = a.signature limit 1)                                    as url,
+        (select info.cover_url from ctop_material_info info where info.code = a.signature limit 1)                                    as cover_url,
         (select
             case when video.material_upload_time is null then '-'
             else video.material_upload_time