This commit is contained in:
2025-11-24 16:01:45 +08:00
parent aa160793e7
commit 46c975591b
45 changed files with 1311 additions and 559 deletions

View File

@@ -0,0 +1,53 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 测试对象 scoring_adomain
*
* @author ruoyi
* @date 2025-11-24
*/
public class ScoringAdomain extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 名字 */
@Excel(name = "名字")
private String name;
/** 年龄 */
@Excel(name = "年龄")
private Long age;
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setAge(Long age)
{
this.age = age;
}
public Long getAge()
{
return age;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("name", getName())
.append("age", getAge())
.toString();
}
}

View File

@@ -0,0 +1,45 @@
package com.ruoyi.system.domain.vo;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 分数房间详情VO类用于接收前端提交的复杂数据结构
*
* @author ruoyi
* @date 2025-10-30
*/
@Data
public class ScoreRoomDetailVO {
/** 房间id */
private Long roomId;
/** 玩家列表 */
private List<PlayerScoreVO> players;
/** 局数 */
private Integer roundCount;
/** 创建时间 */
private Date createTime;
/** 玩家分数VO类 */
@Data
public static class PlayerScoreVO {
/** 玩家id */
private String playerId;
/** 玩家名称 */
private String playerName;
/** 玩家头像 */
private String avatar;
/** 总分 */
private Integer totalScore;
/** 每局分数 */
private List<Integer> roundScores;
}
}

View File

@@ -58,4 +58,12 @@ public interface ScoreRoomDetailMapper
* @return 结果
*/
public int deleteScoreRoomDetailByDetailIds(Long[] detailIds);
/**
* 批量新增分数记录
*
* @param scoreRoomDetails 分数记录集合
* @return 结果
*/
public int batchInsertScoreRoomDetail(List<ScoreRoomDetail> scoreRoomDetails);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.ScoringAdomain;
/**
* 测试Mapper接口
*
* @author ruoyi
* @date 2025-11-24
*/
public interface ScoringAdomainMapper
{
/**
* 查询测试
*
* @param name 测试主键
* @return 测试
*/
public ScoringAdomain selectScoringAdomainByName(String name);
/**
* 查询测试列表
*
* @param scoringAdomain 测试
* @return 测试集合
*/
public List<ScoringAdomain> selectScoringAdomainList(ScoringAdomain scoringAdomain);
/**
* 新增测试
*
* @param scoringAdomain 测试
* @return 结果
*/
public int insertScoringAdomain(ScoringAdomain scoringAdomain);
/**
* 修改测试
*
* @param scoringAdomain 测试
* @return 结果
*/
public int updateScoringAdomain(ScoringAdomain scoringAdomain);
/**
* 删除测试
*
* @param name 测试主键
* @return 结果
*/
public int deleteScoringAdomainByName(String name);
/**
* 批量删除测试
*
* @param names 需要删除的数据主键集合
* @return 结果
*/
public int deleteScoringAdomainByNames(String[] names);
}

View File

@@ -58,4 +58,12 @@ public interface IScoreRoomDetailService
* @return 结果
*/
public int deleteScoreRoomDetailByDetailId(Long detailId);
/**
* 批量新增分数记录
*
* @param scoreRoomDetails 分数记录集合
* @return 结果
*/
public int batchInsertScoreRoomDetail(List<ScoreRoomDetail> scoreRoomDetails);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.ScoringAdomain;
/**
* 测试Service接口
*
* @author ruoyi
* @date 2025-11-24
*/
public interface IScoringAdomainService
{
/**
* 查询测试
*
* @param name 测试主键
* @return 测试
*/
public ScoringAdomain selectScoringAdomainByName(String name);
/**
* 查询测试列表
*
* @param scoringAdomain 测试
* @return 测试集合
*/
public List<ScoringAdomain> selectScoringAdomainList(ScoringAdomain scoringAdomain);
/**
* 新增测试
*
* @param scoringAdomain 测试
* @return 结果
*/
public int insertScoringAdomain(ScoringAdomain scoringAdomain);
/**
* 修改测试
*
* @param scoringAdomain 测试
* @return 结果
*/
public int updateScoringAdomain(ScoringAdomain scoringAdomain);
/**
* 批量删除测试
*
* @param names 需要删除的测试主键集合
* @return 结果
*/
public int deleteScoringAdomainByNames(String[] names);
/**
* 删除测试信息
*
* @param name 测试主键
* @return 结果
*/
public int deleteScoringAdomainByName(String name);
}

View File

@@ -90,4 +90,10 @@ public class ScoreRoomDetailServiceImpl implements IScoreRoomDetailService
{
return scoreRoomDetailMapper.deleteScoreRoomDetailByDetailId(detailId);
}
@Override
public int batchInsertScoreRoomDetail(List<ScoreRoomDetail> scoreRoomDetails)
{
return scoreRoomDetailMapper.batchInsertScoreRoomDetail(scoreRoomDetails);
}
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ScoringAdomainMapper;
import com.ruoyi.system.domain.ScoringAdomain;
import com.ruoyi.system.service.IScoringAdomainService;
/**
* 测试Service业务层处理
*
* @author ruoyi
* @date 2025-11-24
*/
@Service
public class ScoringAdomainServiceImpl implements IScoringAdomainService
{
@Autowired
private ScoringAdomainMapper scoringAdomainMapper;
/**
* 查询测试
*
* @param name 测试主键
* @return 测试
*/
@Override
public ScoringAdomain selectScoringAdomainByName(String name)
{
return scoringAdomainMapper.selectScoringAdomainByName(name);
}
/**
* 查询测试列表
*
* @param scoringAdomain 测试
* @return 测试
*/
@Override
public List<ScoringAdomain> selectScoringAdomainList(ScoringAdomain scoringAdomain)
{
return scoringAdomainMapper.selectScoringAdomainList(scoringAdomain);
}
/**
* 新增测试
*
* @param scoringAdomain 测试
* @return 结果
*/
@Override
public int insertScoringAdomain(ScoringAdomain scoringAdomain)
{
return scoringAdomainMapper.insertScoringAdomain(scoringAdomain);
}
/**
* 修改测试
*
* @param scoringAdomain 测试
* @return 结果
*/
@Override
public int updateScoringAdomain(ScoringAdomain scoringAdomain)
{
return scoringAdomainMapper.updateScoringAdomain(scoringAdomain);
}
/**
* 批量删除测试
*
* @param names 需要删除的测试主键
* @return 结果
*/
@Override
public int deleteScoringAdomainByNames(String[] names)
{
return scoringAdomainMapper.deleteScoringAdomainByNames(names);
}
/**
* 删除测试信息
*
* @param name 测试主键
* @return 结果
*/
@Override
public int deleteScoringAdomainByName(String name)
{
return scoringAdomainMapper.deleteScoringAdomainByName(name);
}
}

View File

@@ -78,4 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{detailId}
</foreach>
</delete>
<insert id="batchInsertScoreRoomDetail" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="detailId">
insert into score_room_detail (room_id, user_id, score, created_time, detail_type, getter_id)
values
<foreach item="detail" collection="list" separator=",">
(#{detail.roomId}, #{detail.userId}, #{detail.score}, #{detail.createdTime}, #{detail.detailType}, #{detail.getterId})
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,59 @@
<?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="com.ruoyi.system.mapper.ScoringAdomainMapper">
<resultMap type="ScoringAdomain" id="ScoringAdomainResult">
<result property="name" column="name" />
<result property="age" column="age" />
</resultMap>
<sql id="selectScoringAdomainVo">
select name, age from scoring_adomain
</sql>
<select id="selectScoringAdomainList" parameterType="ScoringAdomain" resultMap="ScoringAdomainResult">
<include refid="selectScoringAdomainVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="age != null "> and age = #{age}</if>
</where>
</select>
<select id="selectScoringAdomainByName" parameterType="String" resultMap="ScoringAdomainResult">
<include refid="selectScoringAdomainVo"/>
where name = #{name}
</select>
<insert id="insertScoringAdomain" parameterType="ScoringAdomain">
insert into scoring_adomain
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="age != null">age,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="age != null">#{age},</if>
</trim>
</insert>
<update id="updateScoringAdomain" parameterType="ScoringAdomain">
update scoring_adomain
<trim prefix="SET" suffixOverrides=",">
<if test="age != null">age = #{age},</if>
</trim>
where name = #{name}
</update>
<delete id="deleteScoringAdomainByName" parameterType="String">
delete from scoring_adomain where name = #{name}
</delete>
<delete id="deleteScoringAdomainByNames" parameterType="String">
delete from scoring_adomain where name in
<foreach item="name" collection="array" open="(" separator="," close=")">
#{name}
</foreach>
</delete>
</mapper>