From 8ec364949c81cf421cc98d3bbad6848ab032e14e Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 04 Aug 2023 16:02:45 +0800
Subject: [PATCH] 日志输出修改

---
 src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml |  122 +++++++++++++++++++++++++++++-----------
 1 files changed, 88 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..7f25ef1 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,89 @@
         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="lazyTeam" 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
+        (SELECT id,parent_id,dept_name,is_deleted FROM sys_jurisdiction
+        UNION all
+        SELECT id,police as parent_id,name as dept_name,is_deleted FROM sys_team
+        ) jur
+        WHERE
+        jur.parent_id = dept.id and jur.is_deleted = 0
+        ) AS "has_children"
+        FROM
+        (SELECT id,parent_id,dept_name,is_deleted FROM sys_jurisdiction
+        UNION all
+        SELECT id,police as parent_id,name as dept_name,is_deleted FROM sys_team
+        )  dept
+        WHERE dept.is_deleted = 0
+    </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="listJur" resultType="java.util.HashMap">
+        SELECT dept_name AS title,id
+        FROM sys_jurisdiction
+        WHERE is_deleted = 0 and dept_name like '%派出所%'
+    </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