From b5960d1968e007b91d4d33dd7cbb74f1b566f2c1 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 24 May 2024 10:20:01 +0800
Subject: [PATCH] 到期时间修改

---
 src/main/java/org/springblade/modules/jurisdiction/mapper/JurisdictionMapper.xml |   86 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 64 insertions(+), 22 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 76b395e..90cf53b 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,21 +68,21 @@
         </if>
     </select>
 
-    <select id="lazyTree" resultMap="treeNodeResultMap" >
+    <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
+        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"
+        WHERE
+        parent_id = dept.id and is_deleted = 0
+        ) AS "has_children"
         FROM
         sys_jurisdiction dept
         WHERE dept.is_deleted = 0
@@ -94,7 +94,7 @@
         </if>
     </select>
 
-    <select id="lazyTrees" resultMap="treeNodeResultMap" >
+    <!--<select id="lazyTrees" resultMap="treeNodeResultMap" >
         SELECT
         dept.id,
         dept.parent_id,
@@ -112,5 +112,47 @@
         FROM
             sys_jurisdiction 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 0 ELSE 1 END
+                   FROM sys_jurisdiction
+                   WHERE parent_id = dept.id
+                     and is_deleted = 0
+               )              AS "has_children"
+        FROM sys_jurisdiction dept
+        WHERE (
+                  SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
+                  FROM sys_jurisdiction
+                  WHERE parent_id = dept.id
+                    and is_deleted = 0
+              ) = 1
+    </select>
+    <select id="lazyTreeJu" 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>
 </mapper>

--
Gitblit v1.9.3