|
|
@@ -3,36 +3,39 @@
|
|
|
<mapper namespace="com.kxs.user.biz.mapper.old.TradeDaySummaryMapper">
|
|
|
|
|
|
|
|
|
- <select id="currentMonthsTotal" resultType="com.kxs.user.api.vo.kxsapp.userLevel.AmountDetailVO">
|
|
|
+ <select id="currentMonthsPosTotal" resultType="java.math.BigDecimal">
|
|
|
|
|
|
- select IFNULL(sum(HelpNonDirectTradeAmt + HelpNonDirectDebitTradeAmt + NotHelpNonDirectTradeAmt +
|
|
|
- NotHelpNonDirectDebitTradeAmt + ProfitNonDirectTradeAmt + ProfitNonDirectDebitTradeAmt) +
|
|
|
- pos2.posAmount2,0) as pos,
|
|
|
- IFNULL(gd.gdCount, 0) as gd,
|
|
|
- IFNULL(zlb, 0) as zlb
|
|
|
+ select IFNULL(SUM(HelpNonDirectTradeAmt + HelpNonDirectDebitTradeAmt + NotHelpNonDirectTradeAmt + NotHelpNonDirectDebitTradeAmt + ProfitNonDirectTradeAmt + ProfitNonDirectDebitTradeAmt),
|
|
|
+ 0) as pos
|
|
|
from TradeDaySummary pos
|
|
|
- left join (select sum(ProfitTradeAmt + ProfitDebitTradeAmt) as posAmount2, UserId
|
|
|
- from TradeDaySummary2
|
|
|
- where UserId = #{userId}
|
|
|
- and TradeMonth = #{queryMonth}
|
|
|
- and SeoTitle = 'team'
|
|
|
- GROUP BY TradeMonth) pos2 on pos2.UserId = pos.UserId
|
|
|
- left join (select sum(ActiveBuddyMerStatus) as gdCount, UserId
|
|
|
- from UserTradeMonthSummary
|
|
|
- where UserId = #{userId}
|
|
|
- and SeoTitle = 'team'
|
|
|
- and BrandId = 14) gd on gd.UserId = pos.UserId
|
|
|
-
|
|
|
- left join (select sum(TradeAmount) as zlb, UserId
|
|
|
- from HelpProfitUserTradeSummay
|
|
|
- where UserId = #{userId}
|
|
|
- and TradeMonth = #{queryMonth}
|
|
|
- and SeoTitle = 'team'
|
|
|
- GROUP BY TradeMonth) zlb on zlb.UserId = pos.UserId
|
|
|
where pos.UserId = #{userId}
|
|
|
and pos.TradeMonth = #{queryMonth}
|
|
|
and pos.SeoTitle = 'team'
|
|
|
group by pos.TradeMonth
|
|
|
|
|
|
</select>
|
|
|
+ <select id="currentMonthsPosTotal2" resultType="java.math.BigDecimal">
|
|
|
+ select IFNULL(SUM(ProfitTradeAmt + ProfitDebitTradeAmt), 0) as posAmount2
|
|
|
+ from TradeDaySummary2
|
|
|
+ where UserId = #{userId}
|
|
|
+ and TradeMonth = #{queryMonth}
|
|
|
+ and SeoTitle = 'team'
|
|
|
+ GROUP BY TradeMonth
|
|
|
+ </select>
|
|
|
+ <select id="currentMonthsGdTotal" resultType="java.lang.Integer">
|
|
|
+ select IFNULL(SUM(ActiveBuddyMerStatus), 0) as gdCount
|
|
|
+ from UserTradeMonthSummary
|
|
|
+ where UserId = #{userId}
|
|
|
+ and SeoTitle = 'team'
|
|
|
+ and BrandId = 14
|
|
|
+ GROUP BY UserId
|
|
|
+ </select>
|
|
|
+ <select id="currentMonthsZlbTotal" resultType="java.math.BigDecimal">
|
|
|
+ select IFNULL(SUM(TradeAmount), 0) as zlb
|
|
|
+ from HelpProfitUserTradeSummay
|
|
|
+ where UserId = #{userId}
|
|
|
+ and TradeMonth = #{queryMonth}
|
|
|
+ and SeoTitle = 'team'
|
|
|
+ GROUP BY TradeMonth
|
|
|
+ </select>
|
|
|
</mapper>
|