Kaynağa Gözat

feat(physical): 新增线下用户报名功能模块

- 创建线下用户报名实体类及对应表结构
- 实现报名信息的增删改查接口
- 支持分页查询与导出功能
- 关联用户与赛事信息展示
- 提供业务校验与数据转换逻辑
fugui001 3 hafta önce
ebeveyn
işleme
cbc3710569

+ 105 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/controller/PhysicalParticipantsController.java

@@ -0,0 +1,105 @@
+package org.dromara.physical.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.physical.domain.bo.PhysicalParticipantsBo;
+import org.dromara.physical.domain.vo.PhysicalParticipantsVo;
+import org.dromara.physical.service.IPhysicalParticipantsService;
+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-11-28
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/physical/participants")
+public class PhysicalParticipantsController extends BaseController {
+
+    private final IPhysicalParticipantsService physicalParticipantsService;
+
+    /**
+     * 查询线下用户报名列表
+     */
+    @SaCheckPermission("physical:participants:list")
+    @GetMapping("/list")
+    public TableDataInfo<PhysicalParticipantsVo> list(PhysicalParticipantsBo bo, PageQuery pageQuery) {
+        return physicalParticipantsService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出线下用户报名列表
+     */
+    @SaCheckPermission("physical:participants:export")
+    @Log(title = "线下用户报名", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(PhysicalParticipantsBo bo, HttpServletResponse response) {
+        List<PhysicalParticipantsVo> list = physicalParticipantsService.queryList(bo);
+        ExcelUtil.exportExcel(list, "线下用户报名", PhysicalParticipantsVo.class, response);
+    }
+
+    /**
+     * 获取线下用户报名详细信息
+     *
+     * @param id 主键
+     */
+    @SaCheckPermission("physical:participants:query")
+    @GetMapping("/{id}")
+    public R<PhysicalParticipantsVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable Long id) {
+        return R.ok(physicalParticipantsService.queryById(id));
+    }
+
+    /**
+     * 新增线下用户报名
+     */
+    @SaCheckPermission("physical:participants:add")
+    @Log(title = "线下用户报名", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody PhysicalParticipantsBo bo) {
+        return toAjax(physicalParticipantsService.insertByBo(bo));
+    }
+
+    /**
+     * 修改线下用户报名
+     */
+    @SaCheckPermission("physical:participants:edit")
+    @Log(title = "线下用户报名", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody PhysicalParticipantsBo bo) {
+        return toAjax(physicalParticipantsService.updateByBo(bo));
+    }
+
+    /**
+     * 删除线下用户报名
+     *
+     * @param ids 主键串
+     */
+    @SaCheckPermission("physical:participants:remove")
+    @Log(title = "线下用户报名", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable Long[] ids) {
+        return toAjax(physicalParticipantsService.deleteWithValidByIds(List.of(ids), true));
+    }
+}

+ 92 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/domain/PhysicalParticipants.java

@@ -0,0 +1,92 @@
+package org.dromara.physical.domain;
+
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.util.Date;
+
+import java.io.Serial;
+
+/**
+ * 线下用户报名对象 physical_participants
+ *
+ * @author Lion Li
+ * @date 2025-11-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("physical_participants")
+public class PhysicalParticipants extends BaseEntity {
+
+    @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;
+
+    /**
+     * rebuy次数
+     */
+    private Long rebuy;
+
+    /**
+     * 淘汰时间,用于重启后排名
+     */
+    private Date eliminatedTime;
+
+    /**
+     * 报名时间
+     */
+    private Date registrationTime;
+
+    /**
+     * 状态,0-正常,1-已淘汰
+     */
+    private Long status;
+
+    /**
+     * 最终名次
+     */
+    private Long finalRank;
+
+    /**
+     * 获得奖励
+     */
+    private String finalReward;
+
+
+}

+ 97 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/domain/bo/PhysicalParticipantsBo.java

@@ -0,0 +1,97 @@
+package org.dromara.physical.domain.bo;
+
+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 org.dromara.physical.domain.PhysicalParticipants;
+
+import java.util.Date;
+
+/**
+ * 线下用户报名业务对象 physical_participants
+ *
+ * @author Lion Li
+ * @date 2025-11-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = PhysicalParticipants.class, reverseConvertGenerate = false)
+public class PhysicalParticipantsBo 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;
+
+    /**
+     * rebuy次数
+     */
+    private Long rebuy;
+
+    /**
+     * 淘汰时间,用于重启后排名
+     */
+    private Date eliminatedTime;
+
+    /**
+     * 报名时间
+     */
+    private Date registrationTime;
+
+    /**
+     * 状态,0-正常,1-已淘汰
+     */
+    private Long status;
+
+    /**
+     * 最终名次
+     */
+    private Long finalRank;
+
+    /**
+     * 获得奖励
+     */
+    private String finalReward;
+
+
+    private String userName;
+}

+ 132 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/domain/vo/PhysicalParticipantsVo.java

@@ -0,0 +1,132 @@
+package org.dromara.physical.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.physical.domain.PhysicalParticipants;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+
+
+/**
+ * 线下用户报名视图对象 physical_participants
+ *
+ * @author Lion Li
+ * @date 2025-11-28
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = PhysicalParticipants.class)
+public class PhysicalParticipantsVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @ExcelProperty(value = "编号")
+    private Long id;
+
+    /**
+     *
+     */
+    @ExcelProperty(value = "赛事ID")
+    private Long tournamentId;
+
+
+     /**
+     * 赛事名称
+     */
+    @ExcelProperty(value = "赛事名称")
+    private String tournamentsName;
+
+
+    @ExcelProperty(value = "赛事状态")
+    private String statusText;
+
+     /**
+     * 玩家唯一标识
+     */
+    //@ExcelProperty(value = "报名用户ID")
+    private Long playerId;
+    /**
+     * 玩家姓名
+     */
+    @ExcelProperty(value = "报名用户")
+    private String name;
+
+
+       /**
+     * 玩家手机号
+     */
+    @ExcelProperty(value = "手机号")
+    private String mobile;
+
+
+    @ExcelProperty(value = "报名条件")
+    public String tournamentCondition;
+
+    /**
+     * 报名时间
+     */
+    @ExcelProperty(value = "报名时间")
+    private Date registrationTime;
+
+
+    /**
+     * 头像地址
+     */
+    //@ExcelProperty(value = "头像地址")
+    private String avatar;
+
+    /**
+     * 当前记分牌数量
+     */
+    //@ExcelProperty(value = "当前记分牌数量")
+    private Long currentChips;
+
+    /**
+     * rebuy次数
+     */
+    //@ExcelProperty(value = "rebuy次数")
+    private Long rebuy;
+
+    /**
+     * 淘汰时间,用于重启后排名
+     */
+    //@ExcelProperty(value = "淘汰时间,用于重启后排名")
+    private Date eliminatedTime;
+
+
+
+    /**
+     * 状态,0-正常,1-已淘汰
+     */
+    //@ExcelProperty(value = "状态,0-正常,1-已淘汰")
+    private Long status;
+
+
+
+
+
+
+    //@ExcelProperty(value = "报名用户")
+    private String userName;
+    /**
+     * 手机号
+     */
+    //@ExcelProperty(value = "手机号")
+    private String phone;
+
+
+
+
+
+
+
+}

+ 30 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/mapper/PhysicalParticipantsMapper.java

@@ -0,0 +1,30 @@
+package org.dromara.physical.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.common.mybatis.core.mapper.BaseMapperPlus;
+import org.dromara.physical.domain.PhysicalParticipants;
+import org.dromara.physical.domain.vo.PhysicalParticipantsVo;
+
+import java.util.List;
+
+
+/**
+ * 线下用户报名Mapper接口
+ *
+ * @author Lion Li
+ * @date 2025-11-28
+ */
+@DS("mysql2")
+public interface PhysicalParticipantsMapper extends BaseMapperPlus<PhysicalParticipants, PhysicalParticipantsVo> {
+
+     @InterceptorIgnore(tenantLine = "true")
+     Page<PhysicalParticipantsVo> selectPhysicalParticipantsAllPage(@Param("page") Page<PhysicalParticipants> page, @Param("ew") Wrapper<PhysicalParticipants> wrapper);
+
+     @InterceptorIgnore(tenantLine = "true")
+     List<PhysicalParticipantsVo> selectPhysicalParticipantsList(@Param("ew") Wrapper<PhysicalParticipants> wrapper);
+
+}

+ 68 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/service/IPhysicalParticipantsService.java

@@ -0,0 +1,68 @@
+package org.dromara.physical.service;
+
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.physical.domain.bo.PhysicalParticipantsBo;
+import org.dromara.physical.domain.vo.PhysicalParticipantsVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 线下用户报名Service接口
+ *
+ * @author Lion Li
+ * @date 2025-11-28
+ */
+public interface IPhysicalParticipantsService {
+
+    /**
+     * 查询线下用户报名
+     *
+     * @param id 主键
+     * @return 线下用户报名
+     */
+    PhysicalParticipantsVo queryById(Long id);
+
+    /**
+     * 分页查询线下用户报名列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 线下用户报名分页列表
+     */
+    TableDataInfo<PhysicalParticipantsVo> queryPageList(PhysicalParticipantsBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的线下用户报名列表
+     *
+     * @param bo 查询条件
+     * @return 线下用户报名列表
+     */
+    List<PhysicalParticipantsVo> queryList(PhysicalParticipantsBo bo);
+
+    /**
+     * 新增线下用户报名
+     *
+     * @param bo 线下用户报名
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(PhysicalParticipantsBo bo);
+
+    /**
+     * 修改线下用户报名
+     *
+     * @param bo 线下用户报名
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(PhysicalParticipantsBo bo);
+
+    /**
+     * 校验并批量删除线下用户报名信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 221 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/service/impl/PhysicalParticipantsServiceImpl.java

@@ -0,0 +1,221 @@
+package org.dromara.physical.service.impl;
+
+import org.dromara.business.domain.enums.GameStatus;
+import org.dromara.business.domain.vo.TournamentEntryConditionsVo;
+import org.dromara.business.domain.vo.TournamentsVo;
+import org.dromara.business.domain.vo.UserVo;
+import org.dromara.business.mapper.UserMapper;
+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.dromara.physical.domain.PhysicalParticipants;
+import org.dromara.physical.domain.bo.PhysicalParticipantsBo;
+import org.dromara.physical.domain.vo.PhysicalParticipantsVo;
+import org.dromara.physical.domain.vo.PhysicalTournamentEntryConditionsVo;
+import org.dromara.physical.domain.vo.PhysicalTournamentsVo;
+import org.dromara.physical.mapper.PhysicalParticipantsMapper;
+import org.dromara.physical.mapper.PhysicalTournamentEntryConditionsMapper;
+import org.dromara.physical.mapper.PhysicalTournamentsMapper;
+import org.dromara.physical.service.IPhysicalParticipantsService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * 线下用户报名Service业务层处理
+ *
+ * @author Lion Li
+ * @date 2025-11-28
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class PhysicalParticipantsServiceImpl implements IPhysicalParticipantsService {
+
+    private final PhysicalParticipantsMapper baseMapper;
+
+    private final UserMapper userMapper;
+
+    private final PhysicalTournamentsMapper physicalTournamentsMapper;
+
+    private final PhysicalTournamentEntryConditionsMapper physicalTournamentEntryConditionsMapper;
+
+
+    /**
+     * 查询线下用户报名
+     *
+     * @param id 主键
+     * @return 线下用户报名
+     */
+    @Override
+    public PhysicalParticipantsVo queryById(Long id){
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询线下用户报名列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 线下用户报名分页列表
+     */
+    @Override
+    public TableDataInfo<PhysicalParticipantsVo> queryPageList(PhysicalParticipantsBo bo, PageQuery pageQuery) {
+
+        //根据用户名找到userId
+        if(StringUtils.isNotBlank(bo.getUserName())){
+            UserVo userVo = userMapper.selUserInfo(bo.getUserName());
+            if(userVo!=null){
+                bo.setPlayerId(userVo.getId());
+            }
+        }
+
+        LambdaQueryWrapper<PhysicalParticipants> lqw = buildQueryWrapper(bo);
+        Page<PhysicalParticipantsVo> result = baseMapper.selectPhysicalParticipantsAllPage(pageQuery.build(), lqw);
+        List<PhysicalParticipantsVo> participantsVoList = result.getRecords();
+        for (PhysicalParticipantsVo resultRecord : participantsVoList) {
+            UserVo userVo = userMapper.selectVoByIdInfo(resultRecord.getPlayerId());
+            if(userVo!=null){
+                resultRecord.setUserName(userVo.getNickName());
+                resultRecord.setPhone(userVo.getPhone());
+            }
+            PhysicalTournamentsVo tournamentsVo = physicalTournamentsMapper.selectPhysicalTournamentsByIdInfo(resultRecord.getTournamentId());
+            if(tournamentsVo!=null){
+                resultRecord.setTournamentId(tournamentsVo.getId());
+                resultRecord.setTournamentsName(tournamentsVo.getName());
+
+                String statusText= GameStatus.getDescriptionFromCode(tournamentsVo.getStatus());
+                resultRecord.setStatusText(statusText);
+            }
+            PhysicalTournamentEntryConditionsVo tournamentEntryConditionsVo = physicalTournamentEntryConditionsMapper.selectPhysicalConditionsByTournamentId(resultRecord.getTournamentId());
+            String tournamentCondition="";
+            if(tournamentEntryConditionsVo!=null){
+                tournamentCondition=tournamentEntryConditionsVo.getItemsName()+"*"+tournamentEntryConditionsVo.getRequiredQuantity();
+            }
+            resultRecord.setTournamentCondition(tournamentCondition);
+        }
+
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的线下用户报名列表
+     *
+     * @param bo 查询条件
+     * @return 线下用户报名列表
+     */
+    @Override
+    public List<PhysicalParticipantsVo> queryList(PhysicalParticipantsBo bo) {
+         //根据用户名找到userId
+        if(StringUtils.isNotBlank(bo.getUserName())){
+            UserVo userVo = userMapper.selUserInfo(bo.getUserName());
+            if(userVo!=null){
+                bo.setPlayerId(userVo.getId());
+            }
+        }
+        LambdaQueryWrapper<PhysicalParticipants> lqw = buildQueryWrapper(bo);
+        List<PhysicalParticipantsVo> physicalParticipantsVoList = baseMapper.selectPhysicalParticipantsList(lqw);
+        for (PhysicalParticipantsVo resultRecord : physicalParticipantsVoList) {
+              UserVo userVo = userMapper.selectVoByIdInfo(resultRecord.getPlayerId());
+            if(userVo!=null){
+                resultRecord.setUserName(userVo.getNickName());
+                resultRecord.setPhone(userVo.getPhone());
+            }
+            PhysicalTournamentsVo tournamentsVo = physicalTournamentsMapper.selectPhysicalTournamentsByIdInfo(resultRecord.getTournamentId());
+            if(tournamentsVo!=null){
+                resultRecord.setTournamentId(tournamentsVo.getId());
+                resultRecord.setTournamentsName(tournamentsVo.getName());
+
+                String statusText= GameStatus.getDescriptionFromCode(tournamentsVo.getStatus());
+                resultRecord.setStatusText(statusText);
+            }
+           //赛事报名条件
+            PhysicalTournamentEntryConditionsVo tournamentEntryConditionsVo = physicalTournamentEntryConditionsMapper.selectPhysicalConditionsByTournamentId(resultRecord.getTournamentId());
+            String tournamentCondition="";
+            if(tournamentEntryConditionsVo!=null){
+                tournamentCondition=tournamentEntryConditionsVo.getItemsName()+"*"+tournamentEntryConditionsVo.getRequiredQuantity();
+            }
+            resultRecord.setTournamentCondition(tournamentCondition);
+        }
+          return physicalParticipantsVoList;
+    }
+
+    private LambdaQueryWrapper<PhysicalParticipants> buildQueryWrapper(PhysicalParticipantsBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<PhysicalParticipants> lqw = Wrappers.lambdaQuery();
+        lqw.orderByDesc(PhysicalParticipants::getRegistrationTime);
+        lqw.eq(bo.getTournamentId() != null, PhysicalParticipants::getTournamentId, bo.getTournamentId());
+        lqw.eq(bo.getPlayerId() != null, PhysicalParticipants::getPlayerId, bo.getPlayerId());
+        lqw.like(StringUtils.isNotBlank(bo.getName()), PhysicalParticipants::getName, bo.getName());
+        lqw.eq(StringUtils.isNotBlank(bo.getMobile()), PhysicalParticipants::getMobile, bo.getMobile());
+        lqw.eq(StringUtils.isNotBlank(bo.getAvatar()), PhysicalParticipants::getAvatar, bo.getAvatar());
+        lqw.eq(bo.getCurrentChips() != null, PhysicalParticipants::getCurrentChips, bo.getCurrentChips());
+        lqw.eq(bo.getRebuy() != null, PhysicalParticipants::getRebuy, bo.getRebuy());
+        lqw.eq(bo.getEliminatedTime() != null, PhysicalParticipants::getEliminatedTime, bo.getEliminatedTime());
+        lqw.eq(bo.getRegistrationTime() != null, PhysicalParticipants::getRegistrationTime, bo.getRegistrationTime());
+        lqw.eq(bo.getStatus() != null, PhysicalParticipants::getStatus, bo.getStatus());
+        lqw.eq(bo.getFinalRank() != null, PhysicalParticipants::getFinalRank, bo.getFinalRank());
+        lqw.eq(StringUtils.isNotBlank(bo.getFinalReward()), PhysicalParticipants::getFinalReward, bo.getFinalReward());
+        return lqw;
+    }
+
+    /**
+     * 新增线下用户报名
+     *
+     * @param bo 线下用户报名
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(PhysicalParticipantsBo bo) {
+        PhysicalParticipants add = MapstructUtils.convert(bo, PhysicalParticipants.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改线下用户报名
+     *
+     * @param bo 线下用户报名
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(PhysicalParticipantsBo bo) {
+        PhysicalParticipants update = MapstructUtils.convert(bo, PhysicalParticipants.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(PhysicalParticipants entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除线下用户报名信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+}

+ 42 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/physical/PhysicalParticipantsMapper.xml

@@ -0,0 +1,42 @@
+<?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.physical.mapper.PhysicalParticipantsMapper">
+
+     <select id="selectPhysicalParticipantsAllPage" resultType="org.dromara.physical.domain.vo.PhysicalParticipantsVo">
+         SELECT
+            id,
+            tournament_id,
+            player_id,
+            name,
+            mobile,
+            avatar,
+            current_chips,
+            rebuy,
+            eliminated_time,
+            registration_time,
+            status,
+            final_rank,
+            final_reward  from physical_participants  ${ew.customSqlSegment}
+     </select>
+
+    <select id="selectPhysicalParticipantsList" resultType="org.dromara.physical.domain.vo.PhysicalParticipantsVo">
+         SELECT
+            id,
+            tournament_id,
+            player_id,
+            name,
+            mobile,
+            avatar,
+            current_chips,
+            rebuy,
+            eliminated_time,
+            registration_time,
+            status,
+            final_rank,
+            final_reward  from physical_participants  ${ew.customSqlSegment}
+     </select>
+
+
+</mapper>