Explorar o código

统计报表-销售报表 日报表换成application库的表

zhaoxian hai 11 meses
pai
achega
a3914da046

+ 8 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml

@@ -495,10 +495,9 @@
 
         select
         concat(#{startDate},'~',#{endDate}) as statDate,
-        a.advertiser_id as 'accountId',
-        c.advertiser_id as 'advertiserId',
-        (select name from ctop_advertiser where id = c.advertiser_id) as 'advertiserName',
-
+        a.account_id as 'accountId',
+        a.advertiser_id as 'advertiserId',
+        a.advertiser_name as 'advertiserName',
         (
         select realname from sys_user where id = (
         select responsible_id from ctop_project where id = b.project_id
@@ -509,19 +508,17 @@
         select design_responsible_id from ctop_project where id = b.project_id
         )
         ) as 'designResponsibleName',
-        b.auth_name as 'authName',
-        b.project_id as 'projectId',
+        a.account_name as 'authName',
+        a.project_id as 'projectId',
         (
-        select realname from sys_user where id = (
-        select sale_id from ctop_project where id = b.project_id
-        )
+        select realname from sys_user where id = a.sale_id
         ) as 'saleName',
-        (select project_name from ctop_project where id = b.project_id) as 'projectName',
+        a.project_name as 'projectName',
         c.media_id as 'mediaId',
         <include refid="selectSql1"></include>
         from
         application.bytedance_advertiser_report_daily_dw a
-        left join ctop_user_allocation b on a.advertiser_id = b.account_id
+        left join ctop_user_allocation b on a.account_id = b.account_id
         left join ctop_project c on b.project_id = c.id
         where a.stat_datetime &gt;= date_format(#{startDate}, '%Y%m%d')
         and a.stat_datetime &lt;= date_format(#{endDate}, '%Y%m%d')