test .
This commit is contained in:
@@ -374,11 +374,15 @@ public class DeviceUploadLogService : IDeviceUploadLogService
|
||||
public async Task Test()
|
||||
{
|
||||
var before60Days = DateTime.Today.AddDays(-60).AddSeconds(1);
|
||||
var data = await _dbContext.Queryable<DeviceUploadLogEntity>().Where(x => x.RaiseDateTime < before60Days).OrderBy(x => x.Id).FirstAsync();
|
||||
var data = await _dbContext.Queryable<DeviceUploadLogEntity>().Where(x => x.RaiseDateTime < before60Days).OrderBy(x => x.Id).ToPageListAsync(1, 1000);
|
||||
await _dbContext.DeleteReallyAsync(data);
|
||||
|
||||
const string tableName = "deviceuploadlog_20250107";
|
||||
data.Id = 0;
|
||||
foreach (var item in data)
|
||||
{
|
||||
item.Id = 0;
|
||||
}
|
||||
|
||||
await _dbContext.Client.Insertable(data).AS(tableName).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user