1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using Attribute;
- using Dto;
- using Vo;
- using Model;
- using Model.Base;
- using Repository;
- using Service;
- using Microsoft.AspNetCore.Mvc;
- namespace Services
- {
- /// <summary>
- /// 字典表Service业务层处理
- /// </summary>
- [AppService(ServiceType = typeof(ISysDictService), ServiceLifetime = LifeTime.Transient)]
- public class SysDictService : BaseService<SysDict>, ISysDictService
- {
- /// <summary>
- /// 字典表-列表
- /// </summary>
- /// <param name="parm">请求参数</param>
- /// <returns>字典表列表</returns>
- public PagedInfo<SysDictListVo> List([FromQuery] SysDictListDto parm)
- {
- //开始拼装查询条件
- var predicate = Expressionable.Create<SysDict>();
- predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.dictType), m => m.dictType.Contains(parm.dictType));
- predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.description), m => m.description.Contains(parm.description));
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<SysDict, SysDictListVo>(new PagerInfo());
- return response;
- }
- }
- }
|