优化数据仓储
This commit is contained in:
@@ -13,8 +13,17 @@ namespace ZR.Repository.System
|
||||
/// 文章管理
|
||||
/// </summary>
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class ArticleRepository
|
||||
public class ArticleRepository : BaseRepository<Article>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文章目录
|
||||
/// </summary>
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class ArticleCategoryRepository : BaseRepository<ArticleCategory>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Infrastructure.Attribute;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -33,13 +33,13 @@ namespace ZR.Repository.System
|
||||
/// <returns></returns>
|
||||
public PagedInfo<SysRole> SelectRoleList(SysRole sysRole, PagerInfo pager)
|
||||
{
|
||||
return Context.Queryable<SysRole>()
|
||||
.Where(role => role.DelFlag == "0")
|
||||
.WhereIF(!string.IsNullOrEmpty(sysRole.RoleName), role => role.RoleName.Contains(sysRole.RoleName))
|
||||
.WhereIF(!string.IsNullOrEmpty(sysRole.Status), role => role.Status == sysRole.Status)
|
||||
.WhereIF(!string.IsNullOrEmpty(sysRole.RoleKey), role => role.RoleKey == sysRole.RoleKey)
|
||||
.OrderBy(role => role.RoleSort)
|
||||
.ToPage(pager);
|
||||
var exp = Expressionable.Create<SysRole>();
|
||||
exp.And(role => role.DelFlag == "0");
|
||||
exp.AndIF(!string.IsNullOrEmpty(sysRole.RoleName), role => role.RoleName.Contains(sysRole.RoleName));
|
||||
exp.AndIF(!string.IsNullOrEmpty(sysRole.Status), role => role.Status == sysRole.Status);
|
||||
exp.AndIF(!string.IsNullOrEmpty(sysRole.RoleKey), role => role.RoleKey == sysRole.RoleKey);
|
||||
|
||||
return GetPages(exp.ToExpression(), pager, x => x.RoleSort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
15
ZR.Repository/System/SysTasksQzRepository.cs
Normal file
15
ZR.Repository/System/SysTasksQzRepository.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.System;
|
||||
|
||||
namespace ZR.Repository.System
|
||||
{
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class SysTasksQzRepository: BaseRepository<SysTasksQz>
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user