修改查询条件

This commit is contained in:
2022-06-07 10:00:25 +08:00
parent f4693292e6
commit 05d96e9de1
5 changed files with 217 additions and 76 deletions
@@ -65,6 +65,10 @@ namespace IRaCIS.Core.Application.Contracts
///<summary> TypeValue</summary>
public string Type { get; set; }=String.Empty;
public bool? IsEnable { get; set; }
public bool? IsRequired { get; set; }
}
@@ -34,6 +34,10 @@ namespace IRaCIS.Core.Application.Contracts
var trialQCQuestionQueryable = _trialQcQuestionRepository.Where(t => t.TrialId == queryTrialQCQuestionConfigure.TrialId)
.WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.QuestionName), t => t.QuestionName.Contains(queryTrialQCQuestionConfigure.QuestionName))
.WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.Type), t => t.Type.Contains(queryTrialQCQuestionConfigure.Type))
.WhereIf(queryTrialQCQuestionConfigure.IsEnable!=null, t => t.IsEnable== queryTrialQCQuestionConfigure.IsEnable)
.WhereIf(queryTrialQCQuestionConfigure.IsRequired != null, t => t.IsRequired == queryTrialQCQuestionConfigure.IsRequired)
.ProjectTo<TrialQCQuestionConfigureView>(_mapper.ConfigurationProvider);
var list = await trialQCQuestionQueryable.OrderBy(t => t.ShowOrder).ToListAsync();