Selaa lähdekoodia

多数据源查询

LAPTOP-BJJ3IV5R\SIWEI 1 vuosi sitten
vanhempi
commit
e243c83a1e
18 muutettua tiedostoa jossa 766 lisäystä ja 0 poistoa
  1. 25 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/table/TableDataSelectController.java
  2. 70 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/config/fzss/HgxfxRwJgTempDTO.java
  3. 48 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableDTO.java
  4. 31 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableDataVo.java
  5. 47 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableFiledDTO.java
  6. 47 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableFiledRelationDTO.java
  7. 114 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableResRuleDTO.java
  8. 21 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableDataSelectMapper.java
  9. 14 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableFiledMapper.java
  10. 11 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableFiledRelationMapper.java
  11. 14 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableMapper.java
  12. 11 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableResRuleMapper.java
  13. 246 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/table/TableDataSelectServiceImpl.java
  14. 8 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/table/TableDataSelectService.java
  15. 24 0
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableDataSelectMapper.xml
  16. 15 0
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableFiledMapper.xml
  17. 10 0
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableMapper.xml
  18. 10 0
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableResRuleMapper.xml

+ 25 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/table/TableDataSelectController.java

@@ -0,0 +1,25 @@
+package com.onemap.apply.controller.table;
+
+import com.onemap.apply.service.table.TableDataSelectService;
+import com.onemap.common.core.web.controller.BaseController;
+import com.onemap.common.core.web.domain.RequestResult;
+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.RestController;
+
+
+@RestController
+@RequestMapping("/table")
+public class TableDataSelectController extends BaseController {
+    @Autowired
+    private TableDataSelectService tableDataSelectService;
+
+    @GetMapping("/GetTableData")
+    public RequestResult GetTestList(String wkt, String id) {
+//        String id = "fa10c8ee6c3c499ea6e09438eeeb18af";
+//        String wkt = "SRID=4326;POINT(109.5139541 18.3146153)";
+        return RequestResult.success(tableDataSelectService.dataSelectByPoint(wkt, id));
+    }
+
+}

+ 70 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/config/fzss/HgxfxRwJgTempDTO.java

@@ -0,0 +1,70 @@
+package com.onemap.apply.domain.config.fzss;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+@TableName("t_fzss_hgxfx_rw_jg_temp")
+public class HgxfxRwJgTempDTO {
+    private String bsm;
+    private String rwbsm;
+    private String scxbsm;
+    private String yslx;
+    private String yslxmc;
+    private Double mj;
+    private String geom;
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getRwbsm() {
+        return rwbsm;
+    }
+
+    public void setRwbsm(String rwbsm) {
+        this.rwbsm = rwbsm;
+    }
+
+    public String getScxbsm() {
+        return scxbsm;
+    }
+
+    public void setScxbsm(String scxbsm) {
+        this.scxbsm = scxbsm;
+    }
+
+    public String getYslx() {
+        return yslx;
+    }
+
+    public void setYslx(String yslx) {
+        this.yslx = yslx;
+    }
+
+    public String getYslxmc() {
+        return yslxmc;
+    }
+
+    public void setYslxmc(String yslxmc) {
+        this.yslxmc = yslxmc;
+    }
+
+    public Double getMj() {
+        return mj;
+    }
+
+    public void setMj(Double mj) {
+        this.mj = mj;
+    }
+
+    public String getGeom() {
+        return geom;
+    }
+
+    public void setGeom(String geom) {
+        this.geom = geom;
+    }
+}

+ 48 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableDTO.java

@@ -0,0 +1,48 @@
+package com.onemap.apply.domain.table;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+@TableName("t_table")
+public class TableDTO {
+    private String id;
+    @TableField(value = "table_name")
+    private String tableName;
+    @TableField(value = "table_describe")
+    private String tableDescribe;
+    @TableField(value = "create_time")
+    private String createTime;
+//    t_table_filed_relation
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+
+    public String getTableName() {
+        return tableName;
+    }
+
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
+
+    public String getTableDescribe() {
+        return tableDescribe;
+    }
+
+    public void setTableDescribe(String tableDescribe) {
+        this.tableDescribe = tableDescribe;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+}

+ 31 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableDataVo.java

@@ -0,0 +1,31 @@
+package com.onemap.apply.domain.table;
+
+public class TableDataVo {
+    private String filed;
+    private String filedZH;
+    private Object data;
+
+    public String getFiled() {
+        return filed;
+    }
+
+    public void setFiled(String filed) {
+        this.filed = filed;
+    }
+
+    public String getFiledZH() {
+        return filedZH;
+    }
+
+    public void setFiledZH(String filedZH) {
+        this.filedZH = filedZH;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+}

+ 47 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableFiledDTO.java

@@ -0,0 +1,47 @@
+package com.onemap.apply.domain.table;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+@TableName("t_table_filed")
+public class TableFiledDTO {
+    private String id;
+    @TableField(value = "filed_name")
+    private String filedName;
+    @TableField(value = "filed_zh")
+    private String filedZh;
+    @TableField(value = "create_time")
+    private String createTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getFiledName() {
+        return filedName;
+    }
+
+    public void setFiledName(String filedName) {
+        this.filedName = filedName;
+    }
+
+    public String getFiledZh() {
+        return filedZh;
+    }
+
+    public void setFiledZh(String filedZh) {
+        this.filedZh = filedZh;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+}

+ 47 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableFiledRelationDTO.java

@@ -0,0 +1,47 @@
+package com.onemap.apply.domain.table;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+@TableName("t_table_filed_relation")
+public class TableFiledRelationDTO {
+    private String id;
+    @TableField(value = "table_id")
+    private String tableId;
+    @TableField(value = "filed_id")
+    private String filedId;
+    @TableField(value = "create_time")
+    private String createTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getTableId() {
+        return tableId;
+    }
+
+    public void setTableId(String tableId) {
+        this.tableId = tableId;
+    }
+
+    public String getFiledId() {
+        return filedId;
+    }
+
+    public void setFiledId(String filedId) {
+        this.filedId = filedId;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+}

+ 114 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/table/TableResRuleDTO.java

@@ -0,0 +1,114 @@
+package com.onemap.apply.domain.table;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+@TableName("t_table_res_rule")
+public class TableResRuleDTO {
+    private String id;
+    private String pid;
+    private String name;
+    @TableField(value = "from_table_id")
+    private String fromTableId;
+    @TableField(value = "from_table_version")
+    private String fromTableVersion;
+    @TableField(value = "analyse_table_id")
+    private String analyseTableId;
+    @TableField(value = "analyse_table_version")
+    private String analyseTableVersion;
+    @TableField(value = "analyse_type")
+    private String analyseType;
+    @TableField(value = "create_user_id")
+    private String createUserId;
+    @TableField(value = "create_time")
+    private String createTime;
+    private String describe;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getFromTableId() {
+        return fromTableId;
+    }
+
+    public void setFromTableId(String fromTableId) {
+        this.fromTableId = fromTableId;
+    }
+
+    public String getFromTableVersion() {
+        return fromTableVersion;
+    }
+
+    public void setFromTableVersion(String fromTableVersion) {
+        this.fromTableVersion = fromTableVersion;
+    }
+
+    public String getAnalyseTableId() {
+        return analyseTableId;
+    }
+
+    public void setAnalyseTableId(String analyseTableId) {
+        this.analyseTableId = analyseTableId;
+    }
+
+    public String getAnalyseTableVersion() {
+        return analyseTableVersion;
+    }
+
+    public void setAnalyseTableVersion(String analyseTableVersion) {
+        this.analyseTableVersion = analyseTableVersion;
+    }
+
+    public String getAnalyseType() {
+        return analyseType;
+    }
+
+    public void setAnalyseType(String analyseType) {
+        this.analyseType = analyseType;
+    }
+
+    public String getCreateUserId() {
+        return createUserId;
+    }
+
+    public void setCreateUserId(String createUserId) {
+        this.createUserId = createUserId;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getDescribe() {
+        return describe;
+    }
+
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+}

+ 21 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableDataSelectMapper.java

@@ -0,0 +1,21 @@
+package com.onemap.apply.mapper.table;
+
+import com.onemap.common.datasource.annotation.Slave;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+@Slave
+public interface TableDataSelectMapper {
+
+    /**
+     * @param id
+     * @param outputColumn
+     * @return
+     */
+    Map getTableDataById(@Param("inputTable") String inputTable, @Param("id") String id, @Param("outputColumn") List<String> outputColumn);
+
+}

+ 14 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableFiledMapper.java

@@ -0,0 +1,14 @@
+package com.onemap.apply.mapper.table;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.table.TableDTO;
+import com.onemap.apply.domain.table.TableFiledDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface TableFiledMapper extends BaseMapper<TableFiledDTO> {
+    List<TableFiledDTO> getFiledDTOByTableId(@Param("tableId") String tableId, @Param("isDisplay") Integer isDisplay);
+}

+ 11 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableFiledRelationMapper.java

@@ -0,0 +1,11 @@
+package com.onemap.apply.mapper.table;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.table.TableDTO;
+import com.onemap.apply.domain.table.TableFiledRelationDTO;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface TableFiledRelationMapper extends BaseMapper<TableFiledRelationDTO> {
+}

+ 14 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableMapper.java

@@ -0,0 +1,14 @@
+package com.onemap.apply.mapper.table;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.table.TableDTO;
+import com.onemap.apply.domain.table.TableResRuleDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface TableMapper extends BaseMapper<TableDTO> {
+    //    fa10c8ee6c3c499ea6e09438eeeb18af
+    TableDTO getTableById(@Param("id") String id);
+
+}

+ 11 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/table/TableResRuleMapper.java

@@ -0,0 +1,11 @@
+package com.onemap.apply.mapper.table;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.table.TableResRuleDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface TableResRuleMapper extends BaseMapper<TableResRuleDTO> {
+    TableResRuleDTO getTableEesRuleById(@Param("id") String id);
+}

+ 246 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/table/TableDataSelectServiceImpl.java

@@ -0,0 +1,246 @@
+package com.onemap.apply.service.impl.table;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.onemap.apply.domain.table.TableDTO;
+import com.onemap.apply.domain.table.TableDataVo;
+import com.onemap.apply.domain.table.TableFiledDTO;
+import com.onemap.apply.domain.table.TableResRuleDTO;
+import com.onemap.apply.mapper.table.*;
+import com.onemap.apply.service.table.TableDataSelectService;
+import com.onemap.common.core.utils.StringUtils;
+import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.system.api.AnalyseService;
+import oracle.jdbc.internal.ObjectData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Service
+public class TableDataSelectServiceImpl implements TableDataSelectService {
+    @Resource
+    private TableResRuleMapper tableResRuleMapper;
+    @Resource
+    private TableMapper tableMapper;
+    @Resource
+    private TableDataSelectMapper tableDataSelectMapper;
+    @Resource
+    private AnalyseService analyseService;
+    @Resource
+    private TableFiledRelationMapper tableFiledRelationMapper;
+    @Resource
+    private TableFiledMapper tableFiledMapper;
+
+    @Override
+    public Map dataSelectByPoint(String pointEWkt, String bsm) {
+        Map retList = new LinkedHashMap<>();
+        if (StringUtils.isNotEmpty(bsm)) {
+            QueryWrapper<TableResRuleDTO> queryResOneWrapper = new QueryWrapper<>();
+            queryResOneWrapper.eq("id", bsm);
+            TableResRuleDTO v_table_res_id = tableResRuleMapper.selectOne(queryResOneWrapper);
+
+            List<List<TableDataVo>> data = dataSelectById(pointEWkt, bsm);
+            if (data == null || data.size() <= 0) {
+                return retList;
+            }
+            retList.put("data", data);
+            retList.put("dataname", getTableName(v_table_res_id.getFromTableId()));
+
+            QueryWrapper<TableResRuleDTO> queryResWrapper = new QueryWrapper<>();
+            queryResWrapper.eq("pid", bsm);
+            List<TableResRuleDTO> v_table_Res = tableResRuleMapper.selectList(queryResWrapper);
+            List<Map> childLit = new ArrayList<>();
+            for (TableResRuleDTO tableResRuleDTO : v_table_Res) {
+                Map childMap = new HashMap();
+                List<Map> v_data = new ArrayList<>();
+                List<Map> v_child = new ArrayList<>();
+                for (List<TableDataVo> dataMap : data) {
+                    String geomEWKT = null;
+                    for (TableDataVo tableDataVo : dataMap) {
+                        if ("geom".equals(tableDataVo.getFiled())) {
+                            geomEWKT = (String) tableDataVo.getData();
+                        }
+                    }
+                    if (StringUtils.isNotEmpty(geomEWKT)) {
+                        Map v_childMap = dataSelectByPoint(geomEWKT, tableResRuleDTO.getId());
+                        if (v_childMap != null) {
+                            v_data.addAll((List<Map>) v_childMap.get("data"));
+                            v_child.addAll((List<Map>) v_childMap.get("child"));
+                        }
+                    }
+                }
+                childMap.put("dataname", getTableName(tableResRuleDTO.getAnalyseTableId()));
+                childMap.put("data", v_data);
+                childMap.put("child", v_child);
+                childLit.add(childMap);
+            }
+            retList.put("child", childLit);
+        }
+        return retList;
+    }
+
+    private String getTableName(String bsm) {
+        // 获取from_table_id
+        QueryWrapper<TableDTO> queryFromTableWrapper = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(bsm)) {
+            queryFromTableWrapper.eq("id", bsm);
+        } else {
+            return null;
+        }
+        // 获取from_table_id
+        queryFromTableWrapper.eq("id", bsm);
+        TableDTO v_from_table = tableMapper.selectOne(queryFromTableWrapper);
+        if (StringUtils.isNull(v_from_table)) {
+            return null;
+        }
+        return v_from_table.getTableDescribe();
+    }
+
+    private List<List<TableDataVo>> dataSelectById(String pointEWkt, String bsm) {
+        List<List<TableDataVo>> retList = new ArrayList<>();
+        QueryWrapper<TableResRuleDTO> queryResWrapper = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(bsm)) {
+            queryResWrapper.eq("id", bsm);
+        } else {
+            return retList;
+        }
+
+        TableResRuleDTO v_table_Res = tableResRuleMapper.selectOne(queryResWrapper);
+        if (StringUtils.isNull(v_table_Res)) {
+            return retList;
+        }
+
+        // 获取from_table_id
+        QueryWrapper<TableDTO> queryFromTableWrapper = new QueryWrapper<>();
+        queryFromTableWrapper.eq("id", v_table_Res.getFromTableId());
+        TableDTO v_from_table = tableMapper.selectOne(queryFromTableWrapper);
+        if (StringUtils.isNull(v_from_table)) {
+            return retList;
+        }
+
+        // 获取analyse_table_id
+        TableDTO v_analyse_table = null;
+        if (StringUtils.isNotEmpty(v_table_Res.getAnalyseTableId())) {
+            QueryWrapper<TableDTO> queryAnalyseTableWrapper = new QueryWrapper<>();
+            queryAnalyseTableWrapper.eq("id", v_table_Res.getAnalyseTableId());
+            v_analyse_table = tableMapper.selectOne(queryAnalyseTableWrapper);
+        }
+        String v_analyse_type = v_table_Res.getAnalyseType();
+        if (v_analyse_table == null) {
+            //intersects 相交
+            //intersection 交集
+//            v_table_Res.getAnalyseType();
+            if ("intersection".equals(v_analyse_type)) {
+                return tabelIntersectionHandle(pointEWkt, v_from_table.getTableName(), v_from_table.getId());
+            }
+            return tabelIntersectsHandle(pointEWkt, v_from_table.getTableName(), v_from_table.getId());
+        } else {
+            if ("intersection".equals(v_analyse_type)) {
+                return tabelIntersectionHandle(pointEWkt, v_analyse_table.getTableName(), v_analyse_table.getId());
+            }
+            return tabelIntersectsHandle(pointEWkt, v_analyse_table.getTableName(), v_analyse_table.getId());
+        }
+    }
+
+
+    //取相交的函数
+    private List<List<TableDataVo>> tabelIntersectsHandle(String eWkt, String tableName, String tableId) {
+        List<List<TableDataVo>> retList = new ArrayList<>();
+        List<String> from_kj_ids = intersectsTableWkt(tableName, null, null, eWkt, null);
+        if (from_kj_ids == null || from_kj_ids.size() == 0) {
+            return retList;
+        }
+
+        List<TableFiledDTO> filedlist = getFieldListByTableId(tableId, null);
+        List<String> outputColumn = new ArrayList<>();
+        for (TableFiledDTO v_data : filedlist) {
+            outputColumn.add(v_data.getFiledName());
+        }
+        List<Map> retDataList = new ArrayList<>();
+        for (String v_id : from_kj_ids) {
+            Map map = tableDataSelectMapper.getTableDataById(tableName, v_id, outputColumn);
+            retDataList.add(map);
+        }
+        return dataMapTransFormZh(retDataList, filedlist);
+    }
+
+    //取并集的函数
+    private List<List<TableDataVo>> tabelIntersectionHandle(String eWkt, String tableName, String tableId) {
+        List<List<TableDataVo>> retList = new ArrayList<>();
+        List<String> from_kj_ids = intersectsTableWkt(tableName, null, null, eWkt, null);
+        if (from_kj_ids == null || from_kj_ids.size() == 0) {
+            return retList;
+        }
+
+        List<TableFiledDTO> list = getFieldListByTableId(tableId, null);
+        List<String> outputColumn = new ArrayList<>();
+        for (TableFiledDTO v_data : list) {
+            outputColumn.add(v_data.getFiledName());
+        }
+        List<Map> from_jg = intersectionTableWkt(tableName, 4326, from_kj_ids, eWkt, 4525, outputColumn);
+        if (from_jg == null || from_jg.size() == 0) {
+            return dataMapTransFormZh(from_jg, list);
+        }
+        return retList;
+    }
+
+    public List<List<TableDataVo>> dataMapTransFormZh(List<Map> from_jg, List<TableFiledDTO> filedList) {
+        List<List<TableDataVo>> retList = new ArrayList<>();
+        if (from_jg == null || from_jg.size() == 0) {
+            return retList;
+        }
+        if (filedList == null || filedList.size() == 0) {
+            return retList;
+        }
+        //循环结果
+        for (Map v_data : from_jg) {
+            //循环字段
+            List<TableDataVo> v_dataList = new ArrayList<>();
+            for (TableFiledDTO v_filed_data : filedList) {
+                String v_filedName = v_filed_data.getFiledName();
+                String v_filedZh = v_filed_data.getFiledZh();
+                Object v_filedData = v_data.get(v_filedName);
+                TableDataVo tableDataVo = new TableDataVo();
+                tableDataVo.setData(v_filedData);
+                tableDataVo.setFiledZH(v_filedZh);
+                tableDataVo.setFiled(v_filedName);
+                v_dataList.add(tableDataVo);
+            }
+            retList.add(v_dataList);
+        }
+        return retList;
+    }
+
+    public List<String> intersectsTableWkt(String inputTable, Integer inputSRID, List<String> inputIds, String intersectsWkt, Integer intersectsWktSRID) {
+        RequestResult result = analyseService.intersectsTableWkt(inputTable, inputSRID, inputIds, intersectsWkt, intersectsWktSRID);
+        Integer statuscode = (Integer) result.get("statuscode");
+        if (statuscode == 200) {
+            Object resultDataObject = result.get("data");
+            if (StringUtils.isNotNull(resultDataObject)) {
+                List<String> idsList = (List<String>) resultDataObject;
+                return idsList;
+            }
+        }
+        return null;
+    }
+
+    public List<Map> intersectionTableWkt(String inputTable, Integer inputSRID, List<String> inputIds, String intersectsWkt, Integer intersectsWktSRID, List<String> outputColumn) {
+        RequestResult result = analyseService.intersectionTableWkt(inputTable, inputSRID, inputIds, intersectsWkt, intersectsWktSRID, outputColumn);
+        Integer statuscode = (Integer) result.get("statuscode");
+        if (statuscode == 200) {
+            Object resultDataObject = result.get("data");
+            if (StringUtils.isNotNull(resultDataObject)) {
+                List<Map> idsList = (List<Map>) resultDataObject;
+                return idsList;
+            }
+        }
+        return null;
+    }
+
+
+    public List<TableFiledDTO> getFieldListByTableId(String tableId, Integer isDisplay) {
+        List<TableFiledDTO> list = tableFiledMapper.getFiledDTOByTableId(tableId, isDisplay);
+        return list;
+    }
+}

+ 8 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/table/TableDataSelectService.java

@@ -0,0 +1,8 @@
+package com.onemap.apply.service.table;
+
+import java.util.Map;
+
+public interface TableDataSelectService {
+
+    public Map dataSelectByPoint(String pointEWkt, String bsm);
+}

+ 24 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableDataSelectMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.onemap.apply.mapper.table.TableDataSelectMapper">
+
+    <select id="getTableDataById" resultType="java.util.Map">
+        SELECT 'data' as v_data
+        <if test="outputColumn != null and outputColumn.size()>0 ">
+            <foreach collection="outputColumn" item="columnValue" open="," separator=",">
+                <choose>
+                    <when test="columnValue =='geom'">
+                        public.st_asewkt(geom) geom
+                    </when>
+                    <otherwise>
+                        "${columnValue}"
+                    </otherwise>
+                </choose>
+            </foreach>
+        </if>
+        FROM "${inputTable}" inTbale
+        where (inTbale.id)::VARCHAR = #{id}
+    </select>
+
+</mapper>

+ 15 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableFiledMapper.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.onemap.apply.mapper.table.TableFiledMapper">
+    <select id="getFiledDTOByTableId" resultType="com.onemap.apply.domain.table.TableFiledDTO">
+        select t1.id, t1.filed_name filedName, t1.filed_zh filedZh
+        from t_table_filed_relation t
+        left join t_table_filed t1 on t.filed_id = t1.id
+        where t.table_id = #{tableId}
+        <if test="isDisplay != null and isDisplay != ''">
+            t.is_display = #{isDisplay}
+        </if>
+        order by t.sort
+    </select>
+</mapper>

+ 10 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableMapper.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.onemap.apply.mapper.table.TableMapper">
+    <select id="getTableById" resultType="com.onemap.apply.domain.table.TableDTO">
+        select *
+        from t_table
+        where id = #{id}
+    </select>
+</mapper>

+ 10 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/table/TableResRuleMapper.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.onemap.apply.mapper.table.TableResRuleMapper">
+    <select id="getTableEesRuleById" resultType="com.onemap.apply.domain.table.TableResRuleDTO">
+        select *
+        from t_table_res_rule
+        where id = #{id}
+    </select>
+</mapper>