Переглянути джерело

Merge branch 'master' into dev

董珍珍 1 рік тому
батько
коміт
8eba5a2cff
20 змінених файлів з 500 додано та 59 видалено
  1. 12 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/yzt/XzqController.java
  2. 62 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/yzt/searchController.java
  3. 46 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/CollectionDTO.java
  4. 40 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/PoiDTO.java
  5. 43 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/PoiSearchDTO.java
  6. 1 1
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/XzqDTO.java
  7. 28 1
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/ZymlTreeDataDTO.java
  8. 16 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/yzt/CollectionMapper.java
  9. 23 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/yzt/SearchMapper.java
  10. 2 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/yzt/XzqMapper.java
  11. 78 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/yzt/SearchServiceImpl.java
  12. 20 1
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/yzt/XzqServiceImpl.java
  13. 29 9
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/yzt/ZymlServiceImpl.java
  14. 18 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/yzt/ISearchService.java
  15. 2 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/yzt/IXzqService.java
  16. 35 0
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/SearchMapper.xml
  17. 27 22
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/XzqMapper.xml
  18. 10 17
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/ZymlMapper.xml
  19. 4 4
      onemap-modules/onemap-system/src/main/resources/mapper/postgresql/system/SysMenuMapper.xml
  20. 4 4
      onemap-modules/onemap-system/src/main/resources/mapper/postgresql/system/SysRoleMapper.xml

+ 12 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/yzt/XzqController.java

@@ -38,4 +38,16 @@ public class XzqController extends BaseController {
         RequestResult list = xzqService.GetXzqList(city);
         return list;
     }
+
+    /**
+     * 根据代码获取相应的GEOM WKT
+     *
+     * @param id 行政区划代码
+     * @return
+     */
+    @GetMapping("/GetGeom")
+    public RequestResult GetGeom(String id) {
+        RequestResult list = xzqService.GetGeom(id);
+        return list;
+    }
 }

+ 62 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/yzt/searchController.java

@@ -0,0 +1,62 @@
+package com.onemap.apply.controller.yzt;
+
+import com.onemap.apply.domain.yzt.CollectionDTO;
+import com.onemap.apply.domain.yzt.PoiSearchDTO;
+import com.onemap.apply.service.yzt.ISearchService;
+import com.onemap.common.core.web.controller.BaseController;
+import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.common.security.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("/yzt/search")
+public class searchController extends BaseController {
+
+    @Autowired
+    private ISearchService searchService;
+
+
+    /**
+     * 兴趣点查询
+     *
+     * @return
+     */
+    @PostMapping("/poi")
+    public RequestResult poi(@RequestBody PoiSearchDTO poiSearchDTO) {
+        return searchService.poi(poiSearchDTO);
+    }
+
+    /**
+     * 书签查询
+     *
+     * @return
+     */
+    @PostMapping("/bookmark")
+    public RequestResult bookmark(@RequestBody PoiSearchDTO poiSearchDTO) {
+        return searchService.bookmark(poiSearchDTO);
+    }
+
+    /**
+     * 书签新增
+     *
+     * @return
+     */
+    @PostMapping("/bookmarkAdd")
+    public RequestResult bookmarkAdd(@RequestBody CollectionDTO collectionDTO) {
+        return searchService.bookmarkAdd(collectionDTO);
+    }
+
+    /**
+     * 书签新增
+     *
+     * @return
+     */
+    @PostMapping("/bookmarkDel")
+    public RequestResult bookmarkDel(@RequestBody Map params) {
+        return searchService.bookmarkDel(params.get("id").toString());
+    }
+}

+ 46 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/CollectionDTO.java

@@ -0,0 +1,46 @@
+package com.onemap.apply.domain.yzt;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+ * 地图收藏相关 (书签、飞行路线、对比分析等)
+ */
+@TableName("t_yzt_collection")
+public class CollectionDTO {
+    private String id;
+    private String name;
+    private String type;
+    private String info ;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+}

+ 40 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/PoiDTO.java

@@ -0,0 +1,40 @@
+package com.onemap.apply.domain.yzt;
+
+public class PoiDTO {
+    private String name ;
+    private String address ;
+    private String x ;
+    private String y ;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getX() {
+        return x;
+    }
+
+    public void setX(String x) {
+        this.x = x;
+    }
+
+    public String getY() {
+        return y;
+    }
+
+    public void setY(String y) {
+        this.y = y;
+    }
+}

+ 43 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/PoiSearchDTO.java

@@ -0,0 +1,43 @@
+package com.onemap.apply.domain.yzt;
+
+/**
+ * 兴趣点查询参数实体
+ */
+public class PoiSearchDTO {
+    private String name ;
+    private String type ;
+    private Integer limit;
+    private Integer offset ;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getLimit() {
+        return limit;
+    }
+
+    public void setLimit(Integer limit) {
+        this.limit = limit;
+    }
+
+    public Integer getOffset() {
+        return offset;
+    }
+
+    public void setOffset(Integer offset) {
+        this.offset = offset;
+    }
+}

+ 1 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/XzqDTO.java

@@ -9,7 +9,7 @@ public class XzqDTO {
     private String label;
     private String parent;
     private Boolean isparent;
-    private List<XzqDTO> children = new ArrayList<XzqDTO>();
+    private List<XzqDTO> children;
 
     public String getValue() {
         return value;

+ 28 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/yzt/ZymlTreeDataDTO.java

@@ -15,11 +15,38 @@ public class ZymlTreeDataDTO {
     private String title;
     private String type;
     private String url;
+    private String source;
+    private String favorite;
     private Boolean disabled = false;
+    private Boolean checked = false;
     private Boolean expand = false;
-    private Boolean contextmenu = true;
+    private Boolean contextmenu = false;
     private List<ZymlTreeDataDTO> children = new ArrayList<>();
 
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+    public Boolean getChecked() {
+        return checked;
+    }
+
+    public void setChecked(Boolean checked) {
+        this.checked = checked;
+    }
+
+    public String getFavorite() {
+        return favorite;
+    }
+
+    public void setFavorite(String favorite) {
+        this.favorite = favorite;
+    }
+
     public Boolean getExpand() {
         return expand;
     }

+ 16 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/yzt/CollectionMapper.java

@@ -0,0 +1,16 @@
+package com.onemap.apply.mapper.yzt;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.yzt.CollectionDTO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @ClassName CollectionMapper
+ * @Description TODO
+ * @Author 北京四维空间数码科技有限公司
+ * @Date 2023/6/15 14:33
+ * @Version 1.0
+ */
+@Mapper
+public interface CollectionMapper extends BaseMapper<CollectionDTO> {
+}

+ 23 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/yzt/SearchMapper.java

@@ -0,0 +1,23 @@
+package com.onemap.apply.mapper.yzt;
+
+import com.onemap.apply.domain.yzt.*;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 资源目录 数据层
+ *
+ * @author onemap
+ */
+@Mapper
+public interface SearchMapper {
+    List<PoiDTO> poi(@Param("name") String name, @Param("limit") Integer limit, @Param("offset") Integer offset);
+
+    Integer poicount(@Param("name") String name);
+
+    List<CollectionDTO> bookmark(@Param("name") String name, @Param("type") String type, @Param("limit") Integer limit, @Param("offset") Integer offset);
+
+    Integer bookmarkcount(@Param("name") String name, @Param("type") String type);
+}

+ 2 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/yzt/XzqMapper.java

@@ -16,4 +16,6 @@ public interface XzqMapper
     public List<XzqSqlDTO> GetXzq(@Param("city") Boolean city , @Param("xzqCode") String xzqCode);
 
     public List<XzqSqlDTO> GetXzqList(Boolean city);
+
+    String GetGeom(String id);
 }

+ 78 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/yzt/SearchServiceImpl.java

@@ -0,0 +1,78 @@
+package com.onemap.apply.service.impl.yzt;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.onemap.apply.domain.yzt.*;
+import com.onemap.apply.mapper.yzt.CollectionMapper;
+import com.onemap.apply.mapper.yzt.SearchMapper;
+import com.onemap.apply.service.yzt.ISearchService;
+import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.common.datasource.annotation.Slave;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+@Service
+public class SearchServiceImpl implements ISearchService {
+
+    @Autowired
+    private SearchMapper searchMapper;
+    @Autowired
+    private CollectionMapper collectionMapper;
+
+
+    @Override
+    @Slave
+    public RequestResult poi(PoiSearchDTO poiSearchDTO) {
+        try {
+            Map data = new HashMap();
+            List<PoiDTO> res = searchMapper.poi(poiSearchDTO.getName(), poiSearchDTO.getLimit(), poiSearchDTO.getOffset());
+            data.put("data", res);
+            Integer count = searchMapper.poicount(poiSearchDTO.getName());
+            data.put("count", count);
+            return RequestResult.success("查询成功!", data);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return RequestResult.error("查询成功!");
+    }
+
+    @Override
+    public RequestResult bookmark(PoiSearchDTO poiSearchDTO) {
+        try {
+            Map data = new HashMap();
+            List<CollectionDTO> res = searchMapper.bookmark(poiSearchDTO.getName(), poiSearchDTO.getType(), poiSearchDTO.getLimit(), poiSearchDTO.getOffset());
+            data.put("data", res);
+            Integer count = searchMapper.bookmarkcount(poiSearchDTO.getName(), poiSearchDTO.getType());
+            data.put("count", count);
+            return RequestResult.success("查询成功!", data);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return RequestResult.error("查询成功!");
+    }
+
+    @Override
+    public RequestResult bookmarkAdd(CollectionDTO collectionDTO) {
+        try {
+            collectionMapper.insert(collectionDTO);
+            return RequestResult.success("保存成功!", 1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return RequestResult.error("保存失败!", 0);
+    }
+
+    @Override
+    public RequestResult bookmarkDel(String id) {
+        try {
+            QueryWrapper<CollectionDTO> wrapper = new QueryWrapper();
+            wrapper.eq("id", id);
+            collectionMapper.delete(wrapper);
+            return RequestResult.success("删除成功!", 1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return RequestResult.error("删除失败!", 0);
+    }
+}

+ 20 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/yzt/XzqServiceImpl.java

@@ -6,6 +6,7 @@ import com.onemap.apply.mapper.yzt.XzqMapper;
 import com.onemap.apply.service.yzt.IXzqService;
 import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.common.datasource.annotation.Slave;
 import com.onemap.system.api.domain.SysDept;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -21,6 +22,7 @@ public class XzqServiceImpl implements IXzqService {
     private XzqMapper xzqMapper;
 
     @Override
+    @Slave
     public RequestResult GetXzq(Boolean city) {
         try{
             List<XzqSqlDTO> res = xzqMapper.GetXzq(city,"");
@@ -44,6 +46,7 @@ public class XzqServiceImpl implements IXzqService {
     }
 
     @Override
+    @Slave
     public RequestResult GetXzqList(Boolean city) {
         try{
             List<XzqSqlDTO> res = xzqMapper.GetXzqList(city);
@@ -65,6 +68,18 @@ public class XzqServiceImpl implements IXzqService {
         }
     }
 
+    @Override
+    @Slave
+    public RequestResult GetGeom(String id) {
+        try{
+            String wkt = xzqMapper.GetGeom(id);
+            return RequestResult.success("成功", wkt);
+        }catch (Exception e){
+            e.printStackTrace();
+            return RequestResult.error("失败", null);
+        }
+    }
+
     /**
      * 构建前端所需要树结构
      *
@@ -96,7 +111,11 @@ public class XzqServiceImpl implements IXzqService {
     private void recursionFn(List<XzqDTO> list, XzqDTO t) {
         // 得到子节点列表
         List<XzqDTO> childList = getChildList(list, t);
-        t.setChildren(childList);
+        if(childList.size() > 0){
+            t.setChildren(childList);
+        }else{
+            t.setChildren(null);
+        }
         for (XzqDTO tChild : childList) {
             if (hasChild(list, tChild)) {
                 recursionFn(list, tChild);

+ 29 - 9
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/yzt/ZymlServiceImpl.java

@@ -71,7 +71,7 @@ public class ZymlServiceImpl implements IZymlService {
         try {
             List<ZymlDTO> res = new ArrayList<>();
             if (StringUtils.isEmpty(SecurityUtils.getUsername())) {
-                res = zymlMapper.GetList("", param, "");
+                res = zymlMapper.GetList("admin", param, "");
             } else {
                 String resources = SecurityUtils.getLoginUser().getSysUser().getDept().getResources();
                 String username = SecurityUtils.getUsername();
@@ -105,6 +105,8 @@ public class ZymlServiceImpl implements IZymlService {
                 c.setTitle(cur.getName());
                 c.setType(cur.getType());
                 c.setUrl(cur.getUrl());
+                c.setSource(cur.getSde());
+                c.setFavorite(cur.getMy());
                 treedata.add(c);
             }
             List<ZymlTreeDataDTO> data = buildDeptTree2(treedata);
@@ -183,16 +185,33 @@ public class ZymlServiceImpl implements IZymlService {
         try {
             String username = SecurityUtils.getUsername();
             if ("".equals(username)) {
-                return RequestResult.error("登录信息获取失败", null);
+                username = "admin";
+                //return RequestResult.error("登录信息获取失败", null);
             }
-            String userXzqdm = SecurityUtils.getLoginUserXzq();
+//            String userXzqdm = SecurityUtils.getLoginUserXzq();
             List<ZymlDTO> res = new ArrayList<>();
-            if (StringUtils.isXzqhQuery(userXzqdm)) {
-                res = zymlMapper.GetMyCollect4XZQH(username, userXzqdm);
-            } else {
-                res = zymlMapper.GetMyCollect(username);
+            res = zymlMapper.GetMyCollect(username);
+//            if (StringUtils.isXzqhQuery(userXzqdm)) {
+//                res = zymlMapper.GetMyCollect4XZQH(username, userXzqdm);
+//            } else {
+//                res = zymlMapper.GetMyCollect(username);
+//            }
+            List<ZymlTreeDataDTO> treedata = new ArrayList<>();
+            for (int i = 0; i < res.size(); i++) {
+                ZymlDTO cur = res.get(i);
+                ZymlTreeDataDTO c = new ZymlTreeDataDTO();
+//                c.setDisabled((cur.getParent() == 1));
+                c.setId(cur.getBsm());
+                c.setPid(cur.getPbsm());
+                c.setLabel(cur.getName());
+                c.setTitle(cur.getName());
+                c.setType(cur.getType());
+                c.setSource(cur.getSde());
+                c.setFavorite(cur.getMy());
+                c.setUrl(cur.getUrl());
+                treedata.add(c);
             }
-            return RequestResult.success("成功", res);
+            return RequestResult.success("成功", treedata);
         } catch (Exception e) {
             e.printStackTrace();
             return RequestResult.error("失败", null);
@@ -226,7 +245,8 @@ public class ZymlServiceImpl implements IZymlService {
             }
             String username = SecurityUtils.getUsername();
             if ("".equals(username)) {
-                return RequestResult.error("登录信息获取失败", null);
+                username = "admin";
+//                return RequestResult.error("登录信息获取失败", null);
             }
             ZymlBsmDTO zymlBsmDTO = new ZymlBsmDTO();
             zymlBsmDTO.setBsm(bsm);

+ 18 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/yzt/ISearchService.java

@@ -0,0 +1,18 @@
+package com.onemap.apply.service.yzt;
+
+import com.onemap.apply.domain.yzt.CollectionDTO;
+import com.onemap.apply.domain.yzt.PoiSearchDTO;
+import com.onemap.common.core.web.domain.RequestResult;
+
+import java.util.Map;
+
+public interface ISearchService {
+
+    RequestResult poi(PoiSearchDTO poiSearchDTO);
+
+    RequestResult bookmark(PoiSearchDTO poiSearchDTO);
+
+    RequestResult bookmarkAdd(CollectionDTO collectionDTO);
+
+    RequestResult bookmarkDel(String id);
+}

+ 2 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/yzt/IXzqService.java

@@ -6,4 +6,6 @@ public interface IXzqService {
     RequestResult GetXzq(Boolean city);
 
     RequestResult GetXzqList(Boolean city);
+
+    RequestResult GetGeom(String id);
 }

+ 35 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/SearchMapper.xml

@@ -0,0 +1,35 @@
+<?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.yzt.SearchMapper">
+
+
+    <select id="poi" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.PoiDTO">
+        select t.name,t.adress,st_x ( t.geom ) x,st_y ( t.geom ) y
+        from  poi t where
+	t.name like '%'|| #{name} || '%'
+	limit ${limit} offset  ${offset}
+    </select>
+
+    <select id="poicount" parameterType="java.lang.String" resultType="java.lang.Integer">
+        select count(1) from poi t where t.name like '%'|| #{name} || '%'
+    </select>
+
+    <select id="bookmark" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.CollectionDTO">
+        select * from t_yzt_collection t where t.type = #{type}
+         <if test="name != null and name != ''">
+             and t.name like '%'|| #{name} || '%'
+         </if>
+	     limit ${limit} offset  ${offset}
+    </select>
+
+    <select id="bookmarkcount" parameterType="java.lang.String" resultType="java.lang.Integer">
+        select count(1)  FROM t_yzt_collection t
+        where t.type = #{type}
+        <if test="name != null and name != ''">
+            and t.name like '%'|| #{name} || '%'
+        </if>
+    </select>
+
+</mapper>

+ 27 - 22
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/XzqMapper.xml

@@ -9,9 +9,9 @@
         select t.id as "value",
         t.name as "label",
         t.pid as "parent",
-        case when (select count(*) from v_yzt_zysxcx p where p.type = 'XZQ' and p.pid = t.id) > 0 then '1'
+        case when (select count(*) from xzqh p where p.pid = t.id) > 0 then '1'
         else '0' end as "isparent"
-        from v_yzt_zysxcx t where t.type = 'XZQ'
+        from xzqh t where 1 = 1
         <if test="city == null or city == false">
             and t.pid is not null
         </if>
@@ -24,26 +24,31 @@
         select t.id as "value",
         t.name as "label",
         t.pid as "parent",
-        case when (select count(1) from v_yzt_zysxcx p where p.type = 'XZQ' and p.pid = t.id) > 0 then '1'
+        case when (select count(1) from xzqh p where p.pid = t.id) > 0 then '1'
         else '0' end as "isparent"
-        from v_yzt_zysxcx t where t.type = 'XZQ'
-        <if test="city == null or city == false">
-            and t.pid is not null and length(t.id) &lt;= (select case (select length(t.id) from v_yzt_zysxcx t where
-            t.type = 'XZQ' and t.pid is null)
-            when 2 then 4
-            when 4 then 6
-            when 6 then 9
-            when 9 then 12
-            end from dual)
-        </if>
-        <if test="city != null or city == true">
-            and length(t.id) &lt;= (select case (select length(t.id) from v_yzt_zysxcx t where t.type = 'XZQ' and t.pid
-            is null)
-            when 2 then 4
-            when 4 then 6
-            when 6 then 9
-            when 9 then 12
-            end from dual)
-        </if>
+        from xzqh t where 1 = 1
+        order by t.pid
+<!--        <if test="city == null or city == false">-->
+<!--            and t.pid is not null and length(t.id) &lt;= (select case (select length(t.id) from xzqh t where-->
+<!--             t.pid is null)-->
+<!--            when 2 then 4-->
+<!--            when 4 then 6-->
+<!--            when 6 then 9-->
+<!--            when 9 then 12-->
+<!--            end)-->
+<!--        </if>-->
+<!--        <if test="city != null or city == true">-->
+<!--            and length(t.id) &lt;= (select case (select length(t.id) from xzqh t where  t.pid-->
+<!--            is null)-->
+<!--            when 2 then 4-->
+<!--            when 4 then 6-->
+<!--            when 6 then 9-->
+<!--            when 9 then 12-->
+<!--            end )-->
+<!--        </if>-->
+    </select>
+
+    <select id="GetGeom" resultType="java.lang.String" parameterType="java.lang.String">
+        select st_asewkt(t.geom) from xzqh t where t.id = #{id}
     </select>
 </mapper>

+ 10 - 17
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/yzt/ZymlMapper.xml

@@ -40,12 +40,8 @@
         t.sjly as "sjly",
         t.legend as "legend",
         t.ywlx as "ywlx",
-        (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my",
-        to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
-        (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as
-        "createperson"
-        from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
-        left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
+        (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my"
+        from t_yzt_zyml t
         where 1 = 1
         <if test="param != null and param != ''">
             and t.bsm in (WITH RECURSIVE a AS (
@@ -117,7 +113,7 @@
           null as "url",
           t.state as "state",
           case when t.parent = 0 then 1 else 0 end  as "type"
-       from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde  order by t.lev,t.pbsm , t.sort
+       from t_yzt_zyml t  order by t.lev,t.pbsm , t.sort
     </select>
 
     <select id="GetMyCollect" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
@@ -125,10 +121,10 @@
           0 as "count",
            t.bsm as "bsm",
           t.name as "name",
-           case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
+          t.type as "type",
           t.pbsm as "pbsm",
           t.icon as "icon",
-          case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
+          t.url as "url",
           t.lev as "lev",
           t.sort as "sort",
           t.state as "state",
@@ -148,11 +144,8 @@
           t.legend as "legend",
         t.ywlx as "ywlx",
         #{username} as "my",
-          null as "fzbsm",
-          to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
-        (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as "createperson"
-       from T_YZT_ZYML t  left join t_yzt_db_layer dblayer on dblayer.id = t.sde
-       left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
+        #{username} as "favorite"
+       from T_YZT_ZYML t
        where t.bsm in ((select distinct(my.zy_bsm) from T_YZT_ZYML_MY my where my.uhbm = #{username})) order by t.bsm
     </select>
     <select id="GetMyCollect4XZQH" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
@@ -196,10 +189,10 @@
         0 as "count",
         t.bsm as "bsm",
         t.name as "name",
-        case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
+        t.type as "type",
         t.pbsm as "pbsm",
         t.icon as "icon",
-        case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
+       t.url as "url",
         t.lev as "lev",
         t.sort as "sort",
         t.state as "state",
@@ -220,7 +213,7 @@
         t.ywlx as "ywlx",
         null as "my",
         null as "fzbsm"
-        from T_YZT_ZYML t left join t_yzt_db_layer dblayer on dblayer.id = t.sde where t.bsm in
+        from T_YZT_ZYML t where t.bsm in
         <foreach collection="array" item="bsm" open="(" separator="," close=")">
             #{bsm}
         </foreach>

+ 4 - 4
onemap-modules/onemap-system/src/main/resources/mapper/postgresql/system/SysMenuMapper.xml

@@ -157,8 +157,8 @@
             <if test="path != null and path != ''">path = #{path},</if>
             <if test="component != null">component = #{component},</if>
             <if test="query != null">query = #{query},</if>
-            <if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
-            <if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
+            <if test="isFrame != null and isFrame != ''">is_frame = CAST (#{isFrame} as numeric),</if>
+            <if test="isCache != null and isCache != ''">is_cache = CAST (#{isCache} as numeric),</if>
             <if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
             <if test="visible != null">visible = #{visible},</if>
             <if test="status != null">status = #{status},</if>
@@ -205,8 +205,8 @@
         <if test="path != null and path != ''">#{path},</if>
         <if test="component != null and component != ''">#{component},</if>
         <if test="query != null and query != ''">#{query},</if>
-        <if test="isFrame != null and isFrame != ''">#{isFrame},</if>
-        <if test="isCache != null and isCache != ''">#{isCache},</if>
+        <if test="isFrame != null and isFrame != ''">CAST (#{isFrame} as numeric),</if>
+        <if test="isCache != null and isCache != ''">CAST (#{isCache} as numeric),</if>
         <if test="menuType != null and menuType != ''">#{menuType},</if>
         <if test="visible != null">#{visible},</if>
         <if test="status != null">#{status},</if>

+ 4 - 4
onemap-modules/onemap-system/src/main/resources/mapper/postgresql/system/SysRoleMapper.xml

@@ -113,10 +113,10 @@
         (select CASE WHEN max(role_id) is null THEN 1 ELSE max(role_id) + 1 END from sys_role),
         <if test="roleName != null and roleName != ''">#{roleName},</if>
         <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
-        <if test="roleSort != null and roleSort != ''">#{roleSort},</if>
+        <if test="roleSort != null and roleSort != ''">CAST (#{roleSort} as numeric),</if>
         <if test="dataScope != null and dataScope != ''">#{dataScope},</if>
-        <if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
-        <if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
+        <if test="menuCheckStrictly != null">boolean_to_numeric(#{menuCheckStrictly}),</if>
+        <if test="deptCheckStrictly != null">boolean_to_numeric(#{deptCheckStrictly}),</if>
         <if test="status != null and status != ''">#{status},</if>
         <if test="remark != null and remark != ''">#{remark},</if>
         <if test="createBy != null and createBy != ''">#{createBy},</if>
@@ -132,7 +132,7 @@
             <if test="roleSort != null and roleSort != ''">role_sort = CAST (#{roleSort} as numeric),</if>
             <if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
             <if test="menuCheckStrictly != null">menu_check_strictly = boolean_to_numeric(#{menuCheckStrictly}),</if>
-            <if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
+            <if test="deptCheckStrictly != null">dept_check_strictly = boolean_to_numeric(#{deptCheckStrictly}),</if>
             <if test="status != null and status != ''">status = #{status},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>