|
@@ -4,6 +4,7 @@ import com.google.common.base.CaseFormat;
|
|
|
import com.zanxiang.erp.security.util.SecurityUtil;
|
|
|
import com.zanxiang.game.data.serve.pojo.dto.AdsAccountRechargeRankingListDTO;
|
|
|
import com.zanxiang.game.data.serve.pojo.entity.AdsAccountRechargeRanking;
|
|
|
+import com.zanxiang.game.data.serve.pojo.entity.AdsAgentRechargeRanking;
|
|
|
import com.zanxiang.game.data.serve.pojo.vo.AdsAccountRechargeRankingVO;
|
|
|
import com.zanxiang.game.data.serve.service.IAdsAccountRechargeRankingService;
|
|
|
import com.zanxiang.game.data.serve.utils.Page;
|
|
@@ -52,13 +53,13 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
|
|
|
sum(reg_user_cnt) as reg_user_cnt,
|
|
|
sum(cost) / sum(reg_user_cnt) as reg_cost,
|
|
|
sum(first_role) as first_role,
|
|
|
- sum(total_role) as total_role,
|
|
|
+ max(total_role) as total_role,
|
|
|
sum(first_amount) as first_amount,
|
|
|
sum(first_amount_user) as first_amount_user,
|
|
|
sum(first_amount_count) as first_amount_count,
|
|
|
- sum(total_amount) as total_amount,
|
|
|
- sum(total_amount_user) as total_amount_user,
|
|
|
- sum(total_amount_count) as total_amount_count,
|
|
|
+ max(total_amount) as total_amount,
|
|
|
+ max(total_amount_user) as total_amount_user,
|
|
|
+ max(total_amount_count) as total_amount_count,
|
|
|
sum(cost) / sum(first_amount) as first_roi,
|
|
|
sum(total_amount) / sum(total_amount_count) as avg_amount,
|
|
|
sum(total_amount) / sum(cost) as roi
|
|
@@ -80,6 +81,9 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
|
|
|
if (StringUtils.isNotBlank(dto.getType())) {
|
|
|
cri.where().and(AdsAccountRechargeRanking::getType, "=", dto.getType());
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(dto.getSourceSystem())) {
|
|
|
+ cri.where().and(AdsAgentRechargeRanking::getSourceSystem, "=", dto.getSourceSystem());
|
|
|
+ }
|
|
|
cri.groupBy("account_id", "pitcher_id", "type", "game_id");
|
|
|
cri.orderBy(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, dto.getSortFiled()), dto.getSortType());
|
|
|
Sql sql = Sqls.queryEntity(sqlStr + "$condition");
|
|
@@ -92,7 +96,6 @@ public class AdsAccountRechargeRankingServiceImpl implements IAdsAccountRecharge
|
|
|
sql.setPager(pager);
|
|
|
dao.execute(sql);
|
|
|
|
|
|
-
|
|
|
List<AdsAccountRechargeRankingVO> result = sql.getList(AdsAccountRechargeRankingVO.class);
|
|
|
int beginIndex = (dto.getPageNum() - 1) * dto.getPageSize();
|
|
|
int size = result.size();
|