using Attribute; using Model; using Model.Base; using Repository; using Service; using Microsoft.AspNetCore.Mvc; using Vo.Admin; namespace Services { /// /// 奖励入库条件字段Service业务层处理 /// [AppService(ServiceType = typeof(IPriPrizeInQueryFieldService), ServiceLifetime = LifeTime.Transient)] public class PriPrizeInQueryFieldService : BaseService, IPriPrizeInQueryFieldService { /// /// 奖励入库条件字段-列表 /// /// 参数请求体 /// 分页参数 /// 列表 public PagedInfo getPriPrizeInQueryFieldList([FromQuery] PagerInfo page, [FromQuery] PriPrizeInQueryField param) { //拼装查询条件 var predicate = Expressionable.Create(); predicate = predicate.AndIF(!string.IsNullOrEmpty(param.fieldName), m => m.fieldName.Contains(param.fieldName)); predicate = predicate.AndIF(!string.IsNullOrEmpty(param.fieldEnName), m => m.fieldEnName.Contains(param.fieldEnName)); predicate = predicate.AndIF(param.inTableId > 0, m => m.inTableId == param.inTableId); var response = Queryable() .Where(predicate.ToExpression()) .OrderByDescending(m => m.id) .ToPage(page); return response; } } }