Browse Source

Merge remote-tracking branch 'origin/master'

kk 2 months ago
parent
commit
69d086d13c

+ 1 - 1
game-business/src/main/java/com/game/business/mapper/AppUserAgentMapper.java

@@ -66,7 +66,7 @@ public interface AppUserAgentMapper extends BaseMapper<AppUserAgent> {
      * 根据日期统计投资金额
      *
      */
-    public int sumBetting(@Param("beginTime") String beginTime, @Param("endTime") String endTime,@Param("pid") Long pid);
+    public Double sumBetting(@Param("beginTime") String beginTime, @Param("endTime") String endTime,@Param("pid") Long pid);
 
     /**
      * 查询团队列表

+ 1 - 1
game-business/src/main/java/com/game/business/service/IAppUserAgentService.java

@@ -73,7 +73,7 @@ public interface IAppUserAgentService extends IService<AppUserAgent> {
     /**
      * 统计用户团队投注金额
      * */
-    public double sumBetting(String beginTime,String endTime,Long pid);
+    public Double sumBetting(String beginTime,String endTime,Long pid);
 
     /**
      * 修改代理设置

+ 1 - 1
game-business/src/main/java/com/game/business/service/impl/AppUserAgentServiceImpl.java

@@ -144,7 +144,7 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
      * 统计用户团队投注金额
      * */
     @Override
-    public double sumBetting(String beginTime,String endTime,Long pid) {
+    public Double sumBetting(String beginTime,String endTime,Long pid) {
         return appUserAgentMapper.sumBetting(beginTime,endTime,pid);
     }
 

+ 5 - 5
game-business/src/main/resources/mapper/business/AppUserAgentMapper.xml

@@ -89,8 +89,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
-    <select id="sumBetting" resultType="java.lang.Integer">
-        select sum(betting_amount) as amount
+    <select id="sumBetting" resultType="java.lang.Double">
+        select IFNULL(sum(betting_amount),0) as amount
         from app_user_agent as a left join app_game_betting as b on a.user_id = b.user_id
         where b.create_time between #{beginTime} and #{endTime}
         and a.pid = #{pid}
@@ -101,9 +101,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.user_id as userId,
             c.nickname as nickName,
             a.pid as pid,
-            (select sum(betting_amount) from app_game_betting as b where b.user_id = a.user_id) as bettingAmount,
-            (select sum(d.live_commission + d.game_commission) from app_user_count as d where d.user_id = a.user_id) as commission,
-            (select sum(e.game_win_amount - e.game_lose_amount) from app_user_count as e where e.user_id = a.user_id) as gameAmount,
+            (select IFNULL(sum(betting_amount),0) from app_game_betting as b where b.user_id = a.user_id) as bettingAmount,
+            (select IFNULL(sum(d.live_commission + d.game_commission),0) from app_user_count as d where d.user_id = a.user_id) as commission,
+            (select IFNULL(sum(e.game_win_amount - e.game_lose_amount),0) from app_user_count as e where e.user_id = a.user_id) as gameAmount,
             a.live_rate as liveRate,
             a.dividend_guarantee_rate as dividendGuaranteeRate
         from app_user_agent as a left join mugozbg_live.app_user as c on a.user_id = c.userid where a.pid = #{teamDto.pid}