From 32116a7558911bce361da74ae0ac1b2e4900fb8c Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 17 三月 2023 16:06:12 +0800
Subject: [PATCH] 1

---
 ExportMap/db/PubDBHelper.cs |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/ExportMap/db/PubDBHelper.cs b/ExportMap/db/PubDBHelper.cs
index b41875e..2a57095 100644
--- a/ExportMap/db/PubDBHelper.cs
+++ b/ExportMap/db/PubDBHelper.cs
@@ -17,6 +17,33 @@
         private static string insertMetaPubSql = "insert into lf.sys_meta_pub (metaid, pubid) select {0}, {1} from (select 1) temp where not exists (select 1 from lf.sys_meta_pub where metaid = {0} and pubid = {1})";
 
         /// <summary>
+        /// 鏄�/鍚﹀彂甯冭繃
+        /// </summary>
+        public static bool IsPublish(int metaid)
+        {
+            string sql = "select count(*) from lf.sys_meta_pub a inner join lf.sys_publish b on a.pubid = b.id where a.metaid = " + metaid;
+
+            object obj = Tool.DBHelper.GetScalar(sql);
+            int count = obj == null ? 0 : Convert.ToInt32(obj);
+
+            return count > 0;
+        }
+
+        /// <summary>
+        /// 鏄�/鍚﹀彂甯冭繃
+        /// </summary>
+        public static bool IsPublish(string dirid)
+        {
+            string sql = "select count(*) from lf.sys_meta_pub a inner join lf.sys_publish b on a.pubid = b.id where b.dirid = @dirid";
+            DbParameter dp = new NpgsqlParameter("@dirid", dirid);
+
+            object obj = Tool.DBHelper.GetScalar(sql, dp);
+            int count = obj == null ? 0 : Convert.ToInt32(obj);
+
+            return count > 0;
+        }
+
+        /// <summary>
         /// 鎻掑叆鍏冩暟鎹�-鏁版嵁鍙戝竷琛ㄨ褰�
         /// </summary>
         public static int InsertMetaPub(int metaid, int pubid)

--
Gitblit v1.9.3