管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-03-03 0816d0ea55506747a76ac915c20b0ff7ca33600a
src/main/java/com/lf/server/controller/all/BaseQueryController.java
@@ -271,12 +271,13 @@
    @SysLog()
    @ApiOperation(value = "查询所有表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点")
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点"),
            @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false")
    })
    @GetMapping(value = "/selectTabs")
    public ResponseMsg<List<TabEntity>> selectTabs(String name) {
    public ResponseMsg<List<TabEntity>> selectTabs(String name, Boolean hasGeom) {
        try {
            List<TabEntity> list = dictService.selectDictTab(name);
            List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom");
            return success(list);
        } catch (Exception ex) {
@@ -291,10 +292,11 @@
            @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"),
            @ApiImplicitParam(name = "dirs", value = "目录编码", dataType = "String", paramType = "query", example = "00,01"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_"),
            @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    public ResponseMsg<Object> selectTabsByPage(String depcode, String dirs, String tab, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<Object> selectTabsByPage(String depcode, String dirs, String tab, Boolean hasGeom, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
@@ -312,12 +314,13 @@
                filters += String.format(" and (%s)", dirs);
            }
            int count = baseQueryService.selectTabsForCount(tab);
            String field = null == hasGeom || !hasGeom ? "gid" : "geom";
            int count = baseQueryService.selectTabsForCount(tab, field);
            if (count == 0) {
                return success(0, null);
            }
            List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, filters, pageSize, pageSize * (pageIndex - 1));
            List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, field, filters, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {