From b77e20c5fdb7be7d70963161b20bb62550b11de4 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 25 七月 2023 09:02:51 +0800 Subject: [PATCH] 1 --- ExportMap/db/PubDBHelper.cs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/ExportMap/db/PubDBHelper.cs b/ExportMap/db/PubDBHelper.cs index 698179e..5f60ebb 100644 --- a/ExportMap/db/PubDBHelper.cs +++ b/ExportMap/db/PubDBHelper.cs @@ -3,6 +3,7 @@ using Npgsql; using System; using System.Collections.Generic; +using System.Data; using System.Data.Common; using System.Linq; using System.Reflection; @@ -57,6 +58,54 @@ } /// <summary> + /// 鑾峰彇鍙戝竷ID + /// </summary> + public static int GetPushlishId(string dirid, string type = "DOM") + { + string sql = string.Format("select b.id from lf.sys_publish b where b.type = '{0}' and b.dirid = '{1}' limit 1", type, dirid); + object obj = Tools.DBHelper.GetScalar(sql); + + return null == obj ? 0 : Convert.ToInt32(obj); + } + + /// <summary> + /// 鑾峰彇宸茬粡鍙戝竷鐨勫厓鏁版嵁ID + /// </summary> + public static List<int> GetPublishMetaId(int pubid) + { + string sql = string.Format("select metaid from lf.sys_meta_pub where pubid = {0}", pubid); + DataTable dt = Tools.DBHelper.GetDataTable(sql); + + List<int> list = new List<int>(); + if (null == dt || 0 == dt.Rows.Count) return list; + + for (int i = 0, c = dt.Rows.Count; i < c; i++) + { + object obj = dt.Rows[i][0]; + if (null != obj) + { + int id = 0; + if (int.TryParse(obj.ToString(), out id)) + { + list.Add(id); + } + } + } + + return list; + } + + /// <summary> + /// 鏇存柊鍙戝竷鏁版嵁鐨勫潗鏍� + /// </summary> + public static int UpdatePublishCoord(int pid, string json) + { + string sql = string.Format("update lf.sys_publish set json = '{0}' where id = {1}", json, pid); + + return Tools.DBHelper.ExecuteNonQuery(sql); + } + + /// <summary> /// 鎻掑叆鍏冩暟鎹�-鏁版嵁鍙戝竷琛ㄨ褰� /// </summary> public static int InsertMetaPub(int metaid, int pubid, int userId) -- Gitblit v1.9.3