| | |
| | | using DataLoader.Model; |
| | | using Npgsql; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Common; |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | } |