123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using Attribute;
- using Model;
- using Model.Base;
- using Repository;
- using Service;
- using Microsoft.AspNetCore.Mvc;
- using Vo.Admin;
- namespace Services
- {
- /// <summary>
- /// 条件匹配表Service业务层处理
- /// </summary>
- [AppService(ServiceType = typeof(IPriQueryTableService), ServiceLifetime = LifeTime.Transient)]
- public class PriQueryTableService : BaseService<PriQueryTable>, IPriQueryTableService
- {
- /// <summary>
- /// 条件匹配表-列表
- /// </summary>
- /// <param name="param">参数请求体</param>
- /// <param name="page">分页参数</param>
- /// <returns>列表</returns>
- public PagedInfo<GetPriQueryTableListVo> getPriQueryTableList([FromQuery] PagerInfo page, [FromQuery] PriQueryTable param)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriQueryTable>();
- predicate = predicate.AndIF(!string.IsNullOrEmpty(param.tableEnName), m => m.tableEnName.Contains(param.tableEnName));
- predicate = predicate.AndIF(param.projectId > 0, m => m.projectId == param.projectId);
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriQueryTable, GetPriQueryTableListVo>(page);
- return response;
- }
- /// <summary>
- /// 条件匹配表-下拉框数据
- /// </summary>
- /// <param name="page">分页参数</param>
- /// <returns>下拉框数据</returns>
- public PagedInfo<GetPriQueryTableDicVo> getPriQueryTableDic([FromQuery] PagerInfo page)
- {
- //拼装查询条件
- var predicate = Expressionable.Create<PriQueryTable>();
- var response = Queryable()
- .Where(predicate.ToExpression())
- .OrderByDescending(m => m.id)
- .ToPage<PriQueryTable, GetPriQueryTableDicVo>(page);
- return response;
- }
- }
- }
|