增加查询条件

This commit is contained in:
2024-04-15 10:28:59 +08:00
parent 00cbde90c7
commit 65e2a45d74
3 changed files with 7 additions and 1 deletions
@@ -51,6 +51,10 @@ namespace IRaCIS.Core.Application.ViewModel
public DateTime? EndDate { get; set; }
public string? LoginUserName { get; set; }
public UserTypeEnum? LoginUserTypeEnum { get; set; }
}
@@ -709,6 +709,8 @@ namespace IRaCIS.Application.Services
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
.WhereIf(inQuery.LoginUserTypeEnum != null, t => t.LoginUser.UserTypeEnum== inQuery.LoginUserTypeEnum)
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.LoginUser.UserName.Contains(inQuery.LoginUserName!))
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName!))
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!))
.ProjectTo<UserLogView>(_mapper.ConfigurationProvider);