소스 검색

feat(business): 增加查询桌次对应局数功能- 在 HandHistoryBo 中添加 tableId 字段
- 新增 selectAllHandNumber 方法用于查询指定桌次的局数
- 更新 HandHistoryMapper 和 XML 文件以支持新功能
- 在 HandHistoryVo 中添加 tableId 字段用于展示桌次信息

fugui001 4 달 전
부모
커밋
3e440444da

+ 6 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/controller/HandHistoryController.java

@@ -114,6 +114,12 @@ public class HandHistoryController extends BaseController {
         return R.ok(handHistoryService.selectAllHandZhuoCi(bo));
     }
 
+    @SaCheckPermission("business:history:selectAllHandNumber")
+    @Log(title = "【查询桌次对应局数】")
+    @PostMapping("/selectAllHandNumber")
+    public R<List<HandHistoryVo>> selectAllHandNumber(HandHistoryBo bo) {
+        return R.ok(handHistoryService.selectAllHandNumber(bo));
+    }
 
 
     @SaCheckPermission("business:history:getPlayHistoryInfo")

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/bo/HandHistoryBo.java

@@ -89,4 +89,6 @@ public class HandHistoryBo extends BaseEntity {
 
     private Long historyId;
 
+    private Long tableId;
+
 }

+ 6 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/vo/HandHistoryVo.java

@@ -51,7 +51,7 @@ public class HandHistoryVo implements Serializable {
     private String involvedPlayers;
 
     /**
-     *
+     *  局数
      */
     @ExcelProperty(value = "")
     private Long handNumber;
@@ -107,5 +107,10 @@ public class HandHistoryVo implements Serializable {
      */
     private String parseBlindsInfo;
 
+    /**
+     * 桌次
+     */
+    private Long tableId;
+
 
 }

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/mapper/HandHistoryMapper.java

@@ -24,4 +24,9 @@ public interface HandHistoryMapper extends BaseMapperPlus<HandHistory, HandHisto
      @InterceptorIgnore(tenantLine = "true")
      List<HandHistoryVo> selectAllHandZhuoCi(@Param("tournamentId") Long tournamentId,@Param("playerId") Long playerId);
 
+     @InterceptorIgnore(tenantLine = "true")
+     List<HandHistoryVo> selectAllHandNumber(@Param("tournamentId") Long tournamentId,@Param("tableId") Long tableId);
+
+
+
 }

+ 7 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/service/IHandHistoryService.java

@@ -75,6 +75,13 @@ public interface IHandHistoryService {
      */
     List<HandHistoryVo> selectAllHandZhuoCi(HandHistoryBo bo);
 
+    /**
+     * 查询局数
+     * @param bo
+     * @return
+     */
+    List<HandHistoryVo> selectAllHandNumber(HandHistoryBo bo);
+
 
 
 }

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/service/impl/HandHistoryServiceImpl.java

@@ -192,5 +192,10 @@ public class HandHistoryServiceImpl implements IHandHistoryService {
          return baseMapper.selectAllHandZhuoCi(bo.getTournamentId(),bo.getPlayerId());
     }
 
+    @Override
+    public List<HandHistoryVo> selectAllHandNumber(HandHistoryBo bo) {
+        return baseMapper.selectAllHandNumber(bo.getTournamentId(),bo.getTableId());
+    }
+
 
 }

+ 14 - 3
ruoyi-modules/ruoyi-system/src/main/resources/mapper/business/HandHistoryMapper.xml

@@ -23,9 +23,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectAllHandZhuoCi" resultType="org.dromara.business.domain.vo.HandHistoryVo">
-        select * from  hand_history where id in (
-            select  hand_history_id from    player_hand_history where player_id=#{playerId}
-        )  and  tournament_id=#{tournamentId}   ORDER BY created_at asc
+        SELECT hh.table_id
+        FROM hand_history hh
+                 INNER JOIN player_hand_history phh ON hh.id = phh.hand_history_id
+        WHERE phh.player_id =#{playerId}
+          AND hh.tournament_id = #{tournamentId} AND   hh.table_id!=0
+        GROUP BY hh.table_id
+        ORDER BY hh.table_id ASC
+    </select>
+
+
+
+    <select id="selectAllHandNumber" resultType="org.dromara.business.domain.vo.HandHistoryVo">
+        select * from  hand_history where table_id = #{tableId}  and  tournament_id=#{tournamentId}
+        ORDER BY created_at asc
     </select>