|
@@ -509,6 +509,8 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
} else {
|
|
} else {
|
|
sql = Sqls.create(pitcherDataTotalSqlForParent(criA, criB, criAmount, criNewUser, criRoleNum) + orderByCri);
|
|
sql = Sqls.create(pitcherDataTotalSqlForParent(criA, criB, criAmount, criNewUser, criRoleNum) + orderByCri);
|
|
}
|
|
}
|
|
|
|
+ // 打印SQL
|
|
|
|
+ System.out.println("Executing SQL: " + sql.getSourceSql());
|
|
//设置自定义回显对象
|
|
//设置自定义回显对象
|
|
sql.setCallback(Sqls.callback.entities());
|
|
sql.setCallback(Sqls.callback.entities());
|
|
sql.setEntity(dao.getEntity(PitcherDataTotalVO.class));
|
|
sql.setEntity(dao.getEntity(PitcherDataTotalVO.class));
|
|
@@ -3090,7 +3092,10 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
ROUND(IF(new_user_total_amount_num > 0, IFNULL(new_user_order_again, 0) / new_user_total_amount_num, 0), 4) as new_user_again_rate,
|
|
ROUND(IF(new_user_total_amount_num > 0, IFNULL(new_user_order_again, 0) / new_user_total_amount_num, 0), 4) as new_user_again_rate,
|
|
IFNULL(role_num, 0) as role_num,
|
|
IFNULL(role_num, 0) as role_num,
|
|
ROUND(IF(register_num > 0, IFNULL(role_num, 0) / register_num, 0), 4) as role_num_rate,
|
|
ROUND(IF(register_num > 0, IFNULL(role_num, 0) / register_num, 0), 4) as role_num_rate,
|
|
- ROUND(IF(role_num > 0, IFNULL(cost, 0) / role_num, 0), 2) as role_num_cost
|
|
|
|
|
|
+ ROUND(IF(role_num > 0, IFNULL(cost, 0) / role_num, 0), 2) as role_num_cost,
|
|
|
|
+ new_user_total_zfb_amount,
|
|
|
|
+ new_user_total_wx_amount,
|
|
|
|
+ new_user_total_mds_amount
|
|
FROM (
|
|
FROM (
|
|
SELECT
|
|
SELECT
|
|
pitcher_id,
|
|
pitcher_id,
|
|
@@ -3145,7 +3150,10 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
SUM(m6) / SUM(IF(DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), cost, 0)), 0), 4) as roi180,
|
|
SUM(m6) / SUM(IF(DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), cost, 0)), 0), 4) as roi180,
|
|
ROUND(IF(SUM(IF(DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), cost, 0)) > 0 ,
|
|
ROUND(IF(SUM(IF(DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), cost, 0)) > 0 ,
|
|
SUM(m12) / SUM(IF(DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), cost, 0)), 0), 4) as roi1yaer,
|
|
SUM(m12) / SUM(IF(DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), cost, 0)), 0), 4) as roi1yaer,
|
|
- ROUND(IF(SUM(cost) > 0 , SUM(total) / SUM(cost), 0), 4) as roi_total
|
|
|
|
|
|
+ ROUND(IF(SUM(cost) > 0 , SUM(total) / SUM(cost), 0), 4) as roi_total,
|
|
|
|
+ SUM(new_user_total_zfb_amount) AS new_user_total_zfb_amount,
|
|
|
|
+ SUM(new_user_total_wx_amount) AS new_user_total_wx_amount,
|
|
|
|
+ SUM(new_user_total_mds_amount) AS new_user_total_mds_amount
|
|
FROM
|
|
FROM
|
|
game_ads.ads_pitcher_day
|
|
game_ads.ads_pitcher_day
|
|
""" + criA +
|
|
""" + criA +
|
|
@@ -3211,7 +3219,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
|
|
user_zx_pitcher_id as f_pitcher_id,
|
|
user_zx_pitcher_id as f_pitcher_id,
|
|
COUNT(DISTINCT role_user_id) as role_num
|
|
COUNT(DISTINCT role_user_id) as role_num
|
|
FROM
|
|
FROM
|
|
- dw_create_role_detail
|
|
|
|
|
|
+ game_ads.dw_create_role_detail
|
|
""" + criRoleNum +
|
|
""" + criRoleNum +
|
|
"""
|
|
"""
|
|
AND NOT user_agent_id = 0
|
|
AND NOT user_agent_id = 0
|