From 1c0706a3eba8069b5b1da4955abc075d3facf11d Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 25 Feb 2022 14:57:51 +0800
Subject: [PATCH] 1.空间信息

---
 src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml |   92 +++++++++++++++++++++++++++++-----------------
 1 files changed, 58 insertions(+), 34 deletions(-)

diff --git a/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml b/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
index c2ddb03..d45852b 100644
--- a/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
+++ b/src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml
@@ -35,15 +35,15 @@
 
     <select id="lazyList" resultMap="deptVOResultMap">
         SELECT
-            dept.* ,
-            (
-                SELECT
-                    CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
-                FROM
+        dept.* ,
+        (
+        SELECT
+        CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
+        FROM
         sys_jurisdiction
-                WHERE
-                    parent_id = dept.id and is_deleted = 0
-            ) AS "has_children"
+        WHERE
+        parent_id = dept.id and is_deleted = 0
+        ) AS "has_children"
         FROM
         sys_jurisdiction dept
         WHERE dept.is_deleted = 0
@@ -68,30 +68,7 @@
         </if>
     </select>
 
-    <select id="lazyTree" resultMap="treeNodeResultMap" >
-        SELECT
-            dept.id,
-            dept.parent_id,
-            dept.dept_name AS title,
-            dept.id AS "value",
-            dept.id AS "key",
-            (
-                SELECT
-                    CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
-                FROM
-        sys_jurisdiction
-                WHERE
-                    parent_id = dept.id and is_deleted = 0
-            ) AS "has_children"
-        FROM
-        sys_jurisdiction dept
-        WHERE dept.is_deleted = 0
-        <if test="param1!=null and param1!=''">
-            and dept.tenant_id = #{param1}
-        </if>
-    </select>
-
-    <select id="lazyTrees" resultMap="treeNodeResultMap" >
+    <select id="lazyTree" resultMap="treeNodeResultMap">
         SELECT
         dept.id,
         dept.parent_id,
@@ -102,12 +79,59 @@
         SELECT
         CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
         FROM
-            sys_jurisdiction
+        sys_jurisdiction
         WHERE
         parent_id = dept.id and is_deleted = 0
         ) AS "has_children"
         FROM
-            sys_jurisdiction dept
+        sys_jurisdiction dept
         WHERE dept.is_deleted = 0
+        <if test="param1!=null and param1!=''">
+            and dept.tenant_id = #{param1}
+        </if>
+    </select>
+
+    <select id="lazyTrees" resultMap="treeNodeResultMap">
+        SELECT dept.id,
+               dept.parent_id,
+               dept.dept_name AS title,
+               dept.id        AS "value",
+               dept.id        AS "key",
+               (
+                   SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
+                   FROM sys_jurisdiction
+                   WHERE parent_id = dept.id
+                     and is_deleted = 0
+               )              AS "has_children"
+        FROM sys_jurisdiction dept
+        WHERE dept.is_deleted = 0
+    </select>
+
+    <select id="Test" resultType="java.util.HashMap">
+        SELECT wgmc, wgbj
+        FROM nb_wgxx
+        WHERE wgbj is NOT NULL
+          and wglx = 'W3'
+    </select>
+
+
+    <update id="update">
+        update sys_jurisdiction
+        set space=ST_GeomFromText(${space})
+        where dept_name = #{deptname}
+    </update>
+
+
+    <!--    &lt;!&ndash;判断打卡点是否在电子围栏内&ndash;&gt;-->
+    <!--    <select id="isOnArea" resultType="java.util.HashMap">-->
+    <!--        select id,dept_name from sys_jurisdiction-->
+    <!--        where-->
+    <!--            MBRWithin(ST_GeomFromText('POINT(${jd} ${wd})'),space)-->
+    <!--    </select>-->
+    <!--判断打卡点是否在电子围栏内-->
+    <select id="isOnArea" resultType="java.util.HashMap">
+        select id, dept_name
+        from sys_jurisdiction
+        where MBRWithin(ST_GeomFromText('POINT(${jd} ${wd})'), space) LIMIT 0,1;
     </select>
 </mapper>

--
Gitblit v1.9.3