瀏覽代碼

添加查询二维实体列表接口

DESKTOP-2K9OVK9\siwei 5 月之前
父節點
當前提交
873611bd4f

+ 5 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/dimentity/DimEntityController.java

@@ -24,6 +24,11 @@ public class DimEntityController {
         return RequestResult.success(dimEntityService.queryEntityCodeTableTree(id));
     }
 
+    @GetMapping("/entity/code/table/list")
+    public RequestResult queryEntityCodeTableList(String id, String entityid, String entityname) {
+        return RequestResult.success(dimEntityService.queryEntityCodeTableList(id, entityid, entityname));
+    }
+
     @GetMapping("/entity/data")
     public RequestResult queryEntityData(String entityid) {
         return RequestResult.success(dimEntityService.queryEntityData(entityid));

+ 141 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/dimentity/EntityCodeListVo.java

@@ -0,0 +1,141 @@
+package com.onemap.apply.domain.dimentity;
+
+import java.util.List;
+
+public class EntityCodeListVo {
+    private String entityname;
+    private String alias;
+    private String entityid;
+    private String formerid;
+    private String elementid;
+    private String elementcode;
+    private String locationid;
+    private String classid;
+    private String classname;
+    private String borntime;
+    private String endtime;
+    private String loadtime;
+    private String updatests;
+    private String updatetime;
+    private String gb;
+
+    public String getEntityname() {
+        return entityname;
+    }
+
+    public void setEntityname(String entityname) {
+        this.entityname = entityname;
+    }
+
+    public String getAlias() {
+        return alias;
+    }
+
+    public void setAlias(String alias) {
+        this.alias = alias;
+    }
+
+    public String getEntityid() {
+        return entityid;
+    }
+
+    public void setEntityid(String entityid) {
+        this.entityid = entityid;
+    }
+
+    public String getFormerid() {
+        return formerid;
+    }
+
+    public void setFormerid(String formerid) {
+        this.formerid = formerid;
+    }
+
+    public String getElementid() {
+        return elementid;
+    }
+
+    public void setElementid(String elementid) {
+        this.elementid = elementid;
+    }
+
+    public String getElementcode() {
+        return elementcode;
+    }
+
+    public void setElementcode(String elementcode) {
+        this.elementcode = elementcode;
+    }
+
+    public String getLocationid() {
+        return locationid;
+    }
+
+    public void setLocationid(String locationid) {
+        this.locationid = locationid;
+    }
+
+    public String getClassid() {
+        return classid;
+    }
+
+    public void setClassid(String classid) {
+        this.classid = classid;
+    }
+
+    public String getClassname() {
+        return classname;
+    }
+
+    public void setClassname(String classname) {
+        this.classname = classname;
+    }
+
+    public String getBorntime() {
+        return borntime;
+    }
+
+    public void setBorntime(String borntime) {
+        this.borntime = borntime;
+    }
+
+    public String getEndtime() {
+        return endtime;
+    }
+
+    public void setEndtime(String endtime) {
+        this.endtime = endtime;
+    }
+
+    public String getLoadtime() {
+        return loadtime;
+    }
+
+    public void setLoadtime(String loadtime) {
+        this.loadtime = loadtime;
+    }
+
+    public String getUpdatests() {
+        return updatests;
+    }
+
+    public void setUpdatests(String updatests) {
+        this.updatests = updatests;
+    }
+
+    public String getUpdatetime() {
+        return updatetime;
+    }
+
+    public void setUpdatetime(String updatetime) {
+        this.updatetime = updatetime;
+    }
+
+    public String getGb() {
+        return gb;
+    }
+
+    public void setGb(String gb) {
+        this.gb = gb;
+    }
+}

+ 2 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/dimentity/DimEntityMapper.java

@@ -1,5 +1,6 @@
 package com.onemap.apply.mapper.dimentity;
 
+import com.onemap.apply.domain.dimentity.EntityCodeListVo;
 import com.onemap.apply.domain.dimentity.EntityCodeTreeVo;
 import com.onemap.apply.domain.dimentity.EntityRelationshipToNeo4jVo;
 import com.onemap.apply.domain.dimentity.EntityRelationshipVo;
@@ -29,6 +30,7 @@ public interface DimEntityMapper {
      * @return
      */
     List<EntityCodeTreeVo> queryEntityCodeTableTreeDataByCode(@Param("code") String code, @Param("tables") List<String> tablesName);
+    List<EntityCodeListVo> queryEntityCodeTableTreeDataByCodeV1(@Param("code") String code, @Param("tables") List<String> tablesName, @Param("entityid") String entityid, @Param("entityname") String entityname);
 
     /**
      * 根据实地的空间身份编码EntityID 。在根据实体表,查询对应的实体图元关系表

+ 3 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/dimentity/DimEntityService.java

@@ -1,6 +1,7 @@
 package com.onemap.apply.service.dimentity;
 
 import com.onemap.apply.domain.dimentity.DimEntityDto;
+import com.onemap.apply.domain.dimentity.EntityCodeListVo;
 import com.onemap.apply.domain.dimentity.EntityCodeTreeVo;
 import com.onemap.apply.domain.dimentity.EntityRelationshipToNeo4jVo;
 
@@ -10,6 +11,8 @@ import java.util.Map;
 public interface DimEntityService {
     List<EntityCodeTreeVo> queryEntityCodeTableTree(String id);
 
+    List<EntityCodeListVo> queryEntityCodeTableList(String id, String entityid, String entityname);
+
     Map<String, Object> queryEntityData(String entityid);
 
     void createEntityRelationshipToNeo4j(EntityRelationshipToNeo4jVo entityRelationshipToNeo4jVo);

+ 17 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/dimentity/impl/DimEntityServiceImpl.java

@@ -47,6 +47,22 @@ public class DimEntityServiceImpl implements DimEntityService {
         return queryEntityCodeTableTreeData(id, level, viewTableName);
     }
 
+    @Override
+    public List<EntityCodeListVo> queryEntityCodeTableList(String id, String entityid, String entityname) {
+        if (StringUtils.isEmpty(id)) {
+            return new ArrayList<>();
+        }
+        //创建视图
+        String viewTableName = StringUtils.getTemporaryTableName();
+        createView(viewTableName);
+        List<String> d0_tables = dimEntityMapper.queryTablesNameByViewCode(viewTableName, id);
+        if (d0_tables.size() > 0) {
+            return dimEntityMapper.queryEntityCodeTableTreeDataByCodeV1(id, d0_tables, entityid, entityname);
+        } else {
+            return new ArrayList<>();
+        }
+    }
+
     @Override
     public Map<String, Object> queryEntityData(String entityid) {
         Map<String, Object> result = new HashMap<>();
@@ -138,6 +154,7 @@ public class DimEntityServiceImpl implements DimEntityService {
                 }
             }
         } else {
+            //TODO 大于4这块代码暂时没有了,后期看看没有就删除
             List<String> d0_tables = dimEntityMapper.queryTablesNameByViewCode(viewTableName, code);
             if (d0_tables.size() > 0) {
                 entityCodeTreeVos = dimEntityMapper.queryEntityCodeTableTreeDataByCode(code, d0_tables);

+ 31 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/dimentity/DimEntityMapper.xml

@@ -9,6 +9,25 @@
         <result property="label" column="label"/>
     </resultMap>
 
+    <!-- 可根据自己的需求,是否要使用 -->
+    <resultMap type="EntityCodeListVo" id="EntityCodeListVoResult">
+        <result property="entityname" column="entityname"/>
+        <result property="alias" column="alias"/>
+        <result property="entityid" column="entityid"/>
+        <result property="formerid" column="formerid"/>
+        <result property="elementid" column="elementid"/>
+        <result property="elementcode" column="elementcode"/>
+        <result property="locationid" column="locationid"/>
+        <result property="classid" column="classid"/>
+        <result property="classname" column="classname"/>
+        <result property="borntime" column="borntime"/>
+        <result property="endtime" column="endtime"/>
+        <result property="loadtime" column="loadtime"/>
+        <result property="updatests" column="updatests"/>
+        <result property="updatetime" column="updatetime"/>
+        <result property="gb" column="gb"/>
+    </resultMap>
+
     <!-- 可根据自己的需求,是否要使用 -->
     <resultMap type="EntityRelationshipVo" id="EntityRelationshipVoResult">
         <result property="tylayer" column="tylayer"/>
@@ -63,6 +82,18 @@
         )v1
     </select>
 
+    <select id="queryEntityCodeTableTreeDataByCodeV1" parameterType="String" resultMap="EntityCodeListVoResult">
+        select * from (
+        <foreach item="item" index="index" collection="tables" separator="UNION ALL">
+            select entityname,alias,entityid,formerid,elementid,elementcode,locationid,classid,classname,borntime,endtime,loadtime,updatests,updatetime,gb
+            from vector.${item} where classid::varchar like concat(#{code},'%')
+            <if test="entityid != null and entityid != '' "> and entityid::varchar like concat('%',#{entityid},'%') </if>
+            <if test="entityname != null and entityname != '' "> and entityname::varchar like concat('%',#{entityname},'%') </if>
+        </foreach>
+        )v1
+    </select>
+
+
     <select id="queryEntityRelationshipDataByEntityId" parameterType="String" resultMap="EntityRelationshipVoResult">
         select * from (
         <foreach item="item" index="index" collection="tables" separator="UNION ALL">