|  | @@ -104,100 +104,62 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |          dao.execute(sql);
 | 
	
		
			
				|  |  |          pager.setRecordCount(dao.count(AdsAccountAgentDay.class, cri));
 | 
	
		
			
				|  |  |          List<GamePromoteDayVO> collect = sql.getList(GamePromoteDayVO.class).stream().map(item -> {
 | 
	
		
			
				|  |  | -            String[] trendDay1 = item.getTrendDay1().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendDay1(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendDay1[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendDay1[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendDay1[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendDay1[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendDay1[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendDay3 = item.getTrendDay3().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendDay3(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendDay3[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendDay3[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendDay3[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendDay3[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendDay3[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendDay5 = item.getTrendDay5().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendDay5(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendDay5[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendDay5[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendDay5[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendDay5[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendDay5[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendDay7 = item.getTrendDay7().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendDay7(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendDay7[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendDay7[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendDay7[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendDay7[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendDay7[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendDay15 = item.getTrendDay15().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendDay15(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendDay15[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendDay15[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendDay15[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendDay15[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendDay15[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendMonth1 = item.getTrendMonth1().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendMonth1(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendMonth1[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendMonth1[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendMonth1[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendMonth1[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendMonth1[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendMonth2 = item.getTrendMonth2().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendMonth2(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendMonth2[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendMonth2[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendMonth2[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendMonth2[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendMonth2[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendMonth3 = item.getTrendMonth3().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendMonth3(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendMonth3[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendMonth3[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendMonth3[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendMonth3[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendMonth3[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendMonth6 = item.getTrendMonth6().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendMonth6(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendMonth6[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendMonth6[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendMonth6[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendMonth6[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendMonth6[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] trendTotal = item.getTrendTotal().split("/");
 | 
	
		
			
				|  |  | -            item.setRechargeTrendTotal(RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | -                    .rechargeMoney(new BigDecimal(trendTotal[0]))
 | 
	
		
			
				|  |  | -                    .rechargeUserCount(Long.valueOf(trendTotal[1]))
 | 
	
		
			
				|  |  | -                    .increase(new BigDecimal(trendTotal[2]))
 | 
	
		
			
				|  |  | -                    .back(new BigDecimal(trendTotal[3]))
 | 
	
		
			
				|  |  | -                    .multiples(new BigDecimal(trendTotal[4]))
 | 
	
		
			
				|  |  | -                    .build());
 | 
	
		
			
				|  |  | +            setDayRechargeTrend(item);
 | 
	
		
			
				|  |  |              return item;
 | 
	
		
			
				|  |  |          }).collect(Collectors.toList());
 | 
	
		
			
				|  |  |          return new Page<>(collect, pager);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    private void setDayRechargeTrend(GamePromoteDayVO item) {
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay1(getRechargeTrendVO(item.getTrendDay1()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay2(getRechargeTrendVO(item.getTrendDay2()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay3(getRechargeTrendVO(item.getTrendDay3()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay4(getRechargeTrendVO(item.getTrendDay4()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay5(getRechargeTrendVO(item.getTrendDay5()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay6(getRechargeTrendVO(item.getTrendDay6()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay7(getRechargeTrendVO(item.getTrendDay7()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay8(getRechargeTrendVO(item.getTrendDay8()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay9(getRechargeTrendVO(item.getTrendDay9()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay10(getRechargeTrendVO(item.getTrendDay10()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay11(getRechargeTrendVO(item.getTrendDay11()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay12(getRechargeTrendVO(item.getTrendDay12()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay13(getRechargeTrendVO(item.getTrendDay13()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay14(getRechargeTrendVO(item.getTrendDay14()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay15(getRechargeTrendVO(item.getTrendDay15()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay16(getRechargeTrendVO(item.getTrendDay16()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay17(getRechargeTrendVO(item.getTrendDay17()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay18(getRechargeTrendVO(item.getTrendDay18()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay19(getRechargeTrendVO(item.getTrendDay19()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay20(getRechargeTrendVO(item.getTrendDay20()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay21(getRechargeTrendVO(item.getTrendDay21()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay22(getRechargeTrendVO(item.getTrendDay22()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay23(getRechargeTrendVO(item.getTrendDay23()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay24(getRechargeTrendVO(item.getTrendDay24()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay25(getRechargeTrendVO(item.getTrendDay25()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay26(getRechargeTrendVO(item.getTrendDay26()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay27(getRechargeTrendVO(item.getTrendDay27()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay28(getRechargeTrendVO(item.getTrendDay28()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay29(getRechargeTrendVO(item.getTrendDay29()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth1(getRechargeTrendVO(item.getTrendMonth1()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth2(getRechargeTrendVO(item.getTrendMonth2()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth3(getRechargeTrendVO(item.getTrendMonth3()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth6(getRechargeTrendVO(item.getTrendMonth6()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendYear1(getRechargeTrendVO(item.getTrendYear1()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendTotal(getRechargeTrendVO(item.getTrendTotal()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private RechargeTrendVO getRechargeTrendVO(String trendDay) {
 | 
	
		
			
				|  |  | +        String[] trendDayResult = trendDay.split("/");
 | 
	
		
			
				|  |  | +        return RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | +                .rechargeMoney(new BigDecimal(trendDayResult[0]))
 | 
	
		
			
				|  |  | +                .rechargeUserCount(Long.valueOf(trendDayResult[1]))
 | 
	
		
			
				|  |  | +                .increase(new BigDecimal(trendDayResult[2]))
 | 
	
		
			
				|  |  | +                .back(new BigDecimal(trendDayResult[3]))
 | 
	
		
			
				|  |  | +                .multiples(new BigDecimal(trendDayResult[4]))
 | 
	
		
			
				|  |  | +                .build();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public GamePromoteDayTotalVO accountAgentDayTotal(GamePromoteDayTotalDTO dto) {
 | 
	
		
			
				|  |  |          Long sysUserId = SecurityUtil.isAdmin() ? null : SecurityUtil.getUserId();
 | 
	
	
		
			
				|  | @@ -247,7 +209,66 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |          Entity<GamePromoteDayTotalVO> entity = dao.getEntity(GamePromoteDayTotalVO.class);
 | 
	
		
			
				|  |  |          sql.setEntity(entity).setCondition(cri);
 | 
	
		
			
				|  |  |          dao.execute(sql);
 | 
	
		
			
				|  |  | -        return sql.getObject(GamePromoteDayTotalVO.class);
 | 
	
		
			
				|  |  | +        GamePromoteDayTotalVO gamePromoteDayTotalVO = sql.getObject(GamePromoteDayTotalVO.class);
 | 
	
		
			
				|  |  | +        setDayTotalRechargeTrend(gamePromoteDayTotalVO);
 | 
	
		
			
				|  |  | +        return gamePromoteDayTotalVO;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private void setDayTotalRechargeTrend(GamePromoteDayTotalVO item) {
 | 
	
		
			
				|  |  | +        BigDecimal trendDay1Money = new BigDecimal(item.getTrendDay1().split("/")[0]);
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay1(getSumRechargeTrendVO(item.getTrendDay1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay2(getSumRechargeTrendVO(item.getTrendDay2(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay3(getSumRechargeTrendVO(item.getTrendDay3(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay4(getSumRechargeTrendVO(item.getTrendDay4(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay5(getSumRechargeTrendVO(item.getTrendDay5(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay6(getSumRechargeTrendVO(item.getTrendDay6(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay7(getSumRechargeTrendVO(item.getTrendDay7(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay8(getSumRechargeTrendVO(item.getTrendDay8(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay9(getSumRechargeTrendVO(item.getTrendDay9(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay10(getSumRechargeTrendVO(item.getTrendDay10(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay11(getSumRechargeTrendVO(item.getTrendDay11(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay12(getSumRechargeTrendVO(item.getTrendDay12(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay13(getSumRechargeTrendVO(item.getTrendDay13(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay14(getSumRechargeTrendVO(item.getTrendDay14(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay15(getSumRechargeTrendVO(item.getTrendDay15(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay16(getSumRechargeTrendVO(item.getTrendDay16(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay17(getSumRechargeTrendVO(item.getTrendDay17(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay18(getSumRechargeTrendVO(item.getTrendDay18(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay19(getSumRechargeTrendVO(item.getTrendDay19(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay20(getSumRechargeTrendVO(item.getTrendDay20(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay21(getSumRechargeTrendVO(item.getTrendDay21(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay22(getSumRechargeTrendVO(item.getTrendDay22(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay23(getSumRechargeTrendVO(item.getTrendDay23(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay24(getSumRechargeTrendVO(item.getTrendDay24(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay25(getSumRechargeTrendVO(item.getTrendDay25(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay26(getSumRechargeTrendVO(item.getTrendDay26(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay27(getSumRechargeTrendVO(item.getTrendDay27(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay28(getSumRechargeTrendVO(item.getTrendDay28(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay29(getSumRechargeTrendVO(item.getTrendDay29(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth1(getSumRechargeTrendVO(item.getTrendMonth1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth2(getSumRechargeTrendVO(item.getTrendMonth2(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth3(getSumRechargeTrendVO(item.getTrendMonth3(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth6(getSumRechargeTrendVO(item.getTrendMonth6(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendYear1(getSumRechargeTrendVO(item.getTrendYear1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendTotal(getSumRechargeTrendVO(item.getTrendTotal(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private RechargeTrendVO getSumRechargeTrendVO(String trendDay, BigDecimal trendDay1Money, BigDecimal cost) {
 | 
	
		
			
				|  |  | +        String[] trendDayResult = trendDay.split("/");
 | 
	
		
			
				|  |  | +        BigDecimal dayTotalRecharge = new BigDecimal(trendDayResult[1]);
 | 
	
		
			
				|  |  | +        BigDecimal dayRecharge = new BigDecimal(trendDayResult[0]);
 | 
	
		
			
				|  |  | +        return RechargeTrendVO.builder()
 | 
	
		
			
				|  |  | +                .rechargeMoney(dayRecharge)
 | 
	
		
			
				|  |  | +                .rechargeUserCount(Long.valueOf(trendDayResult[2]))
 | 
	
		
			
				|  |  | +                .rechargeMoneyTotal(dayTotalRecharge)
 | 
	
		
			
				|  |  | +                .increase(cost.compareTo(BigDecimal.ZERO) == 0 ?
 | 
	
		
			
				|  |  | +                        BigDecimal.ZERO:dayRecharge.divide(cost,4, RoundingMode.DOWN))
 | 
	
		
			
				|  |  | +                .back(cost.compareTo(BigDecimal.ZERO) == 0 ?
 | 
	
		
			
				|  |  | +                        BigDecimal.ZERO:dayTotalRecharge.divide(cost,4, RoundingMode.DOWN))
 | 
	
		
			
				|  |  | +                .multiples(trendDay1Money.compareTo(BigDecimal.ZERO) == 0 ?
 | 
	
		
			
				|  |  | +                        BigDecimal.ZERO:dayTotalRecharge.divide(trendDay1Money,4, RoundingMode.DOWN))
 | 
	
		
			
				|  |  | +                .build();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -348,6 +369,9 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |          showSql.setParam("rechargeEndDay", dto.getRechargeEndDay());
 | 
	
		
			
				|  |  |          //循环总数据的每条数据
 | 
	
		
			
				|  |  |          List<GamePromoteTotalVO> hasRechargeDayList = list.stream().map(item -> {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            setTotalRechargeTrend(item);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              showSql.setParam("sourceSystem", item.getSourceSystem());
 | 
	
		
			
				|  |  |              showSql.setParam("agentId", item.getAgentId());
 | 
	
		
			
				|  |  |              showSql.setParam("accountId", item.getAccountId());
 | 
	
	
		
			
				|  | @@ -461,6 +485,46 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |          return new Page<>(hasRechargeDayList, pager);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    private void setTotalRechargeTrend(GamePromoteTotalVO item) {
 | 
	
		
			
				|  |  | +        BigDecimal trendDay1Money = new BigDecimal(item.getTrendDay1().split("/")[0]);
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay1(getSumRechargeTrendVO(item.getTrendDay1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay2(getSumRechargeTrendVO(item.getTrendDay2(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay3(getSumRechargeTrendVO(item.getTrendDay3(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay4(getSumRechargeTrendVO(item.getTrendDay4(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay5(getSumRechargeTrendVO(item.getTrendDay5(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay6(getSumRechargeTrendVO(item.getTrendDay6(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay7(getSumRechargeTrendVO(item.getTrendDay7(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay8(getSumRechargeTrendVO(item.getTrendDay8(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay9(getSumRechargeTrendVO(item.getTrendDay9(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay10(getSumRechargeTrendVO(item.getTrendDay10(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay11(getSumRechargeTrendVO(item.getTrendDay11(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay12(getSumRechargeTrendVO(item.getTrendDay12(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay13(getSumRechargeTrendVO(item.getTrendDay13(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay14(getSumRechargeTrendVO(item.getTrendDay14(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay15(getSumRechargeTrendVO(item.getTrendDay15(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay16(getSumRechargeTrendVO(item.getTrendDay16(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay17(getSumRechargeTrendVO(item.getTrendDay17(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay18(getSumRechargeTrendVO(item.getTrendDay18(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay19(getSumRechargeTrendVO(item.getTrendDay19(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay20(getSumRechargeTrendVO(item.getTrendDay20(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay21(getSumRechargeTrendVO(item.getTrendDay21(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay22(getSumRechargeTrendVO(item.getTrendDay22(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay23(getSumRechargeTrendVO(item.getTrendDay23(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay24(getSumRechargeTrendVO(item.getTrendDay24(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay25(getSumRechargeTrendVO(item.getTrendDay25(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay26(getSumRechargeTrendVO(item.getTrendDay26(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay27(getSumRechargeTrendVO(item.getTrendDay27(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay28(getSumRechargeTrendVO(item.getTrendDay28(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay29(getSumRechargeTrendVO(item.getTrendDay29(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth1(getSumRechargeTrendVO(item.getTrendMonth1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth2(getSumRechargeTrendVO(item.getTrendMonth2(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth3(getSumRechargeTrendVO(item.getTrendMonth3(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth6(getSumRechargeTrendVO(item.getTrendMonth6(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendYear1(getSumRechargeTrendVO(item.getTrendYear1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendTotal(getSumRechargeTrendVO(item.getTrendTotal(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Map<LocalDate, List<AgentDayAgainVO>> accountAgentDayAgain(AgentDayAgainDTO dto) {
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -754,9 +818,50 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |                  BigDecimal.ZERO : gamePromoteTotalSumVO.getCost().divide(BigDecimal.valueOf(gamePromoteTotalSumVO.getOldUserRechargeCount()), 4, RoundingMode.DOWN));
 | 
	
		
			
				|  |  |          gamePromoteTotalSumVO.setShowRechargeCountCost(gamePromoteTotalSumVO.getShowRechargeCount() == 0 ?
 | 
	
		
			
				|  |  |                  BigDecimal.ZERO : gamePromoteTotalSumVO.getCost().divide(BigDecimal.valueOf(gamePromoteTotalSumVO.getShowRechargeCount()), 4, RoundingMode.DOWN));
 | 
	
		
			
				|  |  | +        setTotalSumRechargeTrend(gamePromoteTotalSumVO);
 | 
	
		
			
				|  |  |          return gamePromoteTotalSumVO;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    private void setTotalSumRechargeTrend(GamePromoteTotalSumVO item) {
 | 
	
		
			
				|  |  | +        BigDecimal trendDay1Money = new BigDecimal(item.getTrendDay1().split("/")[0]);
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay1(getSumRechargeTrendVO(item.getTrendDay1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay2(getSumRechargeTrendVO(item.getTrendDay2(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay3(getSumRechargeTrendVO(item.getTrendDay3(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay4(getSumRechargeTrendVO(item.getTrendDay4(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay5(getSumRechargeTrendVO(item.getTrendDay5(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay6(getSumRechargeTrendVO(item.getTrendDay6(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay7(getSumRechargeTrendVO(item.getTrendDay7(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay8(getSumRechargeTrendVO(item.getTrendDay8(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay9(getSumRechargeTrendVO(item.getTrendDay9(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay10(getSumRechargeTrendVO(item.getTrendDay10(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay11(getSumRechargeTrendVO(item.getTrendDay11(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay12(getSumRechargeTrendVO(item.getTrendDay12(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay13(getSumRechargeTrendVO(item.getTrendDay13(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay14(getSumRechargeTrendVO(item.getTrendDay14(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay15(getSumRechargeTrendVO(item.getTrendDay15(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay16(getSumRechargeTrendVO(item.getTrendDay16(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay17(getSumRechargeTrendVO(item.getTrendDay17(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay18(getSumRechargeTrendVO(item.getTrendDay18(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay19(getSumRechargeTrendVO(item.getTrendDay19(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay20(getSumRechargeTrendVO(item.getTrendDay20(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay21(getSumRechargeTrendVO(item.getTrendDay21(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay22(getSumRechargeTrendVO(item.getTrendDay22(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay23(getSumRechargeTrendVO(item.getTrendDay23(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay24(getSumRechargeTrendVO(item.getTrendDay24(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay25(getSumRechargeTrendVO(item.getTrendDay25(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay26(getSumRechargeTrendVO(item.getTrendDay26(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay27(getSumRechargeTrendVO(item.getTrendDay27(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay28(getSumRechargeTrendVO(item.getTrendDay28(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendDay29(getSumRechargeTrendVO(item.getTrendDay29(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth1(getSumRechargeTrendVO(item.getTrendMonth1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth2(getSumRechargeTrendVO(item.getTrendMonth2(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth3(getSumRechargeTrendVO(item.getTrendMonth3(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendMonth6(getSumRechargeTrendVO(item.getTrendMonth6(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendYear1(getSumRechargeTrendVO(item.getTrendYear1(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +        item.setRechargeTrendTotal(getSumRechargeTrendVO(item.getTrendTotal(), trendDay1Money, item.getCost()));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      private SimpleCriteria getSimpleCriteria(GamePromoteTotalSumDTO dto) {
 | 
	
		
			
				|  |  |          SimpleCriteria cri = Cnd.cri();
 | 
	
		
			
				|  |  |          // 组装条件
 | 
	
	
		
			
				|  | @@ -922,14 +1027,41 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |                  	first_roi AS first_recovery_rate,
 | 
	
		
			
				|  |  |                  	buy_roi AS buy_recovery_rate,
 | 
	
		
			
				|  |  |                  	gross_profit AS gross_margin,
 | 
	
		
			
				|  |  | -                	roi3 AS roi_day3,
 | 
	
		
			
				|  |  | -                	roi5 AS roi_day5,
 | 
	
		
			
				|  |  | -                	roi7 AS roi_day7,
 | 
	
		
			
				|  |  | -                	roi15 AS roi_day15,
 | 
	
		
			
				|  |  | -                	roi30 AS roi_day30,
 | 
	
		
			
				|  |  | -                	roi60 AS roi_day60,
 | 
	
		
			
				|  |  | -                	roi180 AS roi_day180,
 | 
	
		
			
				|  |  | -                	roi1yaer AS roi_year1,
 | 
	
		
			
				|  |  | +                        roi1 AS roi_day1,
 | 
	
		
			
				|  |  | +                        roi2 AS roi_day2,
 | 
	
		
			
				|  |  | +                        roi3 AS roi_day3,
 | 
	
		
			
				|  |  | +                        roi4 AS roi_day4,
 | 
	
		
			
				|  |  | +                        roi5 AS roi_day5,
 | 
	
		
			
				|  |  | +                        roi6 AS roi_day6,
 | 
	
		
			
				|  |  | +                        roi7 AS roi_day7,
 | 
	
		
			
				|  |  | +                        roi8 AS roi_day8,
 | 
	
		
			
				|  |  | +                        roi9 AS roi_day9,
 | 
	
		
			
				|  |  | +                        roi10 AS roi_day10,
 | 
	
		
			
				|  |  | +                        roi11 AS roi_day11,
 | 
	
		
			
				|  |  | +                        roi12 AS roi_day12,
 | 
	
		
			
				|  |  | +                        roi13 AS roi_day13,
 | 
	
		
			
				|  |  | +                        roi14 AS roi_day14,
 | 
	
		
			
				|  |  | +                        roi15 AS roi_day15,
 | 
	
		
			
				|  |  | +                        roi16 AS roi_day16,
 | 
	
		
			
				|  |  | +                        roi17 AS roi_day17,
 | 
	
		
			
				|  |  | +                        roi18 AS roi_day18,
 | 
	
		
			
				|  |  | +                        roi19 AS roi_day19,
 | 
	
		
			
				|  |  | +                        roi20 AS roi_day20,
 | 
	
		
			
				|  |  | +                        roi21 AS roi_day21,
 | 
	
		
			
				|  |  | +                        roi22 AS roi_day22,
 | 
	
		
			
				|  |  | +                        roi23 AS roi_day23,
 | 
	
		
			
				|  |  | +                        roi24 AS roi_day24,
 | 
	
		
			
				|  |  | +                        roi25 AS roi_day25,
 | 
	
		
			
				|  |  | +                        roi26 AS roi_day26,
 | 
	
		
			
				|  |  | +                        roi27 AS roi_day27,
 | 
	
		
			
				|  |  | +                        roi28 AS roi_day28,
 | 
	
		
			
				|  |  | +                        roi29 AS roi_day29,
 | 
	
		
			
				|  |  | +                        roi30 AS roi_day30,
 | 
	
		
			
				|  |  | +                        roi60 AS roi_day60,
 | 
	
		
			
				|  |  | +                        roi90 AS roi_day90,
 | 
	
		
			
				|  |  | +                        roi180 AS roi_day180,
 | 
	
		
			
				|  |  | +                        roi1yaer AS roi_year1,
 | 
	
		
			
				|  |  | +                        roi_total AS roiTotal,
 | 
	
		
			
				|  |  |                  	first_rate AS first_recharge_rate,
 | 
	
		
			
				|  |  |                  	buy_user_rate AS buy_user_recharge_rate,
 | 
	
		
			
				|  |  |                  	today_rate AS new_user_recharge_rate,
 | 
	
	
		
			
				|  | @@ -943,16 +1075,41 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |                  	first_arpu AS first_recharge_arpu,
 | 
	
		
			
				|  |  |                  	today_arpu AS today_recharge_arpu,
 | 
	
		
			
				|  |  |                  	paper_arpu AS show_recharge_arpu,
 | 
	
		
			
				|  |  | -                	amount_d1 AS trend_day1,
 | 
	
		
			
				|  |  | -                	amount_d3 AS trend_day3,
 | 
	
		
			
				|  |  | -                	amount_d5 AS trend_day5,
 | 
	
		
			
				|  |  | -                	amount_d7 AS trend_day7,
 | 
	
		
			
				|  |  | -                	amount_d15 AS trend_day15,
 | 
	
		
			
				|  |  | -                	amount_m1 AS trend_month1,
 | 
	
		
			
				|  |  | -                	amount_m2 AS trend_month2,
 | 
	
		
			
				|  |  | -                	amount_m3 AS trend_month3,
 | 
	
		
			
				|  |  | -                	amount_m6 AS trend_month6,
 | 
	
		
			
				|  |  | -                	amount_sum AS trend_total,
 | 
	
		
			
				|  |  | +                       amount_d1 AS trend_day1,
 | 
	
		
			
				|  |  | +                       amount_d2 AS trend_day2,
 | 
	
		
			
				|  |  | +                       amount_d3 AS trend_day3,
 | 
	
		
			
				|  |  | +                       amount_d4 AS trend_day4,
 | 
	
		
			
				|  |  | +                       amount_d5 AS trend_day5,
 | 
	
		
			
				|  |  | +                       amount_d6 AS trend_day6,
 | 
	
		
			
				|  |  | +                       amount_d7 AS trend_day7,
 | 
	
		
			
				|  |  | +                       amount_d8 AS trend_day8,
 | 
	
		
			
				|  |  | +                       amount_d9 AS trend_day9,
 | 
	
		
			
				|  |  | +                       amount_d10 AS trend_day10,
 | 
	
		
			
				|  |  | +                       amount_d11 AS trend_day11,
 | 
	
		
			
				|  |  | +                       amount_d12 AS trend_day12,
 | 
	
		
			
				|  |  | +                       amount_d13 AS trend_day13,
 | 
	
		
			
				|  |  | +                       amount_d14 AS trend_day14,
 | 
	
		
			
				|  |  | +                       amount_d15 AS trend_day15,
 | 
	
		
			
				|  |  | +                       amount_d16 AS trend_day16,
 | 
	
		
			
				|  |  | +                       amount_d17 AS trend_day17,
 | 
	
		
			
				|  |  | +                       amount_d18 AS trend_day18,
 | 
	
		
			
				|  |  | +                       amount_d19 AS trend_day19,
 | 
	
		
			
				|  |  | +                       amount_d20 AS trend_day20,
 | 
	
		
			
				|  |  | +                       amount_d21 AS trend_day21,
 | 
	
		
			
				|  |  | +                       amount_d22 AS trend_day22,
 | 
	
		
			
				|  |  | +                       amount_d23 AS trend_day23,
 | 
	
		
			
				|  |  | +                       amount_d24 AS trend_day24,
 | 
	
		
			
				|  |  | +                       amount_d25 AS trend_day25,
 | 
	
		
			
				|  |  | +                       amount_d26 AS trend_day26,
 | 
	
		
			
				|  |  | +                       amount_d27 AS trend_day27,
 | 
	
		
			
				|  |  | +                       amount_d28 AS trend_day28,
 | 
	
		
			
				|  |  | +                       amount_d29 AS trend_day29,
 | 
	
		
			
				|  |  | +                       amount_m1 AS trend_month1,
 | 
	
		
			
				|  |  | +                       amount_m2 AS trend_month2,
 | 
	
		
			
				|  |  | +                       amount_m3 AS trend_month3,
 | 
	
		
			
				|  |  | +                       amount_m6 AS trend_month6,
 | 
	
		
			
				|  |  | +                       amount_y1 AS trend_year1,
 | 
	
		
			
				|  |  | +                       amount_sum AS trend_total,
 | 
	
		
			
				|  |  |                  	round(if(first_new_user_amount_count > 0, cost / first_new_user_amount_count, 0), 4) as first_recharge_count_cost,
 | 
	
		
			
				|  |  |                  	round(if(old_amount_count > 0, cost / old_amount_count, 0), 4) as old_user_recharge_count_cost,
 | 
	
		
			
				|  |  |                  	round(if(amount_count > 0, cost / amount_count, 0), 4) as show_recharge_count_cost,
 | 
	
	
		
			
				|  | @@ -1014,36 +1171,93 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |                  	round(if(sum(cost) > 0, sum(new_user_total_amount) / sum(cost), 0), 4) as today_recovery_rate,
 | 
	
		
			
				|  |  |                  	round(if(sum(cost) > 0, sum(buy_new_user_total_amount) / sum(cost), 0), 4) as buy_recovery_rate,
 | 
	
		
			
				|  |  |                  	sum(gross_profit) as gross_margin,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d3, '/', 1)) / sum(cost), 0), 4) as roi_day3,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d5, '/', 1)) / sum(cost), 0), 4) as roi_day5,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d7, '/', 1)) / sum(cost), 0), 4) as roi_day7,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d15, '/', 1)) / sum(cost), 0), 4) as roi_day15,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m1, '/', 1)) / sum(cost), 0), 4) as roi_day30,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m2, '/', 1)) / sum(cost), 0), 4) as roi_day60,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m6, '/', 1)) / sum(cost), 0), 4) as roi_day180,
 | 
	
		
			
				|  |  | -                	round(if(sum(cost) > 0, sum(SPLIT_PART(amount_y1, '/', 1)) / sum(cost), 0), 4) as roi_year1,
 | 
	
		
			
				|  |  | -                	round(if(sum(register_num) > 0, sum(first_new_user_amount_num) / sum(register_num), 0), 4) as first_recharge_rate,
 | 
	
		
			
				|  |  | -                	round(if(sum(register_num) > 0, sum(buy_new_user_total_amount_num) / sum(register_num), 0), 4) as buy_user_recharge_rate,
 | 
	
		
			
				|  |  | -                	round(if(sum(register_num) > 0, sum(first_new_user_amount_num) / sum(amount_num), 0), 4) as new_user_recharge_rate,
 | 
	
		
			
				|  |  | -                	round(if(sum(first_new_user_amount_count) > 0, sum(first_new_user_amount) / sum(first_new_user_amount_count), 0), 4) as avg_first_user_recharge,
 | 
	
		
			
				|  |  | -                	round(if(sum(buy_new_user_total_amount_count) > 0, sum(buy_new_user_total_amount) / sum(buy_new_user_total_amount_count), 0), 4) as avg_buy_user_recharge,
 | 
	
		
			
				|  |  | -                	round(if(sum(amount_count) > 0, sum(amount) / sum(amount_count), 0), 4) as avg_show_user_recharge,
 | 
	
		
			
				|  |  | -                	round(if(sum(first_new_user_amount_num) > 0, sum(cost) / sum(first_new_user_amount_num), 0), 4) as first_recharge_cost,
 | 
	
		
			
				|  |  | -                	round(if(sum(buy_new_user_total_amount_num) > 0, sum(cost) / sum(buy_new_user_total_amount_num), 0), 4) as buy_user_recharge_cost,
 | 
	
		
			
				|  |  | -                	round(if(sum(new_user_total_amount_num) > 0, sum(reg_order_user_again) / sum(new_user_total_amount_num), 0), 4) as repeat_recharge_rate,
 | 
	
		
			
				|  |  | -                	round(if(sum(register_num) > 0, sum(new_user_total_amount) / sum(register_num), 0), 4) as new_reg_arpu,
 | 
	
		
			
				|  |  | -                	round(if(sum(first_new_user_amount_num) > 0, sum(first_new_user_amount) / sum(first_new_user_amount_num), 0), 4) as first_recharge_arpu,
 | 
	
		
			
				|  |  | -                	round(if(sum(new_user_total_amount_num) > 0, sum(new_user_total_amount) / sum(new_user_total_amount_num), 0), 4) as today_recharge_arpu,
 | 
	
		
			
				|  |  | -                	round(if(sum(amount_num) > 0, sum(amount) / sum(amount_num), 0), 4) as show_recharge_arpu,
 | 
	
		
			
				|  |  | -                	round(if(sum(first_new_user_amount_count) > 0, sum(cost) / sum(first_new_user_amount_count), 0), 4) as first_recharge_count_cost,
 | 
	
		
			
				|  |  | -                	round(if(sum(old_amount_count) > 0, sum(cost) / sum(old_amount_count), 0), 4) as old_user_recharge_count_cost,
 | 
	
		
			
				|  |  | -                	round(if(sum(amount_count) > 0, sum(cost) / sum(amount_count), 0), 4) as show_recharge_count_cost,
 | 
	
		
			
				|  |  | -                	round(if(sum(new_user_total_amount_count) > 0, sum(cost) / sum(new_user_total_amount_count), 0), 4) as new_user_recharge_count_cost,
 | 
	
		
			
				|  |  | -                	sum(hundred_user_num) as hundred_user_num,
 | 
	
		
			
				|  |  | -                	round(if(sum(hundred_user_num) > 0, sum(cost) / sum(hundred_user_num), 0), 4) as hundred_user_num_cost
 | 
	
		
			
				|  |  | -                from
 | 
	
		
			
				|  |  | -                	ads_account_agent_day
 | 
	
		
			
				|  |  | -                """;
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d1, '/', 6)) / sum(cost), 0), 4) as roi_day1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d2, '/', 6)) / sum(cost), 0), 4) as roi_day2,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d3, '/', 6)) / sum(cost), 0), 4) as roi_day3,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d4, '/', 6)) / sum(cost), 0), 4) as roi_day4,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d5, '/', 6)) / sum(cost), 0), 4) as roi_day5,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d6, '/', 6)) / sum(cost), 0), 4) as roi_day6,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d7, '/', 6)) / sum(cost), 0), 4) as roi_day7,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d8, '/', 6)) / sum(cost), 0), 4) as roi_day8,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d9, '/', 6)) / sum(cost), 0), 4) as roi_day9,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d10, '/', 6)) / sum(cost), 0), 4) as roi_day10,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d11, '/', 6)) / sum(cost), 0), 4) as roi_day11,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d12, '/', 6)) / sum(cost), 0), 4) as roi_day12,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d13, '/', 6)) / sum(cost), 0), 4) as roi_day13,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d14, '/', 6)) / sum(cost), 0), 4) as roi_day14,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d15, '/', 6)) / sum(cost), 0), 4) as roi_day15,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d16, '/', 6)) / sum(cost), 0), 4) as roi_day16,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d17, '/', 6)) / sum(cost), 0), 4) as roi_day17,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d18, '/', 6)) / sum(cost), 0), 4) as roi_day18,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d19, '/', 6)) / sum(cost), 0), 4) as roi_day19,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d20, '/', 6)) / sum(cost), 0), 4) as roi_day20,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d21, '/', 6)) / sum(cost), 0), 4) as roi_day21,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d22, '/', 6)) / sum(cost), 0), 4) as roi_day22,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d23, '/', 6)) / sum(cost), 0), 4) as roi_day23,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d24, '/', 6)) / sum(cost), 0), 4) as roi_day24,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d25, '/', 6)) / sum(cost), 0), 4) as roi_day25,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d26, '/', 6)) / sum(cost), 0), 4) as roi_day26,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d27, '/', 6)) / sum(cost), 0), 4) as roi_day27,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d28, '/', 6)) / sum(cost), 0), 4) as roi_day28,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d29, '/', 6)) / sum(cost), 0), 4) as roi_day29,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m1, '/', 6)) / sum(cost), 0), 4) as roi_day30,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m2, '/', 6)) / sum(cost), 0), 4) as roi_day60,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m3, '/', 6)) / sum(cost), 0), 4) as roi_day90,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m6, '/', 6)) / sum(cost), 0), 4) as roi_day180,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_y1, '/', 6)) / sum(cost), 0), 4) as roi_year1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_sum, '/', 6)) / sum(cost), 0), 4) as roi_total,
 | 
	
		
			
				|  |  | +                         """
 | 
	
		
			
				|  |  | +                +trendDay()+
 | 
	
		
			
				|  |  | +                        """
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m1 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m1, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m1, '/', 2) AS BIGINT))) AS trend_month1,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m2 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m2, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m2, '/', 2) AS BIGINT))) AS trend_month2,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m3 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m3, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m3, '/', 2) AS BIGINT))) AS trend_month3,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m6 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m6, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m6, '/', 2) AS BIGINT))) AS trend_month6,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_y1 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_y1, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_y1, '/', 2) AS BIGINT))) AS trend_year1,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_sum , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_sum, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_sum, '/', 2) AS BIGINT))) AS trend_total,
 | 
	
		
			
				|  |  | +                    round(if(sum(register_num) > 0, sum(first_new_user_amount_num) / sum(register_num), 0), 4) as first_recharge_rate,
 | 
	
		
			
				|  |  | +                    round(if(sum(register_num) > 0, sum(buy_new_user_total_amount_num) / sum(register_num), 0), 4) as buy_user_recharge_rate,
 | 
	
		
			
				|  |  | +                    round(if(sum(register_num) > 0, sum(first_new_user_amount_num) / sum(amount_num), 0), 4) as new_user_recharge_rate,
 | 
	
		
			
				|  |  | +                    round(if(sum(first_new_user_amount_count) > 0, sum(first_new_user_amount) / sum(first_new_user_amount_count), 0), 4) as avg_first_user_recharge,
 | 
	
		
			
				|  |  | +                    round(if(sum(buy_new_user_total_amount_count) > 0, sum(buy_new_user_total_amount) / sum(buy_new_user_total_amount_count), 0), 4) as avg_buy_user_recharge,
 | 
	
		
			
				|  |  | +                    round(if(sum(amount_count) > 0, sum(amount) / sum(amount_count), 0), 4) as avg_show_user_recharge,
 | 
	
		
			
				|  |  | +                    round(if(sum(first_new_user_amount_num) > 0, sum(cost) / sum(first_new_user_amount_num), 0), 4) as first_recharge_cost,
 | 
	
		
			
				|  |  | +                    round(if(sum(buy_new_user_total_amount_num) > 0, sum(cost) / sum(buy_new_user_total_amount_num), 0), 4) as buy_user_recharge_cost,
 | 
	
		
			
				|  |  | +                    round(if(sum(new_user_total_amount_num) > 0, sum(reg_order_user_again) / sum(new_user_total_amount_num), 0), 4) as repeat_recharge_rate,
 | 
	
		
			
				|  |  | +                    round(if(sum(register_num) > 0, sum(new_user_total_amount) / sum(register_num), 0), 4) as new_reg_arpu,
 | 
	
		
			
				|  |  | +                    round(if(sum(first_new_user_amount_num) > 0, sum(first_new_user_amount) / sum(first_new_user_amount_num), 0), 4) as first_recharge_arpu,
 | 
	
		
			
				|  |  | +                    round(if(sum(new_user_total_amount_num) > 0, sum(new_user_total_amount) / sum(new_user_total_amount_num), 0), 4) as today_recharge_arpu,
 | 
	
		
			
				|  |  | +                    round(if(sum(amount_num) > 0, sum(amount) / sum(amount_num), 0), 4) as show_recharge_arpu,
 | 
	
		
			
				|  |  | +                    round(if(sum(first_new_user_amount_count) > 0, sum(cost) / sum(first_new_user_amount_count), 0), 4) as first_recharge_count_cost,
 | 
	
		
			
				|  |  | +                    round(if(sum(old_amount_count) > 0, sum(cost) / sum(old_amount_count), 0), 4) as old_user_recharge_count_cost,
 | 
	
		
			
				|  |  | +                    round(if(sum(amount_count) > 0, sum(cost) / sum(amount_count), 0), 4) as show_recharge_count_cost,
 | 
	
		
			
				|  |  | +                    round(if(sum(new_user_total_amount_count) > 0, sum(cost) / sum(new_user_total_amount_count), 0), 4) as new_user_recharge_count_cost,
 | 
	
		
			
				|  |  | +                    sum(hundred_user_num) as hundred_user_num,
 | 
	
		
			
				|  |  | +                    round(if(sum(hundred_user_num) > 0, sum(cost) / sum(hundred_user_num), 0), 4) as hundred_user_num_cost
 | 
	
		
			
				|  |  | +                        from
 | 
	
		
			
				|  |  | +                        	ads_account_agent_day
 | 
	
		
			
				|  |  | +                        """;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private String trendDay(){
 | 
	
		
			
				|  |  | +        StringBuilder trendDay = new StringBuilder(StringUtils.EMPTY);
 | 
	
		
			
				|  |  | +        for (int day = 1; day <= 29; day++) {
 | 
	
		
			
				|  |  | +            trendDay.append("CONCAT(")
 | 
	
		
			
				|  |  | +                    .append("SUM(CAST(SPLIT_PART(amount_d")
 | 
	
		
			
				|  |  | +                    .append(day)
 | 
	
		
			
				|  |  | +                    .append(" , '/', 1) AS DECIMAL(10, 2))), ")
 | 
	
		
			
				|  |  | +                    .append("'/', ")
 | 
	
		
			
				|  |  | +                    .append("SUM(CAST(SPLIT_PART(amount_d")
 | 
	
		
			
				|  |  | +                    .append(day)
 | 
	
		
			
				|  |  | +                    .append(", '/', 6) AS DECIMAL(10, 2))), ")
 | 
	
		
			
				|  |  | +                    .append("'/', ")
 | 
	
		
			
				|  |  | +                    .append("SUM(CAST(SPLIT_PART(amount_d")
 | 
	
		
			
				|  |  | +                    .append(day)
 | 
	
		
			
				|  |  | +                    .append(", '/', 2) AS BIGINT))")
 | 
	
		
			
				|  |  | +                    .append(") AS trend_day")
 | 
	
		
			
				|  |  | +                    .append(day).append(",");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return trendDay.toString();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
	
		
			
				|  | @@ -1110,14 +1324,50 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |                  	round(if(sum(a.cost) > 0, sum(a.first_new_user_amount) / sum(a.cost), 0), 4) as first_recovery_rate,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.cost) > 0, sum(a.new_user_total_amount) / sum(a.cost), 0), 4) as today_recovery_rate,
 | 
	
		
			
				|  |  |                  	sum(a.gross_profit) as gross_margin,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d3, '/', 1)) / sum(a.cost), 0), 4) as roi_day3,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d5, '/', 1)) / sum(a.cost), 0), 4) as roi_day5,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d7, '/', 1)) / sum(a.cost), 0), 4) as roi_day7,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d15, '/', 1)) / sum(a.cost), 0), 4) as roi_day15,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_m1, '/', 1)) / sum(a.cost), 0), 4) as roi_day30,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_m2, '/', 1)) / sum(a.cost), 0), 4) as roi_day60,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_m6, '/', 1)) / sum(a.cost), 0), 4) as roi_day180,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_y1, '/', 1)) / sum(a.cost), 0), 4) as roi_year1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d1, '/', 6)) / sum(cost), 0), 4) as roi_day1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d2, '/', 6)) / sum(cost), 0), 4) as roi_day2,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d3, '/', 6)) / sum(cost), 0), 4) as roi_day3,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d4, '/', 6)) / sum(cost), 0), 4) as roi_day4,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d5, '/', 6)) / sum(cost), 0), 4) as roi_day5,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d6, '/', 6)) / sum(cost), 0), 4) as roi_day6,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d7, '/', 6)) / sum(cost), 0), 4) as roi_day7,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d8, '/', 6)) / sum(cost), 0), 4) as roi_day8,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d9, '/', 6)) / sum(cost), 0), 4) as roi_day9,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d10, '/', 6)) / sum(cost), 0), 4) as roi_day10,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d11, '/', 6)) / sum(cost), 0), 4) as roi_day11,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d12, '/', 6)) / sum(cost), 0), 4) as roi_day12,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d13, '/', 6)) / sum(cost), 0), 4) as roi_day13,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d14, '/', 6)) / sum(cost), 0), 4) as roi_day14,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d15, '/', 6)) / sum(cost), 0), 4) as roi_day15,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d16, '/', 6)) / sum(cost), 0), 4) as roi_day16,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d17, '/', 6)) / sum(cost), 0), 4) as roi_day17,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d18, '/', 6)) / sum(cost), 0), 4) as roi_day18,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d19, '/', 6)) / sum(cost), 0), 4) as roi_day19,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d20, '/', 6)) / sum(cost), 0), 4) as roi_day20,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d21, '/', 6)) / sum(cost), 0), 4) as roi_day21,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d22, '/', 6)) / sum(cost), 0), 4) as roi_day22,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d23, '/', 6)) / sum(cost), 0), 4) as roi_day23,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d24, '/', 6)) / sum(cost), 0), 4) as roi_day24,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d25, '/', 6)) / sum(cost), 0), 4) as roi_day25,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d26, '/', 6)) / sum(cost), 0), 4) as roi_day26,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d27, '/', 6)) / sum(cost), 0), 4) as roi_day27,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d28, '/', 6)) / sum(cost), 0), 4) as roi_day28,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d29, '/', 6)) / sum(cost), 0), 4) as roi_day29,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m1, '/', 6)) / sum(cost), 0), 4) as roi_day30,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m2, '/', 6)) / sum(cost), 0), 4) as roi_day60,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m3, '/', 6)) / sum(cost), 0), 4) as roi_day90,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m6, '/', 6)) / sum(cost), 0), 4) as roi_day180,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_y1, '/', 6)) / sum(cost), 0), 4) as roi_year1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_sum, '/', 6)) / sum(cost), 0), 4) as roi_total,
 | 
	
		
			
				|  |  | +                          """
 | 
	
		
			
				|  |  | +                            +trendDay()+
 | 
	
		
			
				|  |  | +                          """
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m1 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m1, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m1, '/', 2) AS BIGINT))) AS trend_month1,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m2 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m2, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m2, '/', 2) AS BIGINT))) AS trend_month2,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m3 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m3, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m3, '/', 2) AS BIGINT))) AS trend_month3,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m6 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m6, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m6, '/', 2) AS BIGINT))) AS trend_month6,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_y1 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_y1, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_y1, '/', 2) AS BIGINT))) AS trend_year1,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_sum , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_sum, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_sum, '/', 2) AS BIGINT))) AS trend_total,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.register_num) > 0, sum(a.first_new_user_amount_num) / sum(a.register_num), 0), 4) as first_recharge_rate,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.register_num) > 0, sum(a.new_user_total_amount_num) / sum(a.register_num), 0), 4) as today_recharge_rate,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.first_new_user_amount_count) > 0, sum(a.first_new_user_amount) / sum(a.first_new_user_amount_count), 0), 4) as avg_first_user_recharge,
 | 
	
	
		
			
				|  | @@ -1198,14 +1448,50 @@ public class AccountAgentDayServiceImpl implements IAccountAgentDayService {
 | 
	
		
			
				|  |  |                  	round(if(sum(a.cost) > 0, sum(a.first_new_user_amount) / sum(a.cost), 0), 4) as first_recovery_rate,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.cost) > 0, sum(a.new_user_total_amount) / sum(a.cost), 0), 4) as today_recovery_rate,
 | 
	
		
			
				|  |  |                  	sum(a.gross_profit) as gross_margin,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d3, '/', 1)) / sum(a.cost), 0), 4) as roi_day3,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d5, '/', 1)) / sum(a.cost), 0), 4) as roi_day5,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d7, '/', 1)) / sum(a.cost), 0), 4) as roi_day7,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_d15, '/', 1)) / sum(a.cost), 0), 4) as roi_day15,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_m1, '/', 1)) / sum(a.cost), 0), 4) as roi_day30,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_m2, '/', 1)) / sum(a.cost), 0), 4) as roi_day60,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_m6, '/', 1)) / sum(a.cost), 0), 4) as roi_day180,
 | 
	
		
			
				|  |  | -                	round(if(sum(a.cost) > 0, sum(a.SPLIT_PART(a.amount_y1, '/', 1)) / sum(a.cost), 0), 4) as roi_year1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d1, '/', 6)) / sum(cost), 0), 4) as roi_day1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d2, '/', 6)) / sum(cost), 0), 4) as roi_day2,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d3, '/', 6)) / sum(cost), 0), 4) as roi_day3,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d4, '/', 6)) / sum(cost), 0), 4) as roi_day4,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d5, '/', 6)) / sum(cost), 0), 4) as roi_day5,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d6, '/', 6)) / sum(cost), 0), 4) as roi_day6,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d7, '/', 6)) / sum(cost), 0), 4) as roi_day7,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d8, '/', 6)) / sum(cost), 0), 4) as roi_day8,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d9, '/', 6)) / sum(cost), 0), 4) as roi_day9,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d10, '/', 6)) / sum(cost), 0), 4) as roi_day10,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d11, '/', 6)) / sum(cost), 0), 4) as roi_day11,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d12, '/', 6)) / sum(cost), 0), 4) as roi_day12,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d13, '/', 6)) / sum(cost), 0), 4) as roi_day13,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d14, '/', 6)) / sum(cost), 0), 4) as roi_day14,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d15, '/', 6)) / sum(cost), 0), 4) as roi_day15,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d16, '/', 6)) / sum(cost), 0), 4) as roi_day16,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d17, '/', 6)) / sum(cost), 0), 4) as roi_day17,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d18, '/', 6)) / sum(cost), 0), 4) as roi_day18,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d19, '/', 6)) / sum(cost), 0), 4) as roi_day19,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d20, '/', 6)) / sum(cost), 0), 4) as roi_day20,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d21, '/', 6)) / sum(cost), 0), 4) as roi_day21,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d22, '/', 6)) / sum(cost), 0), 4) as roi_day22,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d23, '/', 6)) / sum(cost), 0), 4) as roi_day23,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d24, '/', 6)) / sum(cost), 0), 4) as roi_day24,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d25, '/', 6)) / sum(cost), 0), 4) as roi_day25,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d26, '/', 6)) / sum(cost), 0), 4) as roi_day26,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d27, '/', 6)) / sum(cost), 0), 4) as roi_day27,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d28, '/', 6)) / sum(cost), 0), 4) as roi_day28,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_d29, '/', 6)) / sum(cost), 0), 4) as roi_day29,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m1, '/', 6)) / sum(cost), 0), 4) as roi_day30,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m2, '/', 6)) / sum(cost), 0), 4) as roi_day60,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m3, '/', 6)) / sum(cost), 0), 4) as roi_day90,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_m6, '/', 6)) / sum(cost), 0), 4) as roi_day180,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_y1, '/', 6)) / sum(cost), 0), 4) as roi_year1,
 | 
	
		
			
				|  |  | +                         round(if(sum(cost) > 0, sum(SPLIT_PART(amount_sum, '/', 6)) / sum(cost), 0), 4) as roi_total,
 | 
	
		
			
				|  |  | +                        """
 | 
	
		
			
				|  |  | +                +trendDay()+
 | 
	
		
			
				|  |  | +                        """
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m1 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m1, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m1, '/', 2) AS BIGINT))) AS trend_month1,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m2 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m2, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m2, '/', 2) AS BIGINT))) AS trend_month2,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m3 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m3, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m3, '/', 2) AS BIGINT))) AS trend_month3,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_m6 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m6, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_m6, '/', 2) AS BIGINT))) AS trend_month6,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_y1 , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_y1, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_y1, '/', 2) AS BIGINT))) AS trend_year1,
 | 
	
		
			
				|  |  | +                         CONCAT(SUM(CAST(SPLIT_PART(amount_sum , '/', 1) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_sum, '/', 6) AS DECIMAL(10, 2))),'/',SUM(CAST(SPLIT_PART(amount_sum, '/', 2) AS BIGINT))) AS trend_total,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.register_num) > 0, sum(a.first_new_user_amount_num) / sum(a.register_num), 0), 4) as first_recharge_rate,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.register_num) > 0, sum(a.new_user_total_amount_num) / sum(a.register_num), 0), 4) as today_recharge_rate,
 | 
	
		
			
				|  |  |                  	round(if(sum(a.first_new_user_amount_count) > 0, sum(a.first_new_user_amount) / sum(a.first_new_user_amount_count), 0), 4) as avg_first_user_recharge,
 |