增加查询所有表接口
This commit is contained in:
parent
49fd6d3639
commit
d63947856b
|
|
@ -43,6 +43,21 @@ public class GenController {
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库列表
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param pageParam 分页参数
|
||||||
|
* @param params 搜索参数
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
@GetMapping("/dbAll")
|
||||||
|
public Object dbAll(@Validated PageParam pageParam,
|
||||||
|
@RequestParam Map<String, String> params) {
|
||||||
|
PageResult<DbTableVo> list = iGenerateService.dbAll(pageParam, params);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成列表
|
* 生成列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,27 @@ public interface GenTableMapper extends IBaseMapper<GenTable> {
|
||||||
"</script>"})
|
"</script>"})
|
||||||
List<DbTableVo> selectDbTableList(Map<String, String> params);
|
List<DbTableVo> selectDbTableList(Map<String, String> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库中的数据表
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param params 参数
|
||||||
|
* @return List<Map<String, String>>
|
||||||
|
*/
|
||||||
|
@Select({"<script>",
|
||||||
|
"SELECT table_name, table_comment, create_time, update_time " +
|
||||||
|
"FROM information_schema.tables " +
|
||||||
|
"WHERE table_schema = (SELECT database()) " +
|
||||||
|
"AND table_name NOT LIKE 'qrtz_%' AND table_name NOT LIKE 'gen_%' " +
|
||||||
|
"<if test=\"tableName != null and tableName != ''\">" +
|
||||||
|
"AND lower(table_name) like lower(concat('%', #{tableName}, '%'))" +
|
||||||
|
"</if>",
|
||||||
|
"<if test=\"tableComment != null and tableComment != ''\">" +
|
||||||
|
"AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))" +
|
||||||
|
"</if>",
|
||||||
|
"</script>"})
|
||||||
|
List<DbTableVo> selectDbTableAllList(Map<String, String> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据表名集查询表
|
* 根据表名集查询表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,16 @@ public interface IGenerateService {
|
||||||
*/
|
*/
|
||||||
PageResult<DbTableVo> db(PageParam pageParam, Map<String, String> params);
|
PageResult<DbTableVo> db(PageParam pageParam, Map<String, String> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有库表
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param pageParam 分页参数
|
||||||
|
* @param params 搜索参数
|
||||||
|
* @return PageResult<Map<String, String>>
|
||||||
|
*/
|
||||||
|
PageResult<DbTableVo> dbAll(PageParam pageParam, Map<String, String> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成列表
|
* 生成列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,31 @@ public class GenerateServiceImpl implements IGenerateService {
|
||||||
return PageResult.pageHelper(tables);
|
return PageResult.pageHelper(tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库列表
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param pageParam 分页参数
|
||||||
|
* @param params 搜索参数
|
||||||
|
* @return PageResult<Map<String, String>>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageResult<DbTableVo> dbAll(PageParam pageParam, Map<String, String> params) {
|
||||||
|
Integer page = pageParam.getPageNo();
|
||||||
|
Integer limit = pageParam.getPageSize();
|
||||||
|
|
||||||
|
PageHelper.startPage(page, limit);
|
||||||
|
List<DbTableVo> tables = genTableMapper.selectDbTableAllList(params);
|
||||||
|
|
||||||
|
for (DbTableVo vo : tables) {
|
||||||
|
if (vo.getUpdateTime() == null) {
|
||||||
|
vo.setUpdateTime("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PageResult.pageHelper(tables);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成列表
|
* 生成列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue