1
0
chenendian 2 недель назад
Родитель
Сommit
3ed3b1aea5

+ 0 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/third/OfferDataController.java

@@ -66,7 +66,6 @@ public class OfferDataController extends BaseController {
 
 
 
 
 
 
-
     /**
     /**
      * 国有建设用地使用权首次登记
      * 国有建设用地使用权首次登记
      * 不动产土地登记完成后入参使用
      * 不动产土地登记完成后入参使用

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

@@ -98,7 +98,11 @@ public interface ProjectMapper {
     String getNodeSourceIdByTable(@Param("nodeId")String nodeId,@Param("tableName") String tableName);
     String getNodeSourceIdByTable(@Param("nodeId")String nodeId,@Param("tableName") String tableName);
 
 
 
 
-    List<Map<String,Object>> getTdyProjectList(@Param("condition") String condition);
+    List<Map<String,Object>> getTdyProjectList(@Param("xmmc") String xmmc,
+                                                @Param("xmdm") String xmdm,
+                                                @Param("srf") String srf,
+                                                @Param("yfbdcdyh") String yfbdcdyh,
+                                                @Param("ewkt") String ewkt);
 
 
 
 
 }
 }

+ 4 - 48
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/third/impl/OfferDataServiceImpl.java

@@ -1,11 +1,9 @@
 package com.siwei.apply.service.third.impl;
 package com.siwei.apply.service.third.impl;
 
 
 import com.siwei.apply.domain.NodeAttachment;
 import com.siwei.apply.domain.NodeAttachment;
-import com.siwei.apply.domain.NodeLand;
 import com.siwei.apply.domain.ProjectWorkflow;
 import com.siwei.apply.domain.ProjectWorkflow;
 import com.siwei.apply.domain.vo.*;
 import com.siwei.apply.domain.vo.*;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
 import com.siwei.apply.enums.AloneWorkFlowEnum;
-import com.siwei.apply.mapper.NodeLandMapper;
 import com.siwei.apply.mapper.ProjectMapper;
 import com.siwei.apply.mapper.ProjectMapper;
 import com.siwei.apply.mapper.ProjectWorkflowMapper;
 import com.siwei.apply.mapper.ProjectWorkflowMapper;
 import com.siwei.apply.service.GyjsydjfwscdjService;
 import com.siwei.apply.service.GyjsydjfwscdjService;
@@ -57,9 +55,6 @@ public class OfferDataServiceImpl implements OfferDataService {
     @Autowired
     @Autowired
     private ProjectMapper projectMapper;
     private ProjectMapper projectMapper;
 
 
-    @Autowired
-    private NodeLandMapper nodeLandMapper;
-
 
 
     @Override
     @Override
     public Map<String, String> get(String projectId) {
     public Map<String, String> get(String projectId) {
@@ -72,66 +67,27 @@ public class OfferDataServiceImpl implements OfferDataService {
     }
     }
 
 
     /**
     /**
+     *         获取 1.项目与土地供应,两个表进行关联。
+     *         并且为上链的,并且不动产单元号不经存在的数据。
      * 根据入参数据,多个取并集,获取项目的相关数据
      * 根据入参数据,多个取并集,获取项目的相关数据
      * @param body
      * @param body
      * @return
      * @return
      */
      */
     @Override
     @Override
     public List<Map<String, Object>> landSupplyAndProjectList(ThirdProjectParamVo body) {
     public List<Map<String, Object>> landSupplyAndProjectList(ThirdProjectParamVo body) {
-        /*
-        1.根据项目名称,项目代码,获取项目列表
-        2.根据srf,获取项目列表
-        3.根据预分不动产单元号,获取项目列表
-        4.根据geom,获取项目列表
-        5.将以上四个列表取并集,返回结果
-        获取 1.项目与土地供应,两个表进行关联。
-        并且为上链的,并且数据已经存在的数据。
-
-        --  geom相关信息,如何查询,通过交集的相关
-        SELECT   pro."name"  as xmmc ,  pro."code"  as xmdm  ,td.*  from "t_tdgy" td
-        LEFT JOIN   "t_project"  pro  on   td.project_id=pro."id"
-        LEFT JOIN  "t_project_immobile_code"    immobile  ON pro.id = immobile.project_id and immobile.valid_flag=1
-        WHERE td.has_onchain='t'   and  pro."id" is not null  and immobile.code is   null
-        and   ( pro."name" LIKE '%测试%'  or   pro."code" LIKE '%测试%'  or    td."srf"   LIKE '%测试%'    );
-
-
-
-        */
        String projectName =  body.getXmmc();
        String projectName =  body.getXmmc();
        String projectCode =  body.getXmdm();
        String projectCode =  body.getXmdm();
        String srf =  body.getSrf();
        String srf =  body.getSrf();
        String yfbdcdyh =  body.getYfbdcdyh();
        String yfbdcdyh =  body.getYfbdcdyh();
        String ewktString =  body.getGeom();
        String ewktString =  body.getGeom();
-
-
-        String condition = "1=1";
-        if(StringUtils.isNotBlank(projectName)){
-            condition += " and xmmc like '%"+projectName+"%'";
-        }
-        if(StringUtils.isNotBlank(projectCode)){
-            condition += " and xmdm like '%"+projectCode+"%'";
-        }
-        if(StringUtils.isNotBlank(srf)) {
-            condition += " and srf like '%" + srf + "%'";
-        }
-
-        if(StringUtils.isNotBlank(yfbdcdyh)) {
-            List<NodeLand> res = nodeLandMapper.selectByGeom(ewktString);
-            //todo nodeId 的list 然后进行in条件的拼接
-            condition+="";
-        }
-
-        List<Map<String,Object>>  result = projectMapper.getTdyProjectList("");
+        List<Map<String,Object>>  result = projectMapper.getTdyProjectList(
+                projectName, projectCode, srf, yfbdcdyh, ewktString);
         return result;
         return result;
     }
     }
 
 
 
 
 
 
 
 
-
-
-
-
     @Override
     @Override
     public Map<String, Object> landFirstRegistration(LandFirstParamVo body) {
     public Map<String, Object> landFirstRegistration(LandFirstParamVo body) {
         String yfbdcdyh = body.getYfbdcdyh();
         String yfbdcdyh = body.getYfbdcdyh();

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

@@ -835,13 +835,68 @@
 
 
     <!-- 1.查询不动产单元号未赋值的,没有与不动产交互的。2.前置阶段已经上链的-->
     <!-- 1.查询不动产单元号未赋值的,没有与不动产交互的。2.前置阶段已经上链的-->
     <select id="getTdyProjectList" resultType="map">
     <select id="getTdyProjectList" resultType="map">
-        SELECT   pro."name"  as xmmc ,  pro."code"  as xmdm  ,td.*  from "t_tdgy" td
-        LEFT JOIN   "t_project"  pro  on   td.project_id=pro."id"
-        LEFT JOIN  "t_project_immobile_code"    immobile  ON pro.id = immobile.project_id and immobile.valid_flag=1
-        WHERE td.has_onchain='t'   and  pro."id" is not null  and immobile.code is   null
-        <if test="condition != null condition!= ''">
-            and   ( $condition  )
-        </if>
+        SELECT
+            pro."name"        as xmmc,
+            pro."code"        as xmdm,
+            td.srf            as srf,
+            td.tdyt           as tdyt,
+            td.jswz           as jswz,
+            td.gd_area        as gdmj,
+            td.gd_unit        as mjdw,
+            td.gd_type        as gdfs,
+            td.has_zz         as bzzt,
+            td.hbcrhtbh       as hbcrhtbh,
+            td.hbcrht_date    as hbcrhtrq,
+            (SELECT immobile."preAssignCode"
+               FROM t_project_immobile_code immobile
+              WHERE immobile.project_id = pro.id
+                AND immobile.valid_flag = 1
+                AND immobile."preAssignCode" IS NOT NULL
+              LIMIT 1) as yfbdcdyh,
+            (SELECT array_to_string(array_agg(ST_AsEWKT(gd.geom)), '|')
+               FROM t_node_land nl
+               LEFT JOIN t_geom_db_details gd ON nl.geom_db_id = gd.upload_id
+              WHERE nl.node_id = td.id
+                AND gd.geom IS NOT NULL) as geom
+        FROM "t_tdgy" td
+        LEFT JOIN "t_project" pro ON td.project_id = pro."id"
+        WHERE td.has_onchain = 't'
+          AND pro."id" IS NOT NULL
+          AND NOT EXISTS (
+              SELECT 1 FROM t_project_immobile_code immobile2
+               WHERE immobile2.project_id = pro.id
+                 AND immobile2.valid_flag = 1
+                 AND immobile2.code IS NOT NULL
+          )
+        <trim prefix="AND (" suffix=")" prefixOverrides="OR">
+            <if test="xmmc != null and xmmc != ''">
+                OR pro."name" LIKE '%' || #{xmmc} || '%'
+            </if>
+            <if test="xmdm != null and xmdm != ''">
+                OR pro."code" LIKE '%' || #{xmdm} || '%'
+            </if>
+            <if test="srf != null and srf != ''">
+                OR td.srf LIKE '%' || #{srf} || '%'
+            </if>
+            <if test="yfbdcdyh != null and yfbdcdyh != ''">
+                OR EXISTS (
+                    SELECT 1 FROM t_project_immobile_code immobile3
+                     WHERE immobile3.project_id = pro.id
+                       AND immobile3.valid_flag = 1
+                       AND immobile3."preAssignCode" LIKE '%' || #{yfbdcdyh} || '%'
+                )
+            </if>
+            <if test="ewkt != null and ewkt != ''">
+                OR EXISTS (
+                    SELECT 1
+                      FROM t_node_land nl2
+                      LEFT JOIN t_geom_db_details gd2 ON nl2.geom_db_id = gd2.upload_id
+                     WHERE nl2.node_id = td.id
+                       AND gd2.geom IS NOT NULL
+                       AND public.ST_Intersects(gd2.geom, public.ST_GeomFromEWKT(#{ewkt}))
+                )
+            </if>
+        </trim>
     </select>
     </select>