|
@@ -78,11 +78,11 @@ namespace MECF.Framework.Common.DBCore
|
|
public static List<OffsetItem> QueryOffsetDataByTime(string moduleName, DateTime from_time, DateTime to_time)
|
|
public static List<OffsetItem> QueryOffsetDataByTime(string moduleName, DateTime from_time, DateTime to_time)
|
|
{
|
|
{
|
|
List<OffsetItem> result = new List<OffsetItem>();
|
|
List<OffsetItem> result = new List<OffsetItem>();
|
|
- string sql = string.Format($"SELECT * FROM \"offset_data\" WHERE \"start_time\" >= '{from_time}' AND \"start_time\" <= '{to_time}' AND \"destination_module\" = '{moduleName}' ");
|
|
|
|
|
|
+ string sql = string.Format($"SELECT * FROM \"offset_data\" WHERE \"start_time\" >= '{from_time.ToString("yyyy/MM/dd HH:mm:ss.fff")}' AND \"start_time\" <= '{to_time.ToString("yyyy/MM/dd HH:mm:ss.fff")}' AND \"destination_module\" = '{moduleName}' ");
|
|
DataSet ds = DB.ExecuteDataset(sql);
|
|
DataSet ds = DB.ExecuteDataset(sql);
|
|
- if (ds == null)
|
|
|
|
|
|
+ if (ds == null || ds.Tables.Count == 0)
|
|
return result;
|
|
return result;
|
|
-
|
|
|
|
|
|
+
|
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
|
{
|
|
{
|
|
result.Add(new OffsetItem()
|
|
result.Add(new OffsetItem()
|