فهرست منبع

修改媒介报表

jiequan.bi 5 سال پیش
والد
کامیت
455b430d41

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

@@ -21,7 +21,7 @@
                  SELECT r.*, (r.todayCost - r.yesterdayCost) as diffCost, (r.todayCost + r.yesterdayCost) as sumCost
 
                  from (
-                          SELECT t1.advertiser_type                                                    as mediaType,
+                          SELECT t2.media_id                                                           as mediaType,
                                  t1.company_id                                                         as companyId,
                                  t1.id                                                                 as advertiserId,
                                  t1.NAME                                                               as advertiserName,
@@ -59,14 +59,14 @@
                                            and report.stat_datetime = '${yesterdayDate} 00:00:00'), 0) as yesterdayCost
                           FROM ctop_advertiser t1
                                    LEFT JOIN ctop_project t2 ON t1.id = t2.advertiser_id
-                          where t1.advertiser_type = 1
+                          where t2.media_id in(1,3)
                             and t2.id is not null) as r
 
                  UNION
 
                  SELECT r.*, (r.todayCost - r.yesterdayCost) as diffCost, (r.todayCost + r.yesterdayCost) as sumCost
                  from (
-                          SELECT t1.advertiser_type                                        as mediaType,
+                          SELECT t2.media_id                                               as mediaType,
                                  t1.company_id                                             as companyId,
                                  t1.id                                                     as advertiserId,
                                  t1.NAME                                                   as advertiserName,
@@ -104,7 +104,7 @@
                                            and report.stat_date = '${yesterdayDate}'), 0)  as yesterdayCost
                           FROM ctop_advertiser t1
                                    LEFT JOIN ctop_project t2 ON t1.id = t2.advertiser_id
-                          where t1.advertiser_type = 2
+                          where t2.media_id  in(2,4)
                             and t2.id is not null) as r
 
                  union
@@ -144,7 +144,7 @@
                  SELECT r.*, (r.todayCost - r.yesterdayCost) as diffCost, (r.todayCost + r.yesterdayCost) as sumCost
 
                  from (
-                          SELECT t1.advertiser_type                                                    as mediaType,
+                          SELECT t2.media_id                                                           as mediaType,
                                  t1.company_id                                                         as companyId,
                                  t1.id                                                                 as advertiserId,
                                  t1.NAME                                                               as advertiserName,
@@ -182,14 +182,14 @@
                                            and report.stat_datetime = '${yesterdayDate} 00:00:00'), 0) as yesterdayCost
                           FROM ctop_advertiser t1
                                    LEFT JOIN ctop_project t2 ON t1.id = t2.advertiser_id
-                          where t1.advertiser_type = 1
+                          where t2.media_id  in(1,3)
                             and t2.id is not null) as r
 
                  UNION
 
                  SELECT r.*, (r.todayCost - r.yesterdayCost) as diffCost, (r.todayCost + r.yesterdayCost) as sumCost
                  from (
-                          SELECT t1.advertiser_type                                        as mediaType,
+                          SELECT t2.media_id                                               as mediaType,
                                  t1.company_id                                             as companyId,
                                  t1.id                                                     as advertiserId,
                                  t1.NAME                                                   as advertiserName,
@@ -227,7 +227,7 @@
                                            and report.stat_date = '${yesterdayDate}'), 0)  as yesterdayCost
                           FROM ctop_advertiser t1
                                    LEFT JOIN ctop_project t2 ON t1.id = t2.advertiser_id
-                          where t1.advertiser_type = 2
+                          where t2.media_id  in(2,4)
                             and t2.id is not null) as r) as e
         where companyId = ${condition}
         ORDER BY sumCost desc
@@ -238,7 +238,7 @@
         from (
                  SELECT r.*, (r.todayCost - r.yesterdayCost) as diffCost, (r.todayCost + r.yesterdayCost) as sumCost
                  from (
-                          SELECT '-'                                                            as mediaType,
+                          SELECT '-'                                                             as mediaType,
                                  '-'                                                             as companyId,
                                  id                                                              as advertiserId,
                                  corporation_name                                                as advertiserName,