diff --git a/src/main/java/com/yupi/springbootinit/mapper/ServerHostsRevenueStatsMapper.java b/src/main/java/com/yupi/springbootinit/mapper/ServerHostsRevenueStatsMapper.java new file mode 100644 index 0000000..d105588 --- /dev/null +++ b/src/main/java/com/yupi/springbootinit/mapper/ServerHostsRevenueStatsMapper.java @@ -0,0 +1,12 @@ +package com.yupi.springbootinit.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yupi.springbootinit.model.entity.ServerHostsRevenueStats; + +/* +* @author: ziin +* @date: 2026/1/9 19:06 +*/ + +public interface ServerHostsRevenueStatsMapper extends BaseMapper { +} \ No newline at end of file diff --git a/src/main/java/com/yupi/springbootinit/model/entity/ServerHostsRevenueStats.java b/src/main/java/com/yupi/springbootinit/model/entity/ServerHostsRevenueStats.java new file mode 100644 index 0000000..e098602 --- /dev/null +++ b/src/main/java/com/yupi/springbootinit/model/entity/ServerHostsRevenueStats.java @@ -0,0 +1,75 @@ +package com.yupi.springbootinit.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.math.BigDecimal; +import java.util.Date; +import lombok.Data; + +/* +* @author: ziin +* @date: 2026/1/9 19:06 +*/ + +/** + * 用户收入数据统计表 + */ +@Data +@TableName(value = "server_hosts_revenue_stats") +public class ServerHostsRevenueStats { + /** + * 自增主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 租户Id + */ + @TableField(value = "tenant_id") + private Long tenantId; + + /** + * 历史收入数据列表 (数组格式) + */ + @TableField(value = "history") + private String history; + + /** + * 展示ID/用户标识 + */ + @TableField(value = "display_id") + private String displayId; + + /** + * 今日收入 + */ + @TableField(value = "today_revenue") + private BigDecimal todayRevenue; + + /** + * 累计总收入 + */ + @TableField(value = "total_revenue") + private BigDecimal totalRevenue; + + /** + * 统计的天数/周期数 + */ + @TableField(value = "last_days_count") + private Integer lastDaysCount; + + /** + * 最后更新时间 + */ + @TableField(value = "updated_at") + private Date updatedAt; + + /** + * 创建时间 + */ + @TableField(value = "created_at") + private Date createdAt; +} \ No newline at end of file diff --git a/src/main/java/com/yupi/springbootinit/service/ServerHostsRevenueStatsService.java b/src/main/java/com/yupi/springbootinit/service/ServerHostsRevenueStatsService.java new file mode 100644 index 0000000..9703436 --- /dev/null +++ b/src/main/java/com/yupi/springbootinit/service/ServerHostsRevenueStatsService.java @@ -0,0 +1,13 @@ +package com.yupi.springbootinit.service; + +import com.yupi.springbootinit.model.entity.ServerHostsRevenueStats; +import com.baomidou.mybatisplus.extension.service.IService; + /* +* @author: ziin +* @date: 2026/1/9 19:06 +*/ + +public interface ServerHostsRevenueStatsService extends IService{ + + +} diff --git a/src/main/java/com/yupi/springbootinit/service/impl/ServerHostsRevenueStatsServiceImpl.java b/src/main/java/com/yupi/springbootinit/service/impl/ServerHostsRevenueStatsServiceImpl.java new file mode 100644 index 0000000..fed70ba --- /dev/null +++ b/src/main/java/com/yupi/springbootinit/service/impl/ServerHostsRevenueStatsServiceImpl.java @@ -0,0 +1,18 @@ +package com.yupi.springbootinit.service.impl; + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yupi.springbootinit.model.entity.ServerHostsRevenueStats; +import com.yupi.springbootinit.mapper.ServerHostsRevenueStatsMapper; +import com.yupi.springbootinit.service.ServerHostsRevenueStatsService; +/* +* @author: ziin +* @date: 2026/1/9 19:06 +*/ + +@Service +public class ServerHostsRevenueStatsServiceImpl extends ServiceImpl implements ServerHostsRevenueStatsService{ + +} diff --git a/src/main/resources/mapper/ServerHostsRevenueStatsMapper.xml b/src/main/resources/mapper/ServerHostsRevenueStatsMapper.xml new file mode 100644 index 0000000..933f775 --- /dev/null +++ b/src/main/resources/mapper/ServerHostsRevenueStatsMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + id, tenant_id, history, display_id, today_revenue, total_revenue, last_days_count, + updated_at, created_at + + \ No newline at end of file