管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2023-08-21 db08e93569ee28f23bf0406dda112a5e3880b2a9
DataLoader/CS/MetaHelper.cs
@@ -1,4 +1,5 @@
using DataLoader.Model;
using Npgsql;
using System;
using System.Collections.Generic;
using System.Data.Common;
@@ -32,5 +33,31 @@
            return count;
        }
        /// <summary>
        /// 根据GUID查询路径
        /// </summary>
        public static string GetFilePathByGuid(string guid)
        {
            string sql = "select path from lf.sys_meta where guid = @guid limit 1";
            DbParameter dp = new NpgsqlParameter("@guid", guid);
            object obj = Tools.DBHelper.GetScalar(sql, dp);
            return obj == null ? null : obj.ToString();
        }
        /// <summary>
        /// 文件是/否存在
        /// </summary>
        public static bool IsFileExists(string guid)
        {
            string sql = "select count(*) from lf.sys_meta where guid = @guid";
            DbParameter dp = new NpgsqlParameter("@guid", guid);
            object obj = Tools.DBHelper.GetScalar(sql, dp);
            return obj != null && Convert.ToInt32(obj) > 0;
        }
    }
}