ソースを参照

feat(business): 添加参与者管理功能

- 新增 Participants 相关的实体类、控制器、服务接口及其实现、Mapper 接口及其 XML 文件
- 在 TournamentsServiceImpl 中集成 ParticipantsMapper,用于获取报名人数
- 在 TournamentsVo 中添加 signNum 字段,用于存储报名人数
fugui001 5 ヶ月 前
コミット
7fae516b71

+ 105 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/controller/ParticipantsController.java

@@ -0,0 +1,105 @@
+package org.dromara.business.controller;
+
+import java.util.List;
+
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.*;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.dromara.business.domain.bo.ParticipantsBo;
+import org.dromara.business.domain.vo.ParticipantsVo;
+import org.dromara.business.service.IParticipantsService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.web.core.BaseController;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.utils.ExcelUtil;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】
+ *
+ * @author Lion Li
+ * @date 2025-07-08
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/business/participants")
+public class ParticipantsController extends BaseController {
+
+    private final IParticipantsService participantsService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @SaCheckPermission("business:participants:list")
+    @GetMapping("/list")
+    public TableDataInfo<ParticipantsVo> list(ParticipantsBo bo, PageQuery pageQuery) {
+        return participantsService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @SaCheckPermission("business:participants:export")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(ParticipantsBo bo, HttpServletResponse response) {
+        List<ParticipantsVo> list = participantsService.queryList(bo);
+        ExcelUtil.exportExcel(list, "【请填写功能名称】", ParticipantsVo.class, response);
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     *
+     * @param id 主键
+     */
+    @SaCheckPermission("business:participants:query")
+    @GetMapping("/{id}")
+    public R<ParticipantsVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable Long id) {
+        return R.ok(participantsService.queryById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @SaCheckPermission("business:participants:add")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody ParticipantsBo bo) {
+        return toAjax(participantsService.insertByBo(bo));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @SaCheckPermission("business:participants:edit")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody ParticipantsBo bo) {
+        return toAjax(participantsService.updateByBo(bo));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     *
+     * @param ids 主键串
+     */
+    @SaCheckPermission("business:participants:remove")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable Long[] ids) {
+        return toAjax(participantsService.deleteWithValidByIds(List.of(ids), true));
+    }
+}

+ 67 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/Participants.java

@@ -0,0 +1,67 @@
+package org.dromara.business.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import java.util.Date;
+import java.io.Serial;
+/**
+ * 【请填写功能名称】对象 participants
+ *
+ * @author Lion Li
+ * @date 2025-07-08
+ */
+@Data
+@TableName("participants")
+public class Participants{
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     *
+     */
+    private Long tournamentId;
+
+    /**
+     * 玩家唯一标识
+     */
+    private Long playerId;
+
+    /**
+     * 玩家姓名
+     */
+    private String name;
+
+    /**
+     * 玩家手机号
+     */
+    private String mobile;
+
+    /**
+     * 头像地址
+     */
+    private String avatar;
+
+    /**
+     * 当前记分牌数量
+     */
+    private Long currentChips;
+
+    /**
+     * 报名时间
+     */
+    private Date registrationTime;
+
+    /**
+     * 状态,0-正常,1-已淘汰
+     */
+    private Long status;
+
+
+}

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

@@ -0,0 +1,74 @@
+package org.dromara.business.domain.bo;
+import org.dromara.business.domain.Participants;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import jakarta.validation.constraints.*;
+import java.util.Date;
+
+/**
+ * 【请填写功能名称】业务对象 participants
+ *
+ * @author Lion Li
+ * @date 2025-07-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = Participants.class, reverseConvertGenerate = false)
+public class ParticipantsBo extends BaseEntity {
+
+    /**
+     *
+     */
+    @NotNull(message = "不能为空", groups = { EditGroup.class })
+    private Long id;
+
+    /**
+     *
+     */
+    @NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long tournamentId;
+
+    /**
+     * 玩家唯一标识
+     */
+    @NotNull(message = "玩家唯一标识不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long playerId;
+
+    /**
+     * 玩家姓名
+     */
+    @NotBlank(message = "玩家姓名不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String name;
+
+    /**
+     * 玩家手机号
+     */
+    private String mobile;
+
+    /**
+     * 头像地址
+     */
+    private String avatar;
+
+    /**
+     * 当前记分牌数量
+     */
+    @NotNull(message = "当前记分牌数量不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long currentChips;
+
+    /**
+     * 报名时间
+     */
+    private Date registrationTime;
+
+    /**
+     * 状态,0-正常,1-已淘汰
+     */
+    private Long status;
+
+
+}

+ 81 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/vo/ParticipantsVo.java

@@ -0,0 +1,81 @@
+package org.dromara.business.domain.vo;
+
+import java.util.Date;
+import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
+import cn.idev.excel.annotation.ExcelProperty;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import org.dromara.business.domain.Participants;
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * 【请填写功能名称】视图对象 participants
+ *
+ * @author Lion Li
+ * @date 2025-07-08
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = Participants.class)
+public class ParticipantsVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @ExcelProperty(value = "")
+    private Long id;
+
+    /**
+     *
+     */
+    @ExcelProperty(value = "")
+    private Long tournamentId;
+
+    /**
+     * 玩家唯一标识
+     */
+    @ExcelProperty(value = "玩家唯一标识")
+    private Long playerId;
+
+    /**
+     * 玩家姓名
+     */
+    @ExcelProperty(value = "玩家姓名")
+    private String name;
+
+    /**
+     * 玩家手机号
+     */
+    @ExcelProperty(value = "玩家手机号")
+    private String mobile;
+
+    /**
+     * 头像地址
+     */
+    @ExcelProperty(value = "头像地址")
+    private String avatar;
+
+    /**
+     * 当前记分牌数量
+     */
+    @ExcelProperty(value = "当前记分牌数量")
+    private Long currentChips;
+
+    /**
+     * 报名时间
+     */
+    @ExcelProperty(value = "报名时间")
+    private Date registrationTime;
+
+    /**
+     * 状态,0-正常,1-已淘汰
+     */
+    @ExcelProperty(value = "状态,0-正常,1-已淘汰")
+    private Long status;
+
+
+}

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

@@ -125,4 +125,10 @@ public class TournamentsVo implements Serializable {
     private String blindStructuresName;
 
     private String tournamentsBiId;
+
+    /**
+     * 报名人数
+     */
+    private int signNum;
+
 }

+ 47 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/mapper/ParticipantsMapper.java

@@ -0,0 +1,47 @@
+package org.dromara.business.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
+import org.dromara.business.domain.Participants;
+import org.dromara.business.domain.vo.ParticipantsVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author Lion Li
+ * @date 2025-07-08
+ */
+@DS("mysql2")
+public interface ParticipantsMapper extends BaseMapperPlus<Participants, ParticipantsVo> {
+
+    @InterceptorIgnore(tenantLine = "true")
+    int updateParticipants(Participants update);
+
+    @InterceptorIgnore(tenantLine = "true")
+    int insertParticipants(Participants insert);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Page<ParticipantsVo> selectVoPage(@Param("page") Page<Participants> page, @Param("ew") Wrapper<Participants> wrapper);
+
+    @InterceptorIgnore(tenantLine = "true")
+    ParticipantsVo selectParticipantsById(Long id);
+
+    @InterceptorIgnore(tenantLine = "true")
+    int deleteParticipantsById(@Param("ids") Collection<Long> ids);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<ParticipantsVo> selectParticipantsList(@Param("ew") Wrapper<Participants> wrapper);
+
+
+    @InterceptorIgnore(tenantLine = "true")
+    int selectParticipantsTotal(@Param("tournamentId") Long tournamentId);
+
+
+}

+ 67 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/service/IParticipantsService.java

@@ -0,0 +1,67 @@
+package org.dromara.business.service;
+
+import org.dromara.business.domain.bo.ParticipantsBo;
+import org.dromara.business.domain.vo.ParticipantsVo;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author Lion Li
+ * @date 2025-07-08
+ */
+public interface IParticipantsService {
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 主键
+     * @return 【请填写功能名称】
+     */
+    ParticipantsVo queryById(Long id);
+
+    /**
+     * 分页查询【请填写功能名称】列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 【请填写功能名称】分页列表
+     */
+    TableDataInfo<ParticipantsVo> queryPageList(ParticipantsBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的【请填写功能名称】列表
+     *
+     * @param bo 查询条件
+     * @return 【请填写功能名称】列表
+     */
+    List<ParticipantsVo> queryList(ParticipantsBo bo);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(ParticipantsBo bo);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(ParticipantsBo bo);
+
+    /**
+     * 校验并批量删除【请填写功能名称】信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

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

@@ -0,0 +1,138 @@
+package org.dromara.business.service.impl;
+
+import org.dromara.business.domain.Participants;
+import org.dromara.business.domain.bo.ParticipantsBo;
+import org.dromara.business.domain.vo.ParticipantsVo;
+import org.dromara.business.mapper.ParticipantsMapper;
+import org.dromara.business.service.IParticipantsService;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author Lion Li
+ * @date 2025-07-08
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class ParticipantsServiceImpl implements IParticipantsService {
+
+    private final ParticipantsMapper baseMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public ParticipantsVo queryById(Long id){
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询【请填写功能名称】列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 【请填写功能名称】分页列表
+     */
+    @Override
+    public TableDataInfo<ParticipantsVo> queryPageList(ParticipantsBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<Participants> lqw = buildQueryWrapper(bo);
+        Page<ParticipantsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的【请填写功能名称】列表
+     *
+     * @param bo 查询条件
+     * @return 【请填写功能名称】列表
+     */
+    @Override
+    public List<ParticipantsVo> queryList(ParticipantsBo bo) {
+        LambdaQueryWrapper<Participants> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<Participants> buildQueryWrapper(ParticipantsBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<Participants> lqw = Wrappers.lambdaQuery();
+        lqw.orderByAsc(Participants::getId);
+        lqw.eq(bo.getTournamentId() != null, Participants::getTournamentId, bo.getTournamentId());
+        lqw.eq(bo.getPlayerId() != null, Participants::getPlayerId, bo.getPlayerId());
+        lqw.like(StringUtils.isNotBlank(bo.getName()), Participants::getName, bo.getName());
+        lqw.eq(StringUtils.isNotBlank(bo.getMobile()), Participants::getMobile, bo.getMobile());
+        lqw.eq(StringUtils.isNotBlank(bo.getAvatar()), Participants::getAvatar, bo.getAvatar());
+        lqw.eq(bo.getCurrentChips() != null, Participants::getCurrentChips, bo.getCurrentChips());
+        lqw.eq(bo.getRegistrationTime() != null, Participants::getRegistrationTime, bo.getRegistrationTime());
+        lqw.eq(bo.getStatus() != null, Participants::getStatus, bo.getStatus());
+        return lqw;
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(ParticipantsBo bo) {
+        Participants add = MapstructUtils.convert(bo, Participants.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param bo 【请填写功能名称】
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(ParticipantsBo bo) {
+        Participants update = MapstructUtils.convert(bo, Participants.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(Participants entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除【请填写功能名称】信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+}

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

@@ -63,6 +63,7 @@ public class TournamentsServiceImpl implements ITournamentsService {
 
     private final ISysOssService ossService;
 
+    private final ParticipantsMapper participantsMapper;
 
     /**
      * 查询【请填写功能名称】
@@ -116,7 +117,8 @@ public class TournamentsServiceImpl implements ITournamentsService {
             String statusText= GameStatus.getDescriptionFromCode(tournamentsVo.getStatus());
             tournamentsVo.setStatusText(statusText);
         }
-
+        int totalSignNum = participantsMapper.selectParticipantsTotal(tournamentId);
+        tournamentsVo.setSignNum(totalSignNum);
         return tournamentsVo;
     }
 
@@ -176,10 +178,10 @@ public class TournamentsServiceImpl implements ITournamentsService {
                 record.setItemsPrizeList(itemsPrizeList);
             }
 
-
+            int totalSignNum = participantsMapper.selectParticipantsTotal(tournamentId);
+            record.setSignNum(totalSignNum);
         }
 
-
         return TableDataInfo.build(result);
     }
 

+ 82 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/business/ParticipantsMapper.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.dromara.business.mapper.ParticipantsMapper">
+
+
+    <insert id="insertParticipants">
+        INSERT INTO participants
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tournamentId != null">tournament_id,</if>
+            <if test="playerId != null">player_id,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="mobile != null and mobile != ''">mobile,</if>
+            <if test="avatar != null and avatar != ''">avatar,</if>
+            <if test="currentChips != null">current_chips,</if>
+            <if test="registrationTime != null">registration_time,</if>
+            <if test="status != null">status,</if>
+        </trim>
+        VALUES
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tournamentId != null">#{tournamentId},</if>
+            <if test="playerId != null">#{playerId},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="mobile != null and mobile != ''">#{mobile},</if>
+            <if test="avatar != null and avatar != ''">#{avatar},</if>
+            <if test="currentChips != null">#{currentChips},</if>
+            <if test="registrationTime != null">#{registrationTime},</if>
+            <if test="status != null">#{status},</if>
+        </trim>
+    </insert>
+
+
+    <update id="updateParticipants" >
+        UPDATE participants
+        <set>
+            <if test="tournamentId != null">tournament_id = #{tournamentId},</if>
+            <if test="playerId != null">player_id = #{playerId},</if>
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
+            <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
+            <if test="currentChips != null">current_chips = #{currentChips},</if>
+            <if test="registrationTime != null">registration_time = #{registrationTime},</if>
+            <if test="status != null">status = #{status},</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+
+    <select id="selectVoPage" parameterType="org.dromara.business.domain.Participants" resultType="org.dromara.business.domain.vo.ParticipantsVo">
+        SELECT *
+        FROM participants
+        <where>
+            <if test="id != null">AND id = #{id}</if>
+            <if test="tournamentId != null">AND tournament_id = #{tournamentId}</if>
+            <if test="playerId != null">AND player_id = #{playerId}</if>
+            <if test="name != null and name != ''">AND name LIKE CONCAT('%', #{name}, '%')</if>
+            <if test="mobile != null and mobile != ''">AND mobile = #{mobile}</if>
+            <if test="status != null">AND status = #{status}</if>
+        </where>
+    </select>
+
+    <select id="selectParticipantsById" parameterType="int" resultType="org.dromara.business.domain.vo.ParticipantsVo">
+        SELECT * FROM participants WHERE id = #{id}
+    </select>
+
+    <delete id="deleteParticipantsById" parameterType="int">
+        DELETE FROM participants WHERE id = #{id}
+    </delete>
+
+
+    <select id="selectParticipantsList" resultType="org.dromara.business.domain.vo.ParticipantsVo">
+        SELECT * FROM participants
+    </select>
+
+
+
+    <select id="selectParticipantsTotal" parameterType="Long" resultType="int">
+        SELECT IFNULL(count(*),0) total FROM participants WHERE tournament_id = #{tournamentId}
+    </select>
+
+</mapper>