소스 검색

feat: add backend entities, mappers and DTOs for energy/commission/article/badge/game modules

New entities: Article, ArticleCategory, ArticleReadingRecord, Badge, ChildBadge, CommissionRecord, ContentSection, EnergyBalance, EnergyDimension, EnergyDimensionConfig, EnergyLog, EnergySourceConfig, GameRecord, WithdrawalRequest

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
User 3 달 전
부모
커밋
f9ec0ff8ef
32개의 변경된 파일735개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      cfc-backend/src/main/java/com/etotem/cfc/dto/CommissionSummaryDTO.java
  2. 25 0
      cfc-backend/src/main/java/com/etotem/cfc/dto/EnergySandboxDTO.java
  3. 34 0
      cfc-backend/src/main/java/com/etotem/cfc/dto/MemberEnergyDTO.java
  4. 11 0
      cfc-backend/src/main/java/com/etotem/cfc/dto/ReferralSummaryDTO.java
  5. 33 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/Article.java
  6. 19 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/ArticleCategory.java
  7. 29 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/ArticleReadingRecord.java
  8. 47 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/Badge.java
  9. 33 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/ChildBadge.java
  10. 40 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/CommissionRecord.java
  11. 33 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/ContentSection.java
  12. 34 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyBalance.java
  13. 37 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyDimension.java
  14. 30 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyDimensionConfig.java
  15. 46 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyLog.java
  16. 35 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/EnergySourceConfig.java
  17. 35 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/GameRecord.java
  18. 34 0
      cfc-backend/src/main/java/com/etotem/cfc/entity/WithdrawalRequest.java
  19. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleCategoryMapper.java
  20. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleMapper.java
  21. 16 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleReadingRecordMapper.java
  22. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/BadgeMapper.java
  23. 31 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/ChildBadgeMapper.java
  24. 7 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/CommissionRecordMapper.java
  25. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/ContentSectionMapper.java
  26. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyBalanceMapper.java
  27. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyDimensionConfigMapper.java
  28. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyDimensionMapper.java
  29. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyLogMapper.java
  30. 9 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergySourceConfigMapper.java
  31. 25 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/GameRecordMapper.java
  32. 7 0
      cfc-backend/src/main/java/com/etotem/cfc/mapper/WithdrawalRequestMapper.java

+ 13 - 0
cfc-backend/src/main/java/com/etotem/cfc/dto/CommissionSummaryDTO.java

@@ -0,0 +1,13 @@
+package com.etotem.cfc.dto;
+
+import lombok.Data;
+import java.math.BigDecimal;
+
+@Data
+public class CommissionSummaryDTO {
+    private BigDecimal totalCommission;
+    private BigDecimal settledAmount;
+    private BigDecimal pendingAmount;
+    private BigDecimal withdrawnAmount;
+    private BigDecimal availableAmount;
+}

+ 25 - 0
cfc-backend/src/main/java/com/etotem/cfc/dto/EnergySandboxDTO.java

@@ -0,0 +1,25 @@
+package com.etotem.cfc.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 家庭能量沙盘响应
+ * 混合模式:familyOverview 展示家庭聚合值,members 用于下钻个人
+ */
+@Data
+public class EnergySandboxDTO {
+
+    /** 家庭聚合五维评分 (0-100) */
+    private Integer bodyScore;
+    private Integer mindScore;
+    private Integer wisdomScore;
+    private Integer actionScore;
+    private Integer wealthScore;
+    /** 家庭综合能量值(五维平均) */
+    private Integer overallScore;
+
+    /** 家庭成员个人五维数据 */
+    private List<MemberEnergyDTO> members;
+}

+ 34 - 0
cfc-backend/src/main/java/com/etotem/cfc/dto/MemberEnergyDTO.java

@@ -0,0 +1,34 @@
+package com.etotem.cfc.dto;
+
+import lombok.Data;
+
+/**
+ * 家庭成员个人五维能量数据
+ */
+@Data
+public class MemberEnergyDTO {
+
+    private Long memberId;
+
+    /** parent / child */
+    private String memberType;
+
+    /** 昵称 */
+    private String name;
+
+    /** 头像 */
+    private String avatar;
+
+    /** 家庭角色:爸爸/妈妈/爷爷/奶奶 或空 */
+    private String familyRole;
+
+    /** 五维评分 (0-100) */
+    private Integer bodyScore;
+    private Integer mindScore;
+    private Integer wisdomScore;
+    private Integer actionScore;
+    private Integer wealthScore;
+
+    /** 个人综合能量值 */
+    private Integer overallScore;
+}

+ 11 - 0
cfc-backend/src/main/java/com/etotem/cfc/dto/ReferralSummaryDTO.java

@@ -0,0 +1,11 @@
+package com.etotem.cfc.dto;
+
+import lombok.Data;
+import java.math.BigDecimal;
+
+@Data
+public class ReferralSummaryDTO {
+    private String referralCode;
+    private Integer invitedCount;
+    private BigDecimal totalEarnings;
+}

+ 33 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/Article.java

@@ -0,0 +1,33 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("articles")
+public class Article implements Serializable {
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private Long categoryId;
+    private String title;
+    private String summary;
+    private String coverImage;
+    private String content;
+    private String tags;
+    private String author;
+    private Integer readTime;
+    private String relatedDimensions;
+    private String visibility;
+    private String visibleTo;
+    private String status;
+    private Integer isFeatured;
+    private Date publishedAt;
+    private Integer viewCount;
+    private Long createdBy;
+    private Date createdAt;
+    private Date updatedAt;
+}

+ 19 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/ArticleCategory.java

@@ -0,0 +1,19 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import java.io.Serializable;
+
+@Data
+@TableName("article_categories")
+public class ArticleCategory implements Serializable {
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private String name;
+    private String icon;
+    private String color;
+    private Integer sortOrder;
+    private Integer status;
+}

+ 29 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/ArticleReadingRecord.java

@@ -0,0 +1,29 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("article_reading_records")
+public class ArticleReadingRecord implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private Long userId;
+
+    private Long childId;
+
+    private String content;
+
+    private Integer durationSeconds;
+
+    private Date readAt;
+
+    private Date createdAt;
+}

+ 47 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/Badge.java

@@ -0,0 +1,47 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("badge")
+public class Badge implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private String badgeId;
+
+    private String name;
+
+    private String description;
+
+    private String icon;
+
+    private String category;
+
+    private String level;
+
+    private String rarity;
+
+    private String triggerType;
+
+    private Integer threshold;
+
+    private Boolean needApproval;
+
+    private Integer expireDays;
+
+    private Integer sortOrder;
+
+    private Integer isActive;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+}

+ 33 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/ChildBadge.java

@@ -0,0 +1,33 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("child_badge")
+public class ChildBadge implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private Long childId;
+
+    private Long badgeId;
+
+    private Date earnedAt;
+
+    private Date expireAt;
+
+    private Integer status;
+
+    private Boolean isFavorite;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+}

+ 40 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/CommissionRecord.java

@@ -0,0 +1,40 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("commission_records")
+public class CommissionRecord implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private Long orderId;
+
+    private String orderType;       // membership/product/assessment/package
+
+    private Long referrerId;
+
+    private Long buyerId;
+
+    private String commissionType;   // member/profit
+
+    private BigDecimal orderAmount;
+
+    private BigDecimal profitRate;
+
+    private BigDecimal commissionAmount;
+
+    private String status;           // pending/settled
+
+    private String remark;
+
+    private Date createdAt;
+}

+ 33 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/ContentSection.java

@@ -0,0 +1,33 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("content_sections")
+public class ContentSection implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private String pageKey;
+
+    private String sectionKey;
+
+    private String title;
+
+    private String allowedRoles;
+
+    private Integer sortOrder;
+
+    private String status;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+}

+ 34 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyBalance.java

@@ -0,0 +1,34 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("energy_balance")
+public class EnergyBalance implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /** 孩子ID */
+    private Long childId;
+
+    /** 维度ID */
+    private Long dimensionId;
+
+    /** 当前能量值(可为负) */
+    private Integer balance;
+
+    /** 累计获得 */
+    private Integer totalEarned;
+
+    /** 累计消耗 */
+    private Integer totalSpent;
+
+    private Date updatedAt;
+}

+ 37 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyDimension.java

@@ -0,0 +1,37 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("energy_dimension")
+public class EnergyDimension implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /** 维度代码: body/mind/wisdom/action/wealth */
+    private String code;
+
+    /** 维度名称: 身/心/智/行/富 */
+    private String name;
+
+    /** 图标emoji */
+    private String icon;
+
+    /** 五行元素: 土/火/金/木/水 */
+    private String element;
+
+    /** 显示顺序 */
+    private Integer sortOrder;
+
+    /** 1启用/0禁用 */
+    private Integer status;
+
+    private Date createdAt;
+}

+ 30 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyDimensionConfig.java

@@ -0,0 +1,30 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("energy_dimension_config")
+public class EnergyDimensionConfig implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private String dimension;
+
+    private String dataSource;
+
+    private String category;
+
+    private BigDecimal weight;
+
+    private Integer isActive;
+
+    private Date updatedAt;
+}

+ 46 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyLog.java

@@ -0,0 +1,46 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("energy_log")
+public class EnergyLog implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /** 孩子ID */
+    private Long childId;
+
+    /** 维度ID */
+    private Long dimensionId;
+
+    /** 变动量(正=获得,负=消耗) */
+    private Integer amount;
+
+    /** 变动后余额 */
+    private Integer balanceAfter;
+
+    /** 来源类型: task/product/medical_report/daily_record */
+    private String sourceType;
+
+    /** 来源ID */
+    private Long sourceId;
+
+    /** 关联旧流水ID(覆盖时标记) */
+    private Long refId;
+
+    /** 过期时间(空=永不过期) */
+    private Date expiresAt;
+
+    /** 描述 */
+    private String description;
+
+    private Date createdAt;
+}

+ 35 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/EnergySourceConfig.java

@@ -0,0 +1,35 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("energy_source_config")
+public class EnergySourceConfig implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /** 来源类型: task/activity/course/product/consultation */
+    private String sourceType;
+
+    /** 来源业务表ID */
+    private Long sourceId;
+
+    /** 冗余名称 */
+    private String sourceName;
+
+    /** 维度ID */
+    private Long dimensionId;
+
+    /** 占比如0.6000=60% */
+    private BigDecimal ratio;
+
+    private Date createdAt;
+}

+ 35 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/GameRecord.java

@@ -0,0 +1,35 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("game_records")
+public class GameRecord implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private Long childId;
+
+    private String gameCode;
+
+    private Integer score;
+
+    private Integer completionTime;
+
+    private String difficulty;
+
+    private Integer pointsEarned;
+
+    private Date playedAt;
+
+    private Date createdAt;
+
+    private Date updatedAt;
+}

+ 34 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/WithdrawalRequest.java

@@ -0,0 +1,34 @@
+package com.etotem.cfc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("withdrawal_requests")
+public class WithdrawalRequest implements Serializable {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    private Long userId;
+
+    private BigDecimal amount;
+
+    private String accountInfo;     // JSON: 支付宝账号信息
+
+    private String status;          // pending/approved/rejected
+
+    private Long auditBy;
+
+    private Date auditAt;
+
+    private String remark;
+
+    private Date createdAt;
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleCategoryMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.ArticleCategory;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ArticleCategoryMapper extends BaseMapper<ArticleCategory> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.Article;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ArticleMapper extends BaseMapper<Article> {
+}

+ 16 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleReadingRecordMapper.java

@@ -0,0 +1,16 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.ArticleReadingRecord;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface ArticleReadingRecordMapper extends BaseMapper<ArticleReadingRecord> {
+
+    @Select("SELECT COALESCE(SUM(duration_seconds), 0) FROM article_reading_records " +
+            "WHERE child_id = #{childId} AND read_at >= #{since}")
+    Integer selectTotalDurationByChildSince(@Param("childId") Long childId,
+                                            @Param("since") java.util.Date since);
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/BadgeMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.Badge;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface BadgeMapper extends BaseMapper<Badge> {
+}

+ 31 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/ChildBadgeMapper.java

@@ -0,0 +1,31 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.ChildBadge;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface ChildBadgeMapper extends BaseMapper<ChildBadge> {
+
+    @Select("SELECT b.category, COUNT(*) as count FROM child_badge cb " +
+            "JOIN badge b ON cb.badge_id = b.id " +
+            "WHERE cb.child_id = #{childId} AND cb.status = 1 " +
+            "GROUP BY b.category")
+    List<Map<String, Object>> selectCategoryStats(@Param("childId") Long childId);
+
+    @Select("SELECT b.level, COUNT(*) as count FROM child_badge cb " +
+            "JOIN badge b ON cb.badge_id = b.id " +
+            "WHERE cb.child_id = #{childId} AND cb.status = 1 " +
+            "GROUP BY b.level")
+    List<Map<String, Object>> selectLevelStats(@Param("childId") Long childId);
+
+    @Select("SELECT cb.child_id, COUNT(*) as total FROM child_badge cb " +
+            "WHERE cb.child_id IN (SELECT id FROM children WHERE family_id = #{familyId}) " +
+            "AND cb.status = 1 GROUP BY cb.child_id ORDER BY total DESC")
+    List<Map<String, Object>> selectFamilyRanking(@Param("familyId") Long familyId);
+}

+ 7 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/CommissionRecordMapper.java

@@ -0,0 +1,7 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.CommissionRecord;
+
+public interface CommissionRecordMapper extends BaseMapper<CommissionRecord> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/ContentSectionMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.ContentSection;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface ContentSectionMapper extends BaseMapper<ContentSection> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyBalanceMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.EnergyBalance;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EnergyBalanceMapper extends BaseMapper<EnergyBalance> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyDimensionConfigMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.EnergyDimensionConfig;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EnergyDimensionConfigMapper extends BaseMapper<EnergyDimensionConfig> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyDimensionMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.EnergyDimension;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EnergyDimensionMapper extends BaseMapper<EnergyDimension> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergyLogMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.EnergyLog;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EnergyLogMapper extends BaseMapper<EnergyLog> {
+}

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/EnergySourceConfigMapper.java

@@ -0,0 +1,9 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.EnergySourceConfig;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EnergySourceConfigMapper extends BaseMapper<EnergySourceConfig> {
+}

+ 25 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/GameRecordMapper.java

@@ -0,0 +1,25 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.GameRecord;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface GameRecordMapper extends BaseMapper<GameRecord> {
+
+    @Select("SELECT game_code, MAX(score) as best_score, COUNT(*) as total_plays, " +
+            "SUM(points_earned) as total_points " +
+            "FROM game_records WHERE child_id = #{childId} GROUP BY game_code")
+    List<Map<String, Object>> selectBestScoresByChild(@Param("childId") Long childId);
+
+    @Select("SELECT gr.*, c.name as child_name " +
+            "FROM game_records gr LEFT JOIN children c ON gr.child_id = c.id " +
+            "WHERE gr.game_code = #{gameCode} ORDER BY gr.score DESC LIMIT #{limit}")
+    List<Map<String, Object>> selectLeaderboard(@Param("gameCode") String gameCode,
+                                                 @Param("limit") int limit);
+}

+ 7 - 0
cfc-backend/src/main/java/com/etotem/cfc/mapper/WithdrawalRequestMapper.java

@@ -0,0 +1,7 @@
+package com.etotem.cfc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.etotem.cfc.entity.WithdrawalRequest;
+
+public interface WithdrawalRequestMapper extends BaseMapper<WithdrawalRequest> {
+}