From e49c42ad641fa7ddaa4250ffd408666b087d1d48 Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期五, 29 八月 2025 13:25:26 +0800
Subject: [PATCH] feat:开发

---
 FlexJobApi.CommonServer.Application/Dictionaries/Queries/DictionaryDatasQueryHandler.cs |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/FlexJobApi.CommonServer.Application/Dictionaries/Queries/DictionaryDatasQueryHandler.cs b/FlexJobApi.CommonServer.Application/Dictionaries/Queries/DictionaryDatasQueryHandler.cs
index 7320af0..002d01e 100644
--- a/FlexJobApi.CommonServer.Application/Dictionaries/Queries/DictionaryDatasQueryHandler.cs
+++ b/FlexJobApi.CommonServer.Application/Dictionaries/Queries/DictionaryDatasQueryHandler.cs
@@ -81,7 +81,14 @@
 WHERE d.IsDisabled = 0";
             if (request.All != true)
             {
-                sql += " AND d.ParentId = @ParentId";
+                if (request.ParentId == null)
+                {
+                    sql += " AND d.ParentId IS NULL";
+                }
+                else
+                {
+                    sql += " AND d.ParentId = @ParentId";
+                }
             }
             if (request.MaxDeep.HasValue)
             {
@@ -120,7 +127,7 @@
                 option.Label = model.Content;
                 options.Add(option);
             }
-            if (request.WithChildren)
+            if (request.WithChildren == true)
             {
                 var parents = options.Where(it => it.Data.ParentId == null).ToList();
                 LoopChildrens(parents, options);

--
Gitblit v1.9.1