diff --git a/pom.xml b/pom.xml
index 94c452c..948323d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,6 +57,18 @@
knife4j-openapi3-jakarta-spring-boot-starter
4.4.0
+
+
+ com.baomidou
+ mybatis-plus-spring-boot3-starter
+ 3.5.12
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.29
+
diff --git a/src/main/java/iet/ustb/sf/IetKpiServiceApplication.java b/src/main/java/iet/ustb/sf/IetKpiServiceApplication.java
index 18c0735..1624321 100644
--- a/src/main/java/iet/ustb/sf/IetKpiServiceApplication.java
+++ b/src/main/java/iet/ustb/sf/IetKpiServiceApplication.java
@@ -1,9 +1,11 @@
package iet.ustb.sf;
+import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
+@MapperScan("iet.ustb.sf.mapper")
public class IetKpiServiceApplication {
public static void main(String[] args) {
diff --git a/src/main/java/iet/ustb/sf/controller/SyncController.java b/src/main/java/iet/ustb/sf/controller/SyncController.java
new file mode 100644
index 0000000..6d1a4ca
--- /dev/null
+++ b/src/main/java/iet/ustb/sf/controller/SyncController.java
@@ -0,0 +1,54 @@
+package iet.ustb.sf.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import iet.ustb.sf.common.R;
+import iet.ustb.sf.service.TableColumnService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * web中未使用的有用接口
+ * SyncController
+ *
+ * @author huangge1199
+ * @since 2025/8/5 12:37:22
+ */
+@RestController
+@RequestMapping("/sync")
+@Tag(name = "web中未使用的有用接口")
+public class SyncController {
+
+ @Resource
+ private TableColumnService tableColumnService;
+
+ /**
+ * 同步指定表结构
+ * @param params 表名
+ * @return 结果
+ */
+ @Operation(summary = "同步指定表结构")
+ @PostMapping("/syncTableData")
+ public R syncTableData(@RequestBody JSONObject params) {
+ String tableName = params.getString("tableName");
+ String result = tableColumnService.syncTableData(tableName);
+ return R.ok(result);
+ }
+
+ /**
+ * 同步指定库的所有表结构
+ * @param params 库名
+ * @return 结果
+ */
+ @Operation(summary = "同步指定库的所有表结构")
+ @PostMapping("/syncTableDataByDb")
+ public R syncTableDataByDb(@RequestBody JSONObject params) {
+ String dbName = params.getString("dbName");
+ String result = tableColumnService.syncTableDataByDb(dbName);
+ return R.ok(result);
+ }
+}
diff --git a/src/main/java/iet/ustb/sf/domain/Columns.java b/src/main/java/iet/ustb/sf/domain/Columns.java
new file mode 100644
index 0000000..1af754e
--- /dev/null
+++ b/src/main/java/iet/ustb/sf/domain/Columns.java
@@ -0,0 +1,238 @@
+package iet.ustb.sf.domain;
+
+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 lombok.Data;
+
+/**
+ *
+ * @TableName columns
+ */
+@TableName(value ="information_schema.columns")
+@Data
+public class Columns {
+ /**
+ *
+ */
+ private String tableCatalog;
+
+ /**
+ *
+ */
+ private String tableSchema;
+
+ /**
+ *
+ */
+ private String tableName;
+
+ /**
+ *
+ */
+ private String columnName;
+
+ /**
+ *
+ */
+ private Long ordinalPosition;
+
+ /**
+ *
+ */
+ private String columnDefault;
+
+ /**
+ *
+ */
+ private String isNullable;
+
+ /**
+ *
+ */
+ private String dataType;
+
+ /**
+ *
+ */
+ private Long characterMaximumLength;
+
+ /**
+ *
+ */
+ private Long characterOctetLength;
+
+ /**
+ *
+ */
+ private Long numericPrecision;
+
+ /**
+ *
+ */
+ private Long numericScale;
+
+ /**
+ *
+ */
+ private Long datetimePrecision;
+
+ /**
+ *
+ */
+ private String characterSetName;
+
+ /**
+ *
+ */
+ private String collationName;
+
+ /**
+ *
+ */
+ private String columnType;
+
+ /**
+ *
+ */
+ private String columnKey;
+
+ /**
+ *
+ */
+ private String extra;
+
+ /**
+ *
+ */
+ private String privileges;
+
+ /**
+ *
+ */
+ private String columnComment;
+
+ /**
+ *
+ */
+ private Long columnSize;
+
+ /**
+ *
+ */
+ private Long decimalDigits;
+
+ /**
+ *
+ */
+ private String generationExpression;
+
+ /**
+ *
+ */
+ private Long srsId;
+
+ @Override
+ public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ if (getClass() != that.getClass()) {
+ return false;
+ }
+ Columns other = (Columns) that;
+ return (this.getTableCatalog() == null ? other.getTableCatalog() == null : this.getTableCatalog().equals(other.getTableCatalog()))
+ && (this.getTableSchema() == null ? other.getTableSchema() == null : this.getTableSchema().equals(other.getTableSchema()))
+ && (this.getTableName() == null ? other.getTableName() == null : this.getTableName().equals(other.getTableName()))
+ && (this.getColumnName() == null ? other.getColumnName() == null : this.getColumnName().equals(other.getColumnName()))
+ && (this.getOrdinalPosition() == null ? other.getOrdinalPosition() == null : this.getOrdinalPosition().equals(other.getOrdinalPosition()))
+ && (this.getColumnDefault() == null ? other.getColumnDefault() == null : this.getColumnDefault().equals(other.getColumnDefault()))
+ && (this.getIsNullable() == null ? other.getIsNullable() == null : this.getIsNullable().equals(other.getIsNullable()))
+ && (this.getDataType() == null ? other.getDataType() == null : this.getDataType().equals(other.getDataType()))
+ && (this.getCharacterMaximumLength() == null ? other.getCharacterMaximumLength() == null : this.getCharacterMaximumLength().equals(other.getCharacterMaximumLength()))
+ && (this.getCharacterOctetLength() == null ? other.getCharacterOctetLength() == null : this.getCharacterOctetLength().equals(other.getCharacterOctetLength()))
+ && (this.getNumericPrecision() == null ? other.getNumericPrecision() == null : this.getNumericPrecision().equals(other.getNumericPrecision()))
+ && (this.getNumericScale() == null ? other.getNumericScale() == null : this.getNumericScale().equals(other.getNumericScale()))
+ && (this.getDatetimePrecision() == null ? other.getDatetimePrecision() == null : this.getDatetimePrecision().equals(other.getDatetimePrecision()))
+ && (this.getCharacterSetName() == null ? other.getCharacterSetName() == null : this.getCharacterSetName().equals(other.getCharacterSetName()))
+ && (this.getCollationName() == null ? other.getCollationName() == null : this.getCollationName().equals(other.getCollationName()))
+ && (this.getColumnType() == null ? other.getColumnType() == null : this.getColumnType().equals(other.getColumnType()))
+ && (this.getColumnKey() == null ? other.getColumnKey() == null : this.getColumnKey().equals(other.getColumnKey()))
+ && (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
+ && (this.getPrivileges() == null ? other.getPrivileges() == null : this.getPrivileges().equals(other.getPrivileges()))
+ && (this.getColumnComment() == null ? other.getColumnComment() == null : this.getColumnComment().equals(other.getColumnComment()))
+ && (this.getColumnSize() == null ? other.getColumnSize() == null : this.getColumnSize().equals(other.getColumnSize()))
+ && (this.getDecimalDigits() == null ? other.getDecimalDigits() == null : this.getDecimalDigits().equals(other.getDecimalDigits()))
+ && (this.getGenerationExpression() == null ? other.getGenerationExpression() == null : this.getGenerationExpression().equals(other.getGenerationExpression()))
+ && (this.getSrsId() == null ? other.getSrsId() == null : this.getSrsId().equals(other.getSrsId()));
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((getTableCatalog() == null) ? 0 : getTableCatalog().hashCode());
+ result = prime * result + ((getTableSchema() == null) ? 0 : getTableSchema().hashCode());
+ result = prime * result + ((getTableName() == null) ? 0 : getTableName().hashCode());
+ result = prime * result + ((getColumnName() == null) ? 0 : getColumnName().hashCode());
+ result = prime * result + ((getOrdinalPosition() == null) ? 0 : getOrdinalPosition().hashCode());
+ result = prime * result + ((getColumnDefault() == null) ? 0 : getColumnDefault().hashCode());
+ result = prime * result + ((getIsNullable() == null) ? 0 : getIsNullable().hashCode());
+ result = prime * result + ((getDataType() == null) ? 0 : getDataType().hashCode());
+ result = prime * result + ((getCharacterMaximumLength() == null) ? 0 : getCharacterMaximumLength().hashCode());
+ result = prime * result + ((getCharacterOctetLength() == null) ? 0 : getCharacterOctetLength().hashCode());
+ result = prime * result + ((getNumericPrecision() == null) ? 0 : getNumericPrecision().hashCode());
+ result = prime * result + ((getNumericScale() == null) ? 0 : getNumericScale().hashCode());
+ result = prime * result + ((getDatetimePrecision() == null) ? 0 : getDatetimePrecision().hashCode());
+ result = prime * result + ((getCharacterSetName() == null) ? 0 : getCharacterSetName().hashCode());
+ result = prime * result + ((getCollationName() == null) ? 0 : getCollationName().hashCode());
+ result = prime * result + ((getColumnType() == null) ? 0 : getColumnType().hashCode());
+ result = prime * result + ((getColumnKey() == null) ? 0 : getColumnKey().hashCode());
+ result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
+ result = prime * result + ((getPrivileges() == null) ? 0 : getPrivileges().hashCode());
+ result = prime * result + ((getColumnComment() == null) ? 0 : getColumnComment().hashCode());
+ result = prime * result + ((getColumnSize() == null) ? 0 : getColumnSize().hashCode());
+ result = prime * result + ((getDecimalDigits() == null) ? 0 : getDecimalDigits().hashCode());
+ result = prime * result + ((getGenerationExpression() == null) ? 0 : getGenerationExpression().hashCode());
+ result = prime * result + ((getSrsId() == null) ? 0 : getSrsId().hashCode());
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getClass().getSimpleName());
+ sb.append(" [");
+ sb.append("Hash = ").append(hashCode());
+ sb.append(", tableCatalog=").append(tableCatalog);
+ sb.append(", tableSchema=").append(tableSchema);
+ sb.append(", tableName=").append(tableName);
+ sb.append(", columnName=").append(columnName);
+ sb.append(", ordinalPosition=").append(ordinalPosition);
+ sb.append(", columnDefault=").append(columnDefault);
+ sb.append(", isNullable=").append(isNullable);
+ sb.append(", dataType=").append(dataType);
+ sb.append(", characterMaximumLength=").append(characterMaximumLength);
+ sb.append(", characterOctetLength=").append(characterOctetLength);
+ sb.append(", numericPrecision=").append(numericPrecision);
+ sb.append(", numericScale=").append(numericScale);
+ sb.append(", datetimePrecision=").append(datetimePrecision);
+ sb.append(", characterSetName=").append(characterSetName);
+ sb.append(", collationName=").append(collationName);
+ sb.append(", columnType=").append(columnType);
+ sb.append(", columnKey=").append(columnKey);
+ sb.append(", extra=").append(extra);
+ sb.append(", privileges=").append(privileges);
+ sb.append(", columnComment=").append(columnComment);
+ sb.append(", columnSize=").append(columnSize);
+ sb.append(", decimalDigits=").append(decimalDigits);
+ sb.append(", generationExpression=").append(generationExpression);
+ sb.append(", srsId=").append(srsId);
+ sb.append("]");
+ return sb.toString();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/iet/ustb/sf/domain/TableColumn.java b/src/main/java/iet/ustb/sf/domain/TableColumn.java
new file mode 100644
index 0000000..6f71489
--- /dev/null
+++ b/src/main/java/iet/ustb/sf/domain/TableColumn.java
@@ -0,0 +1,167 @@
+package iet.ustb.sf.domain;
+
+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.util.Date;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ *
+ * @TableName mbgk_table_column
+ */
+@TableName(value ="mbgk_table_column")
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class TableColumn {
+ /**
+ * 主键ID
+ */
+ private String id;
+
+ /**
+ * 表名称
+ */
+ private String tableName;
+
+ /**
+ * 中文表名称
+ */
+ private String tableNameCn;
+
+ /**
+ * 列名称
+ */
+ private String columnName;
+
+ /**
+ * 中文列名称
+ */
+ private String columnNameCn;
+
+ /**
+ * 列类型
+ */
+ private String colnumnType;
+
+ /**
+ * 模式
+ */
+ private String schema;
+
+ /**
+ * 数据源
+ */
+ private String dataSource;
+
+ /**
+ * 删除标识,1:true,0:false
+ */
+ private Integer isDelete;
+
+ /**
+ * 主键标识,1:true,0:false
+ */
+ private Integer isPrimary;
+
+ /**
+ * 操作,1:可计算,2:可筛选,可以有多个中间用逗号英文分割
+ */
+ private String op;
+
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+
+ /**
+ * 排序
+ */
+ @TableField("sort_")
+ private Integer sort;
+
+ @Override
+ public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ if (getClass() != that.getClass()) {
+ return false;
+ }
+ TableColumn other = (TableColumn) that;
+ return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+ && (this.getTableName() == null ? other.getTableName() == null : this.getTableName().equals(other.getTableName()))
+ && (this.getTableNameCn() == null ? other.getTableNameCn() == null : this.getTableNameCn().equals(other.getTableNameCn()))
+ && (this.getColumnName() == null ? other.getColumnName() == null : this.getColumnName().equals(other.getColumnName()))
+ && (this.getColumnNameCn() == null ? other.getColumnNameCn() == null : this.getColumnNameCn().equals(other.getColumnNameCn()))
+ && (this.getColnumnType() == null ? other.getColnumnType() == null : this.getColnumnType().equals(other.getColnumnType()))
+ && (this.getSchema() == null ? other.getSchema() == null : this.getSchema().equals(other.getSchema()))
+ && (this.getDataSource() == null ? other.getDataSource() == null : this.getDataSource().equals(other.getDataSource()))
+ && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
+ && (this.getIsPrimary() == null ? other.getIsPrimary() == null : this.getIsPrimary().equals(other.getIsPrimary()))
+ && (this.getOp() == null ? other.getOp() == null : this.getOp().equals(other.getOp()))
+ && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+ && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
+ && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()));
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+ result = prime * result + ((getTableName() == null) ? 0 : getTableName().hashCode());
+ result = prime * result + ((getTableNameCn() == null) ? 0 : getTableNameCn().hashCode());
+ result = prime * result + ((getColumnName() == null) ? 0 : getColumnName().hashCode());
+ result = prime * result + ((getColumnNameCn() == null) ? 0 : getColumnNameCn().hashCode());
+ result = prime * result + ((getColnumnType() == null) ? 0 : getColnumnType().hashCode());
+ result = prime * result + ((getSchema() == null) ? 0 : getSchema().hashCode());
+ result = prime * result + ((getDataSource() == null) ? 0 : getDataSource().hashCode());
+ result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
+ result = prime * result + ((getIsPrimary() == null) ? 0 : getIsPrimary().hashCode());
+ result = prime * result + ((getOp() == null) ? 0 : getOp().hashCode());
+ result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+ result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
+ result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getClass().getSimpleName());
+ sb.append(" [");
+ sb.append("Hash = ").append(hashCode());
+ sb.append(", id=").append(id);
+ sb.append(", tableName=").append(tableName);
+ sb.append(", tableNameCn=").append(tableNameCn);
+ sb.append(", columnName=").append(columnName);
+ sb.append(", columnNameCn=").append(columnNameCn);
+ sb.append(", colnumnType=").append(colnumnType);
+ sb.append(", schema=").append(schema);
+ sb.append(", dataSource=").append(dataSource);
+ sb.append(", isDelete=").append(isDelete);
+ sb.append(", isPrimary=").append(isPrimary);
+ sb.append(", op=").append(op);
+ sb.append(", createTime=").append(createTime);
+ sb.append(", updateTime=").append(updateTime);
+ sb.append(", sort=").append(sort);
+ sb.append("]");
+ return sb.toString();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/iet/ustb/sf/domain/Tables.java b/src/main/java/iet/ustb/sf/domain/Tables.java
new file mode 100644
index 0000000..3a707a4
--- /dev/null
+++ b/src/main/java/iet/ustb/sf/domain/Tables.java
@@ -0,0 +1,215 @@
+package iet.ustb.sf.domain;
+
+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.util.Date;
+import lombok.Data;
+
+/**
+ *
+ * @TableName tables
+ */
+@TableName(value ="information_schema.tables")
+@Data
+public class Tables {
+ /**
+ *
+ */
+ private String tableCatalog;
+
+ /**
+ *
+ */
+ private String tableSchema;
+
+ /**
+ *
+ */
+ private String tableName;
+
+ /**
+ *
+ */
+ private String tableType;
+
+ /**
+ *
+ */
+ private String engine;
+
+ /**
+ *
+ */
+ private Long version;
+
+ /**
+ *
+ */
+ private String rowFormat;
+
+ /**
+ *
+ */
+ private Long tableRows;
+
+ /**
+ *
+ */
+ private Long avgRowLength;
+
+ /**
+ *
+ */
+ private Long dataLength;
+
+ /**
+ *
+ */
+ private Long maxDataLength;
+
+ /**
+ *
+ */
+ private Long indexLength;
+
+ /**
+ *
+ */
+ private Long dataFree;
+
+ /**
+ *
+ */
+ private Long autoIncrement;
+
+ /**
+ *
+ */
+ private Date createTime;
+
+ /**
+ *
+ */
+ private Date updateTime;
+
+ /**
+ *
+ */
+ private Date checkTime;
+
+ /**
+ *
+ */
+ private String tableCollation;
+
+ /**
+ *
+ */
+ private Long checksum;
+
+ /**
+ *
+ */
+ private String createOptions;
+
+ /**
+ *
+ */
+ private String tableComment;
+
+ @Override
+ public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ if (getClass() != that.getClass()) {
+ return false;
+ }
+ Tables other = (Tables) that;
+ return (this.getTableCatalog() == null ? other.getTableCatalog() == null : this.getTableCatalog().equals(other.getTableCatalog()))
+ && (this.getTableSchema() == null ? other.getTableSchema() == null : this.getTableSchema().equals(other.getTableSchema()))
+ && (this.getTableName() == null ? other.getTableName() == null : this.getTableName().equals(other.getTableName()))
+ && (this.getTableType() == null ? other.getTableType() == null : this.getTableType().equals(other.getTableType()))
+ && (this.getEngine() == null ? other.getEngine() == null : this.getEngine().equals(other.getEngine()))
+ && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
+ && (this.getRowFormat() == null ? other.getRowFormat() == null : this.getRowFormat().equals(other.getRowFormat()))
+ && (this.getTableRows() == null ? other.getTableRows() == null : this.getTableRows().equals(other.getTableRows()))
+ && (this.getAvgRowLength() == null ? other.getAvgRowLength() == null : this.getAvgRowLength().equals(other.getAvgRowLength()))
+ && (this.getDataLength() == null ? other.getDataLength() == null : this.getDataLength().equals(other.getDataLength()))
+ && (this.getMaxDataLength() == null ? other.getMaxDataLength() == null : this.getMaxDataLength().equals(other.getMaxDataLength()))
+ && (this.getIndexLength() == null ? other.getIndexLength() == null : this.getIndexLength().equals(other.getIndexLength()))
+ && (this.getDataFree() == null ? other.getDataFree() == null : this.getDataFree().equals(other.getDataFree()))
+ && (this.getAutoIncrement() == null ? other.getAutoIncrement() == null : this.getAutoIncrement().equals(other.getAutoIncrement()))
+ && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+ && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
+ && (this.getCheckTime() == null ? other.getCheckTime() == null : this.getCheckTime().equals(other.getCheckTime()))
+ && (this.getTableCollation() == null ? other.getTableCollation() == null : this.getTableCollation().equals(other.getTableCollation()))
+ && (this.getChecksum() == null ? other.getChecksum() == null : this.getChecksum().equals(other.getChecksum()))
+ && (this.getCreateOptions() == null ? other.getCreateOptions() == null : this.getCreateOptions().equals(other.getCreateOptions()))
+ && (this.getTableComment() == null ? other.getTableComment() == null : this.getTableComment().equals(other.getTableComment()));
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((getTableCatalog() == null) ? 0 : getTableCatalog().hashCode());
+ result = prime * result + ((getTableSchema() == null) ? 0 : getTableSchema().hashCode());
+ result = prime * result + ((getTableName() == null) ? 0 : getTableName().hashCode());
+ result = prime * result + ((getTableType() == null) ? 0 : getTableType().hashCode());
+ result = prime * result + ((getEngine() == null) ? 0 : getEngine().hashCode());
+ result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
+ result = prime * result + ((getRowFormat() == null) ? 0 : getRowFormat().hashCode());
+ result = prime * result + ((getTableRows() == null) ? 0 : getTableRows().hashCode());
+ result = prime * result + ((getAvgRowLength() == null) ? 0 : getAvgRowLength().hashCode());
+ result = prime * result + ((getDataLength() == null) ? 0 : getDataLength().hashCode());
+ result = prime * result + ((getMaxDataLength() == null) ? 0 : getMaxDataLength().hashCode());
+ result = prime * result + ((getIndexLength() == null) ? 0 : getIndexLength().hashCode());
+ result = prime * result + ((getDataFree() == null) ? 0 : getDataFree().hashCode());
+ result = prime * result + ((getAutoIncrement() == null) ? 0 : getAutoIncrement().hashCode());
+ result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+ result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
+ result = prime * result + ((getCheckTime() == null) ? 0 : getCheckTime().hashCode());
+ result = prime * result + ((getTableCollation() == null) ? 0 : getTableCollation().hashCode());
+ result = prime * result + ((getChecksum() == null) ? 0 : getChecksum().hashCode());
+ result = prime * result + ((getCreateOptions() == null) ? 0 : getCreateOptions().hashCode());
+ result = prime * result + ((getTableComment() == null) ? 0 : getTableComment().hashCode());
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getClass().getSimpleName());
+ sb.append(" [");
+ sb.append("Hash = ").append(hashCode());
+ sb.append(", tableCatalog=").append(tableCatalog);
+ sb.append(", tableSchema=").append(tableSchema);
+ sb.append(", tableName=").append(tableName);
+ sb.append(", tableType=").append(tableType);
+ sb.append(", engine=").append(engine);
+ sb.append(", version=").append(version);
+ sb.append(", rowFormat=").append(rowFormat);
+ sb.append(", tableRows=").append(tableRows);
+ sb.append(", avgRowLength=").append(avgRowLength);
+ sb.append(", dataLength=").append(dataLength);
+ sb.append(", maxDataLength=").append(maxDataLength);
+ sb.append(", indexLength=").append(indexLength);
+ sb.append(", dataFree=").append(dataFree);
+ sb.append(", autoIncrement=").append(autoIncrement);
+ sb.append(", createTime=").append(createTime);
+ sb.append(", updateTime=").append(updateTime);
+ sb.append(", checkTime=").append(checkTime);
+ sb.append(", tableCollation=").append(tableCollation);
+ sb.append(", checksum=").append(checksum);
+ sb.append(", createOptions=").append(createOptions);
+ sb.append(", tableComment=").append(tableComment);
+ sb.append("]");
+ return sb.toString();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/iet/ustb/sf/exception/ErrorCode.java b/src/main/java/iet/ustb/sf/exception/ErrorCode.java
index 5b3c10f..9c52a36 100644
--- a/src/main/java/iet/ustb/sf/exception/ErrorCode.java
+++ b/src/main/java/iet/ustb/sf/exception/ErrorCode.java
@@ -18,7 +18,8 @@ public enum ErrorCode {
NOT_FOUND_ERROR(40400, "请求数据不存在"),
FORBIDDEN_ERROR(40300, "禁止访问"),
SYSTEM_ERROR(50000, "系统内部异常"),
- OPERATION_ERROR(50001, "操作失败");
+ OPERATION_ERROR(50001, "操作失败"),
+ NULL_ERROR(60000, "空值");
/**
* 状态码
diff --git a/src/main/java/iet/ustb/sf/mapper/ColumnsMapper.java b/src/main/java/iet/ustb/sf/mapper/ColumnsMapper.java
new file mode 100644
index 0000000..fd3c51f
--- /dev/null
+++ b/src/main/java/iet/ustb/sf/mapper/ColumnsMapper.java
@@ -0,0 +1,18 @@
+package iet.ustb.sf.mapper;
+
+import iet.ustb.sf.domain.Columns;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author hyy
+* @description 针对表【columns】的数据库操作Mapper
+* @createDate 2025-08-05 13:53:45
+* @Entity iet.ustb.sf.domain.Columns
+*/
+public interface ColumnsMapper extends BaseMapper {
+
+}
+
+
+
+
diff --git a/src/main/java/iet/ustb/sf/mapper/TableColumnMapper.java b/src/main/java/iet/ustb/sf/mapper/TableColumnMapper.java
new file mode 100644
index 0000000..c34e165
--- /dev/null
+++ b/src/main/java/iet/ustb/sf/mapper/TableColumnMapper.java
@@ -0,0 +1,49 @@
+package iet.ustb.sf.mapper;
+
+import iet.ustb.sf.domain.TableColumn;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+* @author hyy
+* @description 针对表【mbgk_table_column】的数据库操作Mapper
+* @createDate 2025-08-05 12:33:36
+* @Entity iet.ustb.sf.domain.TableColumn
+*/
+public interface TableColumnMapper extends BaseMapper {
+
+ @Select("SELECT DISTINCT c.table_name AS \"tableName\", " +
+ " c.column_name AS \"columnName\", " +
+ " c.data_type AS \"colnumnType\", " +
+ " cc.comments AS \"columnNameCn\", " +
+ " t.comments AS \"tableNameCn\", " +
+ " t.owner AS \"schema\", " +
+ " CASE " +
+ " WHEN kcu.column_name IS NOT NULL THEN '1' " +
+ " ELSE '0' " +
+ " END AS \"isPrimary\" " +
+ "FROM all_tab_columns c " +
+ " JOIN all_tab_comments t " +
+ " ON c.table_name = t.table_name " +
+ " AND c.owner = t.owner " +
+ " LEFT JOIN all_col_comments cc " +
+ " ON c.table_name = cc.table_name " +
+ " AND c.column_name = cc.column_name " +
+ " AND c.owner = cc.owner " +
+ " LEFT JOIN all_cons_columns kcu " +
+ " ON c.table_name = kcu.table_name " +
+ " AND c.column_name = kcu.column_name " +
+ " AND c.owner = kcu.owner " +
+ " LEFT JOIN all_constraints ku " +
+ " ON kcu.constraint_name = ku.constraint_name " +
+ " AND ku.constraint_type = 'P' " +
+ "WHERE c.table_name = ?1")
+ List