只更新位置列

This commit is contained in:
yanghongwei 2025-04-07 22:38:22 +08:00
parent e72164545e
commit c307164f31
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ builder.Services.AddTransient<SqlSugarClient>(sp =>
#if DEBUG
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql + "参数值:" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
// Console.WriteLine(sql + "参数值:" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
};
//创建数据库和表的语句仅执行一次
//db.DbMaintenance.CreateDatabase();

View File

@ -132,7 +132,7 @@ namespace LY.App.Service
await _redisService.SetAsync(key, deviceinfo);
//更新位置
// await _db.Updateable(deviceinfo).ExecuteCommandAsync();
await _db.CopyNew().Updateable<DeviceEntity>(deviceinfo).ExecuteCommandAsync();
await _db.CopyNew().Updateable<DeviceEntity>(deviceinfo).UpdateColumns(it => new { it.Lat, it.Lon }).ExecuteCommandAsync();
}
}
private async Task<long> GetBatId(string droneId)