From ed8c7a5effd0d423ce1118b680ecdca6fe732609 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 02 七月 2025 16:43:13 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.11.205:9000/r/P2022036_Service --- src/main/java/com/lf/server/mapper/all/GeomBaseMapper.java | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 50 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/lf/server/mapper/all/GeomBaseMapper.java b/src/main/java/com/lf/server/mapper/all/GeomBaseMapper.java index 616be8c..7ec2db1 100644 --- a/src/main/java/com/lf/server/mapper/all/GeomBaseMapper.java +++ b/src/main/java/com/lf/server/mapper/all/GeomBaseMapper.java @@ -2,6 +2,9 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; + +import java.util.List; /** * 绌洪棿鍩虹Mapper @@ -16,6 +19,52 @@ * @param gid GID * @return WKT */ - @Select("select st_astext(geom) geom from ${tab} where gid = #{gid}") + @Select("select ST_AsText(geom) geom from ${tab} where gid = #{gid} limit 1") public String selectWktById(@Param("tab") String tab, @Param("gid") Integer gid); + + /** + * 鏍规嵁琛ㄥ悕鏌ヨ绌洪棿鍙傝�� + * + * @param tab 琛ㄥ悕 + * @return SRID + */ + @Select("select ST_SRID(geom) from ${tab} where geom is not null limit 1") + public Integer selectSrid(@Param("tab") String tab); + + /** + * 鏍规嵁琛ㄥ悕鏌ヨ绌洪棿绫诲瀷 + * + * @param tab 琛ㄥ悕 + * @return SRID + */ + @Select("select ST_GeometryType(geom) from ${tab} where geom is not null limit 1") + public String selectGeometryType(@Param("tab") String tab); + + /** + * 鏌ヨDB涓孩鍑虹殑鍗曚綅ID + * + * @param tab 琛ㄥ悕 + * @param depid 鍗曚綅ID + * @param geoFilter 绌洪棿杩囨护鏉′欢 + * @return 婧㈠嚭鐨勫崟浣岻D + */ + @Select("<script>" + + " select depid from ${tab} where depid is not null and depid not like '${depid}%'" + + " <if test='geoFilter != null'>" + + " and ${geoFilter}" + + " </if>" + + " group by depid" + + "</script>") + public List<Integer> selectDbOverflowDep(@Param("tab") String tab, @Param("depid") String depid, @Param("geoFilter") String geoFilter); + + /** + * 鏇存柊绌洪棿浣嶇疆 + * + * @param tab 琛ㄥ悕 + * @param gid GID + * @param wkt WKT + * @return 褰卞搷琛屾暟 + */ + @Update("update ${tab} set geom = ST_GeomFromText('${wkt}') where gid = #{gid} limit 1") + public Integer updateGeom(@Param("tab") String tab, @Param("gid") Integer gid, @Param("wkt") String wkt); } -- Gitblit v1.9.3