fix:轨迹标记分页查询添加code模糊

This commit is contained in:
moyongzhen 2024-04-22 14:42:40 +08:00
parent 954654ede6
commit d95bcb70c0
3 changed files with 11 additions and 10 deletions

View File

@ -58,11 +58,11 @@
/// <summary>
/// 选中的轨迹标记id
/// </summary>
public List<int>? SelectIds { get; set; }
public List<int>? SelectIds { get; set; }
///// <summary>
///// 关键字
///// </summary>
//public string Keywords { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string? Keywords { get; set; }
}
}

View File

@ -18,10 +18,10 @@ namespace SJZY.Track.Domain.Dtos.TrackFlags
/// </summary>
public List<int>? SelectIds { get; set; }
///// <summary>
///// 关键字
///// </summary>
//public string Keywords { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string? Keywords { get; set; }
}
public class GetTrackFlagListVO

View File

@ -46,8 +46,9 @@ public class TrackFlagRepository : BasicRepository<TrackFlagEntity>, ITrackFlagR
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id && c.IsDeleted == false)
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id && d.IsDeleted == false)
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b, c, d) => SqlFunc.Contains(a.Code, input.Keywords))
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc)
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds!.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
.Select((a, b, c, d) => new GetTrackFlagListVO
{
Id = a.Id,