From aa9fd1e5f0dde446d3a48a1897d29a9f1b25de26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E5=B9=B4=E6=A2=A6=E4=B8=8E=E7=A0=96?= <2847127106@qq.com> Date: Tue, 27 Aug 2024 20:19:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B9=E6=B3=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=89=80=E6=9C=89=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../muyu/gen/controller/GenController.java | 8 ++++ .../com/muyu/gen/domain/GenTableResp.java | 43 +++++++++++++++++++ .../com/muyu/gen/mapper/GenTableMapper.java | 3 ++ .../muyu/gen/service/GenTableServiceImpl.java | 5 +++ .../muyu/gen/service/IGenTableService.java | 3 ++ .../mapper/generator/GenTableMapper.xml | 7 +++ 6 files changed, 69 insertions(+) create mode 100644 src/main/java/com/muyu/gen/domain/GenTableResp.java diff --git a/src/main/java/com/muyu/gen/controller/GenController.java b/src/main/java/com/muyu/gen/controller/GenController.java index 5d70f38..c6a7eb9 100644 --- a/src/main/java/com/muyu/gen/controller/GenController.java +++ b/src/main/java/com/muyu/gen/controller/GenController.java @@ -9,6 +9,7 @@ import com.muyu.common.log.enums.BusinessType; import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.gen.domain.GenTable; import com.muyu.gen.domain.GenTableColumn; +import com.muyu.gen.domain.GenTableResp; import com.muyu.gen.service.IGenTableColumnService; import com.muyu.gen.service.IGenTableService; import jakarta.servlet.http.HttpServletResponse; @@ -216,6 +217,13 @@ public class GenController extends BaseController return Result.success(genTableService.selDbNameAll()); } + /** + * 查询所有表,不分数据库 + */ + @GetMapping("/db/listAll") + public Result> genListAll() { + return success(genTableService.selectDbTableListAll()); + } /** * 根据数据库名称与表名称查询表字段 diff --git a/src/main/java/com/muyu/gen/domain/GenTableResp.java b/src/main/java/com/muyu/gen/domain/GenTableResp.java new file mode 100644 index 0000000..70b30dc --- /dev/null +++ b/src/main/java/com/muyu/gen/domain/GenTableResp.java @@ -0,0 +1,43 @@ +package com.muyu.gen.domain; + +import com.muyu.common.core.constant.GenConstants; +import com.muyu.common.core.utils.StringUtils; +import com.muyu.common.core.web.domain.BaseEntity; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.List; + + +/** + * 业务表 gen_table + * + * @author muyu + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class GenTableResp extends BaseEntity { + + private String dbName; + + /** + * 表名称 + */ + private String tableName; + + /** + * 表描述 + */ + private String tableComment; + + +} diff --git a/src/main/java/com/muyu/gen/mapper/GenTableMapper.java b/src/main/java/com/muyu/gen/mapper/GenTableMapper.java index 5a0a41b..aa49b3f 100644 --- a/src/main/java/com/muyu/gen/mapper/GenTableMapper.java +++ b/src/main/java/com/muyu/gen/mapper/GenTableMapper.java @@ -1,6 +1,7 @@ package com.muyu.gen.mapper; import com.muyu.gen.domain.GenTable; +import com.muyu.gen.domain.GenTableResp; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -85,4 +86,6 @@ public interface GenTableMapper public int deleteGenTableByIds(@Param("ids") Long[] ids); List selDbNameAll(); + + List selectDbTableListAll(); } diff --git a/src/main/java/com/muyu/gen/service/GenTableServiceImpl.java b/src/main/java/com/muyu/gen/service/GenTableServiceImpl.java index 3d5ba35..8cdefc5 100644 --- a/src/main/java/com/muyu/gen/service/GenTableServiceImpl.java +++ b/src/main/java/com/muyu/gen/service/GenTableServiceImpl.java @@ -10,6 +10,7 @@ import com.muyu.common.core.utils.StringUtils; import com.muyu.common.security.utils.SecurityUtils; import com.muyu.gen.domain.GenTable; import com.muyu.gen.domain.GenTableColumn; +import com.muyu.gen.domain.GenTableResp; import com.muyu.gen.mapper.GenTableColumnMapper; import com.muyu.gen.mapper.GenTableMapper; import com.muyu.gen.util.GenUtils; @@ -437,6 +438,10 @@ public class GenTableServiceImpl implements IGenTableService return genTableMapper.selDbNameAll(); } + @Override + public List selectDbTableListAll() { + return genTableMapper.selectDbTableListAll(); + } /** diff --git a/src/main/java/com/muyu/gen/service/IGenTableService.java b/src/main/java/com/muyu/gen/service/IGenTableService.java index ff1e96f..f79d5e8 100644 --- a/src/main/java/com/muyu/gen/service/IGenTableService.java +++ b/src/main/java/com/muyu/gen/service/IGenTableService.java @@ -1,6 +1,7 @@ package com.muyu.gen.service; import com.muyu.gen.domain.GenTable; +import com.muyu.gen.domain.GenTableResp; import java.util.List; import java.util.Map; @@ -123,4 +124,6 @@ public interface IGenTableService public void validateEdit(GenTable genTable); List selDbNameAll(); + + List selectDbTableListAll(); } diff --git a/src/main/resources/mapper/generator/GenTableMapper.xml b/src/main/resources/mapper/generator/GenTableMapper.xml index 0e0af77..bfb7edd 100644 --- a/src/main/resources/mapper/generator/GenTableMapper.xml +++ b/src/main/resources/mapper/generator/GenTableMapper.xml @@ -155,6 +155,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + insert into gen_table (