diff --git a/ff-base/src/main/java/com/ff/base/table/controller/TableController.java b/ff-base/src/main/java/com/ff/base/table/controller/TableController.java
new file mode 100644
index 0000000..b4d645a
--- /dev/null
+++ b/ff-base/src/main/java/com/ff/base/table/controller/TableController.java
@@ -0,0 +1,105 @@
+package com.ff.base.table.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ff.base.table.domain.Table;
+import com.ff.base.table.service.ITableService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ff.base.annotation.Log;
+import com.ff.base.core.controller.BaseController;
+import com.ff.base.core.domain.AjaxResult;
+import com.ff.base.enums.BusinessType;
+import com.ff.base.utils.poi.ExcelUtil;
+import com.ff.base.core.page.TableDataInfo;
+
+/**
+ * 分Controller
+ *
+ * @author shi
+ * @date 2025-03-28
+ */
+@RestController
+@RequestMapping("/table/table")
+public class TableController extends BaseController
+{
+ @Autowired
+ private ITableService tableService;
+
+ /**
+ * 查询分列表
+ */
+ @PreAuthorize("@ss.hasPermi('table:table:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(Table table)
+ {
+ startPage();
+ List
list = tableService.selectTableList(table);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出分列表
+ */
+ @PreAuthorize("@ss.hasPermi('table:table:export')")
+ @Log(title = "分", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, Table table)
+ {
+ List list = tableService.selectTableList(table);
+ ExcelUtil util = new ExcelUtil(Table.class);
+ util.exportExcel(response, list, "分数据");
+ }
+
+ /**
+ * 获取分详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('table:table:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id)
+ {
+ return success(tableService.selectTableById(id));
+ }
+
+ /**
+ * 新增分
+ */
+ @PreAuthorize("@ss.hasPermi('table:table:add')")
+ @Log(title = "分", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody Table table)
+ {
+ return toAjax(tableService.insertTable(table));
+ }
+
+ /**
+ * 修改分
+ */
+ @PreAuthorize("@ss.hasPermi('table:table:edit')")
+ @Log(title = "分", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody Table table)
+ {
+ return toAjax(tableService.updateTable(table));
+ }
+
+ /**
+ * 删除分
+ */
+ @PreAuthorize("@ss.hasPermi('table:table:remove')")
+ @Log(title = "分", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(tableService.deleteTableByIds(ids));
+ }
+}
diff --git a/ff-base/src/main/java/com/ff/base/table/domain/Table.java b/ff-base/src/main/java/com/ff/base/table/domain/Table.java
new file mode 100644
index 0000000..cc7c708
--- /dev/null
+++ b/ff-base/src/main/java/com/ff/base/table/domain/Table.java
@@ -0,0 +1,33 @@
+package com.ff.base.table.domain;
+
+import com.ff.base.annotation.Excel;
+import com.ff.base.core.domain.BaseEntity;
+import lombok.Data;
+/**
+ * 分对象 ff_table
+ *
+ * @author shi
+ * @date 2025-03-28
+ */
+@Data
+public class Table extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** $column.columnComment */
+ private Long id;
+
+ /** 表名 */
+ @Excel(name = "表名")
+ private String tableName;
+
+ /** 分表字段 */
+ @Excel(name = "分表字段")
+ private String tableField;
+
+ /** 分表类型 day天分表 */
+ @Excel(name = " 分表类型 day天分表 ")
+ private String type;
+
+
+}
diff --git a/ff-base/src/main/java/com/ff/base/table/mapper/TableMapper.java b/ff-base/src/main/java/com/ff/base/table/mapper/TableMapper.java
new file mode 100644
index 0000000..99e0c38
--- /dev/null
+++ b/ff-base/src/main/java/com/ff/base/table/mapper/TableMapper.java
@@ -0,0 +1,62 @@
+package com.ff.base.table.mapper;
+
+import com.ff.base.table.domain.Table;
+
+import java.util.List;
+
+/**
+ * 分Mapper接口
+ *
+ * @author shi
+ * @date 2025-03-28
+ */
+public interface TableMapper
+{
+ /**
+ * 查询分
+ *
+ * @param id 分主键
+ * @return 分
+ */
+ Table selectTableById(Long id);
+
+ /**
+ * 查询分列表
+ *
+ * @param table 分
+ * @return 分集合
+ */
+ List selectTableList(Table table);
+
+ /**
+ * 新增分
+ *
+ * @param table 分
+ * @return 结果
+ */
+ int insertTable(Table table);
+
+ /**
+ * 修改分
+ *
+ * @param table 分
+ * @return 结果
+ */
+ int updateTable(Table table);
+
+ /**
+ * 删除分
+ *
+ * @param id 分主键
+ * @return 结果
+ */
+ int deleteTableById(Long id);
+
+ /**
+ * 批量删除分
+ *
+ * @param ids 需要删除的数据主键集合
+ * @return 结果
+ */
+ int deleteTableByIds(Long[] ids);
+}
diff --git a/ff-base/src/main/java/com/ff/base/table/service/ITableService.java b/ff-base/src/main/java/com/ff/base/table/service/ITableService.java
new file mode 100644
index 0000000..4dfd285
--- /dev/null
+++ b/ff-base/src/main/java/com/ff/base/table/service/ITableService.java
@@ -0,0 +1,62 @@
+package com.ff.base.table.service;
+
+import com.ff.base.table.domain.Table;
+
+import java.util.List;
+
+/**
+ * 分Service接口
+ *
+ * @author shi
+ * @date 2025-03-28
+ */
+public interface ITableService
+{
+ /**
+ * 查询分
+ *
+ * @param id 分主键
+ * @return 分
+ */
+ Table selectTableById(Long id);
+
+ /**
+ * 查询分列表
+ *
+ * @param table 分
+ * @return 分集合
+ */
+ List selectTableList(Table table);
+
+ /**
+ * 新增分
+ *
+ * @param table 分
+ * @return 结果
+ */
+ int insertTable(Table table);
+
+ /**
+ * 修改分
+ *
+ * @param table 分
+ * @return 结果
+ */
+ int updateTable(Table table);
+
+ /**
+ * 批量删除分
+ *
+ * @param ids 需要删除的分主键集合
+ * @return 结果
+ */
+ int deleteTableByIds(Long[] ids);
+
+ /**
+ * 删除分信息
+ *
+ * @param id 分主键
+ * @return 结果
+ */
+ int deleteTableById(Long id);
+}
diff --git a/ff-base/src/main/java/com/ff/base/table/service/impl/TableServiceImpl.java b/ff-base/src/main/java/com/ff/base/table/service/impl/TableServiceImpl.java
new file mode 100644
index 0000000..6ea0135
--- /dev/null
+++ b/ff-base/src/main/java/com/ff/base/table/service/impl/TableServiceImpl.java
@@ -0,0 +1,100 @@
+package com.ff.base.table.service.impl;
+
+import java.util.List;
+
+import com.ff.base.table.domain.Table;
+import com.ff.base.table.mapper.TableMapper;
+import com.ff.base.table.service.ITableService;
+import com.ff.base.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import cn.hutool.core.util.IdUtil;
+
+
+/**
+ * 分Service业务层处理
+ *
+ * @author shi
+ * @date 2025-03-28
+ */
+@Service
+public class TableServiceImpl implements ITableService
+{
+ @Autowired
+ private TableMapper tableMapper;
+
+ /**
+ * 查询分
+ *
+ * @param id 分主键
+ * @return 分
+ */
+ @Override
+ public Table selectTableById(Long id)
+ {
+ return tableMapper.selectTableById(id);
+ }
+
+ /**
+ * 查询分列表
+ *
+ * @param table 分
+ * @return 分
+ */
+ @Override
+ public List selectTableList(Table table)
+ {
+ return tableMapper.selectTableList(table);
+ }
+
+ /**
+ * 新增分
+ *
+ * @param table 分
+ * @return 结果
+ */
+ @Override
+ public int insertTable(Table table)
+ {
+ table.setId(IdUtil.getSnowflakeNextId());
+ table.setCreateTime(DateUtils.getNowDate());
+ return tableMapper.insertTable(table);
+ }
+
+ /**
+ * 修改分
+ *
+ * @param table 分
+ * @return 结果
+ */
+ @Override
+ public int updateTable(Table table)
+ {
+ table.setUpdateTime(DateUtils.getNowDate());
+ return tableMapper.updateTable(table);
+ }
+
+ /**
+ * 批量删除分
+ *
+ * @param ids 需要删除的分主键
+ * @return 结果
+ */
+ @Override
+ public int deleteTableByIds(Long[] ids)
+ {
+ return tableMapper.deleteTableByIds(ids);
+ }
+
+ /**
+ * 删除分信息
+ *
+ * @param id 分主键
+ * @return 结果
+ */
+ @Override
+ public int deleteTableById(Long id)
+ {
+ return tableMapper.deleteTableById(id);
+ }
+}
diff --git a/ff-game/pom.xml b/ff-game/pom.xml
index 5d435ed..8fca69b 100644
--- a/ff-game/pom.xml
+++ b/ff-game/pom.xml
@@ -17,6 +17,14 @@
+
+ org.apache.shardingsphere
+ shardingsphere-spring-boot-starter
+ 5.0.1
+
+
+
+
org.springframework.boot
diff --git a/ff-game/src/main/java/com/ff/quartz/task/TablesJob.java b/ff-game/src/main/java/com/ff/quartz/task/TablesJob.java
new file mode 100644
index 0000000..4ebac03
--- /dev/null
+++ b/ff-game/src/main/java/com/ff/quartz/task/TablesJob.java
@@ -0,0 +1,40 @@
+package com.ff.quartz.task;
+
+
+import com.ff.base.table.service.ITableService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * 表格作业
+ *
+ * @author shi
+ * @date 2025/03/28
+ */
+@Slf4j
+@Component("tablesJob")
+public class TablesJob {
+
+ @Autowired
+ private ITableService tableService;
+
+ public void checkTablesJob() {
+ LocalDateTime now = LocalDateTime.now();
+ // 检查当前小时表
+ checkAndCreateTable(now);
+ // 检查前一小时表(处理跨天情况)
+ checkAndCreateTable(now.minusHours(1));
+ }
+ private void checkAndCreateTable(LocalDateTime time) {
+ String tableSuffix = time.format(DateTimeFormatter.ofPattern("yyyyMMddHH"));
+ String tableName = "ff_game_betting_details_" + tableSuffix;
+
+ if (!tableManager.isTableExists(tableName)) {
+ tableManager.createHourTable(tableName);
+ }
+ }
+}
diff --git a/ff-game/src/main/resources/application-druid.yml b/ff-game/src/main/resources/application-druid.yml
index dd61f2a..6cbed33 100644
--- a/ff-game/src/main/resources/application-druid.yml
+++ b/ff-game/src/main/resources/application-druid.yml
@@ -76,6 +76,8 @@ spring:
config:
multi-statement-allow: true
+
+
forest:
backend: okhttp3 # 后端HTTP框架(默认为 okhttp3)
max-connections: 1000 # 连接池最大连接数(默认为 500)
diff --git a/ff-game/src/main/resources/mapper/table/TableMapper.xml b/ff-game/src/main/resources/mapper/table/TableMapper.xml
new file mode 100644
index 0000000..3ff46d4
--- /dev/null
+++ b/ff-game/src/main/resources/mapper/table/TableMapper.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id, table_name, table_field, type, create_by, create_time, update_by, update_time from ff_table
+
+
+
+
+
+
+
+ insert into ff_table
+
+ id,
+ table_name,
+ table_field,
+ type,
+ create_by,
+ create_time,
+ update_by,
+ update_time,
+
+
+ #{id},
+ #{tableName},
+ #{tableField},
+ #{type},
+ #{createBy},
+ #{createTime},
+ #{updateBy},
+ #{updateTime},
+
+
+
+
+ update ff_table
+
+ table_name = #{tableName},
+ table_field = #{tableField},
+ type = #{type},
+ create_by = #{createBy},
+ create_time = #{createTime},
+ update_by = #{updateBy},
+ update_time = #{updateTime},
+
+ where id = #{id}
+
+
+
+ delete from ff_table where id = #{id}
+
+
+
+ delete from ff_table where id in
+
+ #{id}
+
+
+
\ No newline at end of file