|
@@ -4,7 +4,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getTotalCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getTotalCharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT t1.todayCharge, t2.yesterdayCharge, t3.thisWeekCharge, t4.lastWeek1 + t5.lastWeek2 as 'lastWeekCharge'
|
|
SELECT t1.todayCharge, t2.yesterdayCharge, t3.thisWeekCharge, t4.lastWeek1 + t5.lastWeek2 as 'lastWeekCharge'
|
|
|
FROM (
|
|
FROM (
|
|
|
SELECT IFNULL(sum(charge), 0.00) as 'todayCharge'
|
|
SELECT IFNULL(sum(charge), 0.00) as 'todayCharge'
|
|
@@ -47,7 +47,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getYesterdayUploadNewMaterialCount" resultType="Long">
|
|
<select id="getYesterdayUploadNewMaterialCount" resultType="Long">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT IFNULL(sum(material_num), 0)
|
|
SELECT IFNULL(sum(material_num), 0)
|
|
|
FROM application.`new_material_num_in_project`
|
|
FROM application.`new_material_num_in_project`
|
|
|
WHERE stat_date = #{yesterday}
|
|
WHERE stat_date = #{yesterday}
|
|
@@ -56,7 +56,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getHourcharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getHourcharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT hour as 'time', IFNULL(SUM(charge), 0.00) as 'charge'
|
|
SELECT hour as 'time', IFNULL(SUM(charge), 0.00) as 'charge'
|
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
|
WHERE stat_date = #{startTime}
|
|
WHERE stat_date = #{startTime}
|
|
@@ -68,7 +68,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getDatacharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getDatacharge" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT DATE_FORMAT(stat_date, '%Y-%m-%d') as 'time', IFNULL(sum(charge), 0.00) as 'charge'
|
|
SELECT DATE_FORMAT(stat_date, '%Y-%m-%d') as 'time', IFNULL(sum(charge), 0.00) as 'charge'
|
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
|
WHERE stat_date <= #{endTime}
|
|
WHERE stat_date <= #{endTime}
|
|
@@ -82,7 +82,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getProjectToDayReportTotal" resultType="Long">
|
|
<select id="getProjectToDayReportTotal" resultType="Long">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT IFNULL(sum(1), 0)
|
|
SELECT IFNULL(sum(1), 0)
|
|
|
FROM (
|
|
FROM (
|
|
|
SELECT 1
|
|
SELECT 1
|
|
@@ -96,7 +96,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getProjectToDayReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getProjectToDayReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT tt.*,
|
|
SELECT tt.*,
|
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='搜索广告' THEN t9.sceneCharge END),'-') AS 'ssAd',
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='搜索广告' THEN t9.sceneCharge END),'-') AS 'ssAd',
|
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='上下滑大屏广告' THEN t9.sceneCharge END),'-') AS 'sxhAd',
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='上下滑大屏广告' THEN t9.sceneCharge END),'-') AS 'sxhAd',
|
|
@@ -203,7 +203,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getProjectMoreDaysReportTotal" resultType="Long">
|
|
<select id="getProjectMoreDaysReportTotal" resultType="Long">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT IFNULL(sum(1), 0)
|
|
SELECT IFNULL(sum(1), 0)
|
|
|
FROM (
|
|
FROM (
|
|
|
SELECT 1
|
|
SELECT 1
|
|
@@ -219,7 +219,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getProjectMoreDaysReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getProjectMoreDaysReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT tt.*,
|
|
SELECT tt.*,
|
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='搜索广告' THEN t9.sceneCharge END),'-') AS 'ssAd',
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='搜索广告' THEN t9.sceneCharge END),'-') AS 'ssAd',
|
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='上下滑大屏广告' THEN t9.sceneCharge END),'-') AS 'sxhAd',
|
|
IFNULL(GROUP_CONCAT(DISTINCT CASE WHEN t9.ad_scene ='上下滑大屏广告' THEN t9.sceneCharge END),'-') AS 'sxhAd',
|
|
@@ -319,7 +319,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getProjectNoByDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getProjectNoByDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT stat_date as 'time',COUNT(1) as 'count'
|
|
SELECT stat_date as 'time',COUNT(1) as 'count'
|
|
|
FROM (SELECT stat_date, project_id
|
|
FROM (SELECT stat_date, project_id
|
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
@@ -333,7 +333,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getAdvertiserNoByDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getAdvertiserNoByDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT stat_date as 'time',COUNT(1) as 'count'
|
|
SELECT stat_date as 'time',COUNT(1) as 'count'
|
|
|
FROM (SELECT stat_date, advertiser_id
|
|
FROM (SELECT stat_date, advertiser_id
|
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
FROM application.kuaishou_account_report_hourly_dw
|
|
@@ -347,7 +347,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getUnitNoByHours" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getUnitNoByHours" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT `hour`as 'time' , SUM(material_upload_media_num) as 'count'
|
|
SELECT `hour`as 'time' , SUM(material_upload_media_num) as 'count'
|
|
|
FROM application.today_material_upload_num
|
|
FROM application.today_material_upload_num
|
|
|
WHERE type_id = 1
|
|
WHERE type_id = 1
|
|
@@ -362,7 +362,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getUnitNoByDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getUnitNoByDays" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT stat_date as 'time',sum(material_num) as 'count'
|
|
SELECT stat_date as 'time',sum(material_num) as 'count'
|
|
|
FROM application.new_material_num_in_project
|
|
FROM application.new_material_num_in_project
|
|
|
WHERE stat_date >= #{startTime}
|
|
WHERE stat_date >= #{startTime}
|
|
@@ -374,7 +374,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getKuaishouOperateInfoHourly" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getKuaishouOperateInfoHourly" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT COUNT(DISTINCT t.account_id) 'accountNum',
|
|
SELECT COUNT(DISTINCT t.account_id) 'accountNum',
|
|
|
COUNT(DISTINCT t.project_id) 'projectNums',
|
|
COUNT(DISTINCT t.project_id) 'projectNums',
|
|
|
SUM(t.charge) 'totalCost',
|
|
SUM(t.charge) 'totalCost',
|
|
@@ -436,7 +436,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getKuaishouOperateInfo" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getKuaishouOperateInfo" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT COUNT(DISTINCT t.account_id) 'accountNum',
|
|
SELECT COUNT(DISTINCT t.account_id) 'accountNum',
|
|
|
COUNT(DISTINCT t.project_id) 'projectNums',
|
|
COUNT(DISTINCT t.project_id) 'projectNums',
|
|
|
SUM(t.charge) 'totalCost',
|
|
SUM(t.charge) 'totalCost',
|
|
@@ -497,7 +497,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getKuaishouOperateGroupInfoHourly" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getKuaishouOperateGroupInfoHourly" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT
|
|
SELECT
|
|
|
IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
|
|
IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
|
|
|
IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',
|
|
IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',
|
|
@@ -569,7 +569,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getKuaishouOperateGroupInfo" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getKuaishouOperateGroupInfo" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- SET session tidb_isolation_read_engines = 'tiflash,tidb';
|
|
|
|
|
|
|
+
|
|
|
SELECT
|
|
SELECT
|
|
|
IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
|
|
IFNULL( count( t1.user_id ), 0 ) AS 'operationNum',
|
|
|
IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',
|
|
IFNULL( SUM( t1.accountNum ), 0 ) AS 'accountNum',
|