20230221@xingjs@提交官网一张图相关内容接口
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | |
| | | return success(resList); |
| | | }*/ |
| | | |
| | | /** |
| | | * 根据表名查询表字段信息 |
| | | * Query table field information according to table name |
| | | */ |
| | | @ApiOperation(value = "根据表名查询表字段信息") |
| | | @GetMapping("/selectTableInfo") |
| | | public ResponseMsg<Object> selectTableInfo(@RequestParam("tableName") String tableName) { |
| | | List<String> resList = aMapOfPipelineService.queryTableInfo(tableName); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.lf.server.mapper.show; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return {@link List}<{@link String}> |
| | | */ |
| | | public List<String> countProjectType1(); |
| | | |
| | | /** |
| | | * 查询表信息 |
| | | * |
| | | * @return {@link List}<{@link String}> |
| | | */ |
| | | public List<String> queryTableInfo(@Param("tableName") String tableName); |
| | | } |
| | |
| | | public List<String> countProjectType1() { |
| | | return aMapOfPipelineMapper.countProjectType1(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询表信息 |
| | | * |
| | | * @return {@link List}<{@link String}> |
| | | */ |
| | | @Override |
| | | public List<String> queryTableInfo(String tableName) { |
| | | return aMapOfPipelineMapper.queryTableInfo(tableName); |
| | | } |
| | | } |
| | |
| | | </select> |
| | | |
| | | |
| | | <!-- 查询表信息 --> |
| | | <select id="queryTableInfo" resultType="java.util.Map"> |
| | | SELECT a.attnum, |
| | | a.attname, |
| | | concat_ws('',t.typname,SUBSTRING(format_type(a.atttypid,a.atttypmod) |
| | | FROM '\(.*\)')) AS type,d.description,typnotnull |
| | | FROM pg_class c,pg_attribute a,pg_type t,pg_description d |
| | | WHERE c.relname= '${tableName}' |
| | | AND a.attnum>0 |
| | | AND a.attrelid=c.oid |
| | | AND a.atttypid=t.oid |
| | | AND d.objoid=a.attrelid |
| | | AND d.objsubid=a.attnum; |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |