Sfoglia il codice sorgente

全库检索根据资源码查询

chenendian 1 mese fa
parent
commit
5d3e4864e4

+ 17 - 2
siwei-api/siwei-api-spatial/src/main/java/com/siwei/spatial/api/domain/file/TGeomDbDetails.java

@@ -38,6 +38,13 @@ public class TGeomDbDetails extends BaseSridEntity
     @Excel(name = "空间面积")
     private String geomArea;
 
+
+    /** 空间面积 */
+    @Excel(name = "空间位置/坐落位置")
+    private String zl;
+
+
+
     public void setId(String id) 
     {
         this.id = id;
@@ -69,8 +76,11 @@ public class TGeomDbDetails extends BaseSridEntity
     {
         this.geomJson = geomJson;
     }
-
-    public String getGeomJson() 
+    public void  setZl(String zl)
+    {
+        this.zl = zl;
+    }
+    public String getGeomJson()
     {
         return geomJson;
     }
@@ -93,6 +103,10 @@ public class TGeomDbDetails extends BaseSridEntity
         return geomArea;
     }
 
+    public String getZl() {
+        return zl;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -102,6 +116,7 @@ public class TGeomDbDetails extends BaseSridEntity
             .append("geomJson", getGeomJson())
             .append("sort", getSort())
             .append("geomArea", getGeomArea())
+            .append("zl", getZl())
             .toString();
     }
 }

+ 3 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/SearchProjectAndAttachment.java

@@ -16,4 +16,7 @@ public class SearchProjectAndAttachment extends Project {
     private String nodeId;
     private String fileName;
     private String filePath;
+    private String resourceCode;
+    private String zl;
+    private String area;
 }

+ 5 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/ProjectMapper.java

@@ -79,4 +79,9 @@ public interface ProjectMapper {
     Integer getSearchAttachmentCount(ProjectFilterVo projectFilterVo);
 
 
+    Integer getSearchGraphicLayerCount(ProjectFilterVo projectFilterVo);
+
+
+
+
 }

+ 26 - 15
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ProjectImpl.java

@@ -320,23 +320,34 @@ public class ProjectImpl implements ProjectService {
         List<SearchProjectAndAttachment> projects = projectMapper.getListSearch(projectFilterVo);
         Integer count = projectMapper.getSearchCount(projectFilterVo);
 
-        Integer projectCount = projectMapper.getSearchProjectCount(projectFilterVo);
-        Integer attachmentCount = projectMapper.getSearchAttachmentCount(projectFilterVo);
-
-        // 根据项目id查询所有流程id
-        List<String> projectIdList = projects.stream().map(BaseId::getId).collect(Collectors.toList());
-        List<ProjectWorkflow> projectWorkflowList = null;
-        if (CollectionUtils.isNotEmpty(projectIdList)) {
-            projectWorkflowList = projectWorkflowMapper.selectByProjectIdList(projectIdList);
-        }
-        List<String> nodeIdList = null;
-        if (CollectionUtils.isNotEmpty(projectWorkflowList)) {
-            nodeIdList = projectWorkflowList.stream().map(ProjectWorkflow::getNodeId).collect(Collectors.toList());
-        }
+        Integer projectCount = 0;
+        Integer attachmentCount = 0;
         Integer graphicLayerCount = 0;
-        if (CollectionUtils.isNotEmpty(nodeIdList)) {
-            graphicLayerCount = nodeLandMapper.selectCountGeomByNodeId(nodeIdList);
+
+        if(projectFilterVo.getFilterType()==0||projectFilterVo.getFilterType()==1){
+            projectCount = projectMapper.getSearchProjectCount(projectFilterVo);
+        }else if(projectFilterVo.getFilterType()==0||projectFilterVo.getFilterType()==2) {
+            attachmentCount = projectMapper.getSearchAttachmentCount(projectFilterVo);
+        } else if (projectFilterVo.getFilterType()==0||projectFilterVo.getFilterType()==3) {
+            graphicLayerCount = projectMapper.getSearchGraphicLayerCount(projectFilterVo);
         }
+
+
+        // 根据项目id查询所有流程id
+        //List<String> projectIdList = projects.stream().map(BaseId::getId).collect(Collectors.toList());
+//        List<ProjectWorkflow> projectWorkflowList = null;
+//        if (CollectionUtils.isNotEmpty(projectIdList)) {
+//            projectWorkflowList = projectWorkflowMapper.selectByProjectIdList(projectIdList);
+//        }
+//        List<String> nodeIdList = null;
+//        if (CollectionUtils.isNotEmpty(projectWorkflowList)) {
+//            nodeIdList = projectWorkflowList.stream().map(ProjectWorkflow::getNodeId).collect(Collectors.toList());
+//        }
+//        Integer graphicLayerCount = 0;
+//        if (CollectionUtils.isNotEmpty(nodeIdList)) {
+//            graphicLayerCount = nodeLandMapper.selectCountGeomByNodeId(nodeIdList);
+//        }
+
         Map<String, Object> map = new LinkedHashMap<>();
         map.put("projects", projects);
         map.put("count", count);

+ 146 - 7
siwei-modules/siwei-apply/src/main/resources/mapper/ProjectMapper.xml

@@ -344,9 +344,12 @@
                 P."updated_at" AS updatedAt,
                 '1'  AS selectType,
                 '' AS attachmentId,
-                '' AS nodeId  ,
+                '' AS nodeId,
                 '' AS fileName,
-                '' AS  filePath
+                '' AS  filePath,
+                ''  AS resourceCode,
+                ''  AS zl,
+                ''  AS area
                 FROM  PUBLIC.t_project P
 
                 <where>
@@ -395,7 +398,10 @@
                 info.ID AS attachmentId,
                 info.node_id AS nodeId,
                 info.file_name AS  fileName,
-                info.file_path AS filePath
+                info.file_path AS filePath,
+                ''  AS resourceCode,
+                ''  AS zl,
+                ''  AS area
                 FROM  PUBLIC.t_project_attachment_info info
                 LEFT JOIN t_project project   on  info.project_id=project.id
                 <where>
@@ -412,7 +418,49 @@
                     </if>
                 </where>
             </if>
-         ORDER BY
+            <if test="filterType==0">
+                UNION
+            </if>
+            <if test="filterType==0 or filterType==3">
+                SELECT
+                project."id" AS ID,
+                project."name" AS NAME,
+                project."code" AS code,
+                project."company" AS company,
+                project."created_at" AS createAt,
+                project."updated_at" AS updateAt,
+                project."project_type" AS projectType,
+                project."on_chain_num" AS onChainNum,
+                project."creator_id" AS creatorId,
+                project."updated_at" AS updatedAt,
+                '3'  AS selectType,
+                '' AS attachmentId,
+                '' AS nodeId,
+                '' AS  fileName,
+                '' AS filePath,
+                (code.resource_immobile_code || code.resource_business_code || code.resource_project_code)  AS resourceCode,
+                details.zl  AS zl,
+                CAST(ROUND(details.geom_area, 2) AS VARCHAR) AS area
+                FROM
+                "public"."t_land_one_code"   code
+                LEFT JOIN    "public"."t_node_land"    node    on  code.land_code =node.id
+                LEFT JOIN    "public"."t_geom_db_details"   details  on  node.geom_db_id =details.upload_id
+                LEFT JOIN     "public"."t_project"     project    on  code.project_id =project.id
+                <where>
+                    <if test="keyWords != null and keyWords.size() > 0">
+                        regexp_like((code.resource_immobile_code || code.resource_business_code || code.resource_project_code),
+                        REGEXP_REPLACE(
+                        <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                        , '[\r\n\s]+', '', 'g')
+                        , 'i')
+                    </if>
+                    AND  project.id is not null
+                    <if test="isOnchain != null and isOnchain">
+                        AND on_chain_num > 0
+                    </if>
+                </where>
+            </if>
+        ORDER BY
             updatedAt DESC
             LIMIT #{pageSize} OFFSET #{offset}
     </select>
@@ -436,9 +484,11 @@
                 '' AS attachmentId,
                 '' AS nodeId  ,
                 '' AS fileName,
-                '' AS  filePath
+                '' AS  filePath,
+                ''  AS resourceCode,
+                ''  AS zl,
+                ''  AS area
                 FROM  PUBLIC.t_project P
-
                 <where>
                     <if test="keyWords != null and keyWords.size() > 0">
                         regexp_like(P.name,
@@ -485,7 +535,10 @@
                 info.ID AS attachmentId,
                 info.node_id AS nodeId,
                 info.file_name AS  fileName,
-                info.file_path AS filePath
+                info.file_path AS filePath,
+                ''  AS resourceCode,
+                ''  AS zl,
+                ''  AS area
                 FROM  PUBLIC.t_project_attachment_info info
                 LEFT JOIN t_project project   on  info.project_id=project.id
                 <where>
@@ -502,6 +555,50 @@
                     </if>
                 </where>
             </if>
+
+            <if test="filterType==0">
+                UNION
+            </if>
+
+            <if test="filterType==0 or filterType==3">
+                    SELECT
+                    project."id" AS ID,
+                    project."name" AS NAME,
+                    project."code" AS code,
+                    project."company" AS company,
+                    project."created_at" AS createAt,
+                    project."updated_at" AS updateAt,
+                    project."project_type" AS projectType,
+                    project."on_chain_num" AS onChainNum,
+                    project."creator_id" AS creatorId,
+                    project."updated_at" AS updatedAt,
+                    '3'  AS selectType,
+                    '' AS attachmentId,
+                    '' AS nodeId  ,
+                    '' AS fileName,
+                    '' AS  filePath,
+                    (code.resource_immobile_code || code.resource_business_code || code.resource_project_code)  AS resourceCode,
+                    details.zl  AS zl,
+                    CAST(ROUND(details.geom_area, 2) AS VARCHAR) AS area
+                    FROM
+                    "public"."t_land_one_code"   code
+                    LEFT JOIN    "public"."t_node_land"    node    on  code.land_code =node.id
+                    LEFT JOIN    "public"."t_geom_db_details"   details  on  node.geom_db_id =details.upload_id
+                    LEFT JOIN     "public"."t_project"     project    on  code.project_id =project.id
+                    <where>
+                        <if test="keyWords != null and keyWords.size() > 0">
+                            regexp_like((code.resource_immobile_code || code.resource_business_code || code.resource_project_code),
+                            REGEXP_REPLACE(
+                            <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                            , '[\r\n\s]+', '', 'g')
+                            , 'i')
+                        </if>
+                        AND  project.id is not null
+                        <if test="isOnchain != null and isOnchain">
+                            AND on_chain_num > 0
+                        </if>
+                    </where>
+                </if>
         ) AS distinct_projects
     </select>
 
@@ -590,6 +687,48 @@
         ) AS distinct_projects
     </select>
 
+    <select id="getSearchGraphicLayerCount" parameterType="com.siwei.apply.domain.vo.ProjectFilterVo" resultType="int">
+        SELECT COUNT(*)
+        FROM (
+            SELECT
+            project."id" AS ID,
+            project."name" AS NAME,
+            project."code" AS code,
+            project."company" AS company,
+            project."created_at" AS createAt,
+            project."updated_at" AS updateAt,
+            project."project_type" AS projectType,
+            project."on_chain_num" AS onChainNum,
+            project."creator_id" AS creatorId,
+            project."updated_at" AS updatedAt,
+            '3'  AS selectType,
+            '' AS attachmentId,
+            '' AS nodeId,
+            '' AS  fileName,
+            '' AS filePath,
+            (code.resource_immobile_code || code.resource_business_code || code.resource_project_code)  AS resourceCode,
+            details.zl  AS zl,
+            CAST(ROUND(details.geom_area, 2) AS VARCHAR) AS area
+            FROM
+            "public"."t_land_one_code"   code
+            LEFT JOIN    "public"."t_node_land"    node    on  code.land_code =node.id
+            LEFT JOIN    "public"."t_geom_db_details"   details  on  node.geom_db_id =details.upload_id
+            LEFT JOIN     "public"."t_project"     project    on  code.project_id =project.id
+            <where>
+                <if test="keyWords != null and keyWords.size() > 0">
+                    regexp_like((code.resource_immobile_code || code.resource_business_code || code.resource_project_code),
+                    REGEXP_REPLACE(
+                    <foreach collection="keyWords" item="word" open="'(" separator="|" close=")'" >${word}</foreach>
+                    , '[\r\n\s]+', '', 'g')
+                    , 'i')
+                </if>
+                AND  project.id is not null
+                <if test="isOnchain != null and isOnchain">
+                    AND on_chain_num > 0
+                </if>
+            </where>
+        ) AS distinct_projects
+    </select>
 
 
     <delete id="deleteNodeByTable">

+ 1 - 0
siwei-modules/siwei-spatial/src/main/java/com/siwei/spatial/service/file/impl/SpatialFilesDbServiceImpl.java

@@ -116,6 +116,7 @@ public class SpatialFilesDbServiceImpl implements ISpatialFilesDbService {
             shpFeatures.remove("the_geom");
             detailsDTO.setSort(sort);
             detailsDTO.setGeomJson(JSON.toJSONString(shpFeatures));
+            detailsDTO.setZl("空间位置-暂无");
             shpFeatures.put("id", detailsDTO.getId());
             itGeomDbDetailsService.insertTGeomDbDetails(detailsDTO);
             sort++;