feat(core): 新增主播收益统计模块
This commit is contained in:
@@ -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<ServerHostsRevenueStats> {
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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<ServerHostsRevenueStats>{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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<ServerHostsRevenueStatsMapper, ServerHostsRevenueStats> implements ServerHostsRevenueStatsService{
|
||||||
|
|
||||||
|
}
|
||||||
22
src/main/resources/mapper/ServerHostsRevenueStatsMapper.xml
Normal file
22
src/main/resources/mapper/ServerHostsRevenueStatsMapper.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?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.yupi.springbootinit.mapper.ServerHostsRevenueStatsMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.ServerHostsRevenueStats">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table server_hosts_revenue_stats-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||||
|
<result column="history" jdbcType="VARCHAR" property="history" />
|
||||||
|
<result column="display_id" jdbcType="VARCHAR" property="displayId" />
|
||||||
|
<result column="today_revenue" jdbcType="DECIMAL" property="todayRevenue" />
|
||||||
|
<result column="total_revenue" jdbcType="DECIMAL" property="totalRevenue" />
|
||||||
|
<result column="last_days_count" jdbcType="INTEGER" property="lastDaysCount" />
|
||||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, tenant_id, history, display_id, today_revenue, total_revenue, last_days_count,
|
||||||
|
updated_at, created_at
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user