添加关键字查询
parent
dbb25ed313
commit
f8a1b396b9
|
@ -78,6 +78,8 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class BasicDicQuery:PageInput
|
||||
{
|
||||
public string? keyInfo { get; set; }
|
||||
|
||||
public string? Code { get; set; }
|
||||
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var systemBasicDataQueryable = _dicRepository.Where(t => t.ParentId == null)
|
||||
.WhereIf(!string.IsNullOrEmpty(basicDicQuery.Code), t => t.Code.Contains(basicDicQuery.Code!))
|
||||
.WhereIf(!string.IsNullOrEmpty(basicDicQuery.keyInfo), t => t.Description.Contains(basicDicQuery.keyInfo!) || t.Code.Contains(basicDicQuery.keyInfo!)
|
||||
|| t.ChildList.Any(u=>u.ValueCN.Contains(basicDicQuery.keyInfo!)) || t.ChildList.Any(u => u.Description.Contains(basicDicQuery.keyInfo!)))
|
||||
|
||||
.WhereIf(basicDicQuery.ConfigTypeId != null, t => t.ConfigTypeId == basicDicQuery.ConfigTypeId!)
|
||||
.WhereIf(basicDicQuery.DataTypeEnum != null, t => t.DataTypeEnum == basicDicQuery.DataTypeEnum)
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[ForeignKey("ParentId")]
|
||||
public Dictionary Parent { get; set; }
|
||||
|
||||
public List<Dictionary> ChildList { get; set; } = new List<Dictionary>();
|
||||
|
||||
|
||||
[NotMapped]
|
||||
|
|
|
@ -1077,24 +1077,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否为空
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
private bool IsNullOrEmpty(object value)
|
||||
{
|
||||
if (value == null || value.ToString() == string.Empty)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
//modelBuilder.HasDbFunction(typeof(DbContext).GetMethod(nameof(GetTableList)));
|
||||
|
||||
|
||||
modelBuilder.Entity<Dictionary>().HasMany(t => t.ChildList).WithOne(t => t.Parent);
|
||||
if (_userInfo.IsEn_Us)
|
||||
{
|
||||
modelBuilder.Entity<Dictionary>().Property(t => t.MappedValue).HasColumnName(nameof(Domain.Models.Dictionary.Value));
|
||||
|
|
|
@ -570,15 +570,6 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 稽查
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue