瀏覽代碼

销售报表增加销售导出

yumeng 4 年之前
父節點
當前提交
87aa5c6277

+ 13 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -545,7 +545,7 @@
         a.account_id as 'accountId',
         a.account_id as 'accountId',
         b.auth_name as 'authName',
         b.auth_name as 'authName',
         b.project_id as 'projectId',
         b.project_id as 'projectId',
-        (select  project_name from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         round(sum(a.charge),2) as 'charge',
         round(sum(a.charge),2) as 'charge',
         sum(a.photo_show) as 'photoShow', -- 封面曝光数
         sum(a.photo_show) as 'photoShow', -- 封面曝光数
         sum(a.photo_click) as 'photoClick', -- 封面点击数
         sum(a.photo_click) as 'photoClick', -- 封面点击数
@@ -595,7 +595,7 @@
         ) as 'eventNextDayStayCost' -- 次日留存成本
         ) as 'eventNextDayStayCost' -- 次日留存成本
         from
         from
         ctop_kuaishou_report_daily_account a
         ctop_kuaishou_report_daily_account a
-        left join  ctop_user_allocation b on a.account_id = b.account_id
+        left join ctop_user_allocation b on a.account_id = b.account_id
         where
         where
         a.stat_date >= #{startDate}
         a.stat_date >= #{startDate}
         and
         and
@@ -707,7 +707,7 @@
                  open="(" close=")">
                  open="(" close=")">
             #{item}
             #{item}
         </foreach>
         </foreach>
-        group by b.project_id  order by sum(a.charge) desc
+        group by b.project_id order by sum(a.charge) desc
     </select>
     </select>
 
 
     <!-- 计划汇总 -->
     <!-- 计划汇总 -->
@@ -718,7 +718,7 @@
         #{yn} as 'yn',
         #{yn} as 'yn',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         b.project_id as 'projectId',
         b.project_id as 'projectId',
-        (select  project_name  from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         b.auth_name as 'authName',
         b.auth_name as 'authName',
         a.account_id as 'accountId',
         a.account_id as 'accountId',
         a.campaign_id as 'campaignId', -- 计划id
         a.campaign_id as 'campaignId', -- 计划id
@@ -814,7 +814,7 @@
         #{yn} as 'yn',
         #{yn} as 'yn',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         b.project_id as 'projectId',
         b.project_id as 'projectId',
-        (select  project_name  from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         a.account_id as 'accountId',
         a.account_id as 'accountId',
         b.auth_name as 'authName',
         b.auth_name as 'authName',
         a.campaign_id as 'campaignId', -- 计划id
         a.campaign_id as 'campaignId', -- 计划id
@@ -996,7 +996,7 @@
         #{yn} as 'yn',
         #{yn} as 'yn',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         b.project_id as 'projectId',
         b.project_id as 'projectId',
-        (select  project_name  from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         a.account_id as 'accountId',
         a.account_id as 'accountId',
         b.auth_name as 'authName',
         b.auth_name as 'authName',
         a.creative_id as 'creativeId',
         a.creative_id as 'creativeId',
@@ -1057,7 +1057,7 @@
         (select material_type from ctop_kuaishou_video_get where photo_id = c.photo_id limit 1) as materialType
         (select material_type from ctop_kuaishou_video_get where photo_id = c.photo_id limit 1) as materialType
         from
         from
         ctop_kuaishou_report_daily_creative a
         ctop_kuaishou_report_daily_creative a
-        left join ctop_user_allocation  b on a.account_id = b.account_id
+        left join ctop_user_allocation b on a.account_id = b.account_id
         left join ctop_kuaishou_creative c on a.creative_id = c.creative_id
         left join ctop_kuaishou_creative c on a.creative_id = c.creative_id
         where
         where
         a.stat_date &gt;= #{startDate}
         a.stat_date &gt;= #{startDate}
@@ -1158,6 +1158,11 @@
         ) as 'responsibleName',
         ) as 'responsibleName',
         (
         (
         select realname from sys_user where id = (
         select realname from sys_user where id = (
+        select sale_id from ctop_project where id = b.project_id
+        )
+        ) as 'saleName',
+        (
+        select realname from sys_user where id = (
         select design_responsible_id from ctop_project where id = b.project_id
         select design_responsible_id from ctop_project where id = b.project_id
         )
         )
         ) as 'designResponsibleName',
         ) as 'designResponsibleName',
@@ -1223,7 +1228,7 @@
                  open="(" close=")">
                  open="(" close=")">
             #{item}
             #{item}
         </foreach>
         </foreach>
-        group by b.project_id  order by sum(a.charge) desc
+        group by b.project_id order by sum(a.charge) desc
 
 
     </select>
     </select>
 
 

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

@@ -531,6 +531,12 @@
         select design_responsible_id from ctop_project where id = b.project_id
         select design_responsible_id from ctop_project where id = b.project_id
         )
         )
         ) as 'designResponsibleName',
         ) as 'designResponsibleName',
+
+        (
+        select realname from sys_user where id = (
+        select sale_id from ctop_project where id = b.project_id
+        )
+        ) as 'saleName',
         b.auth_name as 'authName',
         b.auth_name as 'authName',
         b.project_id as 'projectId',
         b.project_id as 'projectId',
         (select project_name from ctop_project where id = b.project_id) as 'projectName',
         (select project_name from ctop_project where id = b.project_id) as 'projectName',