From 22b4c946cc51180ee68e2bea82a86b912fcfa744 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 16 三月 2023 18:54:31 +0800 Subject: [PATCH] 1 --- ExportMap/cs/SGUtils.cs | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 deletions(-) diff --git a/ExportMap/cs/SGUtils.cs b/ExportMap/cs/SGUtils.cs index cd91cb2..c3fe028 100644 --- a/ExportMap/cs/SGUtils.cs +++ b/ExportMap/cs/SGUtils.cs @@ -1,7 +1,9 @@ -锘縰sing ExportMap.Models; +锘縰sing ExportMap.db; +using ExportMap.Models; using System; using System.Collections.Generic; using System.Configuration; +using System.Data; using System.Linq; using System.Web; @@ -60,9 +62,40 @@ /// <returns>琛屾暟</returns> public static int Release(XYZArgs args) { + List<SysMeta> list = XYZUtils.selectMetas(args.ids, "and type in ('mpt', '3dml')"); + if (null == list || list.Count == 0) return 0; + int maxId = GetMaxId(); + List<SpatialItem> items = SelectItems(maxId); + if (null == items || items.Count == 0) return 0; return 0; } + + /// <summary> + /// 鑾峰彇鏈�澶D鍊� + /// </summary> + public static int GetMaxId() + { + Object obj = SQLiteHelper.ExecuteScalar("select max(id) from SpatialItems"); + + return null == obj ? 0 : Convert.ToInt32(obj); + } + + /// <summary> + /// 鏌ヨSG鏁版嵁椤� + /// </summary> + /// <param name="maxId">鏈�澶D鍊�</param> + /// <returns>SG鏁版嵁椤�</returns> + public static List<SpatialItem> SelectItems(int maxId) + { + string sql = string.Format("select id, Name, RelativePath, LayerName, DataSourceId, Description from SpatialItems where id > {0} order by id desc", maxId); + + DataTable dt = SQLiteHelper.GetDataTable(sql); + List<SpatialItem> list = ModelHandler.FillModel<SpatialItem>(dt); + + + return list; + } } } -- Gitblit v1.9.3