完成字典、字典类型管理相关

This commit is contained in:
橙子
2023-02-05 15:17:11 +08:00
parent b01d242cbc
commit 95484877a3
51 changed files with 1388 additions and 76 deletions

View File

@@ -0,0 +1,36 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core.Sqlsugar.Repositories;
using Yi.Framework.Ddd.Dtos;
using Yi.Framework.Ddd.Dtos.Abstract;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.RBAC.Domain.Dictionary.Repositories;
using Yi.RBAC.Domain.Identity.Entities;
using Yi.RBAC.Domain.Identity.Repositories;
namespace Yi.RBAC.Sqlsugar.Repositories
{
[AppService]
public class DictionaryRepository : SqlsugarRepository<DictionaryEntity>, IDictionaryRepository
{
public DictionaryRepository(ISqlSugarClient context) : base(context)
{
}
public async Task<PagedDto<DictionaryEntity>> SelectGetListAsync(DictionaryEntity input, IPagedAndSortedResultRequestDto pageInput)
{
RefAsync<int> total = 0;
var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
.WhereIF(input.State is not null,x => x.State == input.State)
.ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total);
return new PagedDto<DictionaryEntity>(total, entities);
}
}
}

View File

@@ -0,0 +1,35 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core.Sqlsugar.Repositories;
using Yi.Framework.Ddd.Dtos;
using Yi.Framework.Ddd.Dtos.Abstract;
using Yi.RBAC.Domain.Dictionary.Entities;
using Yi.RBAC.Domain.Dictionary.Repositories;
namespace Yi.RBAC.Sqlsugar.Repositories
{
[AppService]
public class DictionaryTypeRepository : SqlsugarRepository<DictionaryTypeEntity>, IDictionaryTypeRepository
{
public DictionaryTypeRepository(ISqlSugarClient context) : base(context)
{
}
public async Task<PagedDto<DictionaryTypeEntity>> SelectGetListAsync(DictionaryTypeEntity input, IPagedAllResultRequestDto pageInput)
{
RefAsync<int> total = 0;
var entities = await _DbQueryable.WhereIF(input.DictName is not null, x => x.DictName.Contains(input.DictName!))
.WhereIF(input.DictType is not null, x => x.DictType!.Contains(input.DictType!))
.WhereIF(input.State is not null, x => x.State == input.State)
.WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null ,x=>x.CreationTime>=pageInput.StartTime && x.CreationTime<=pageInput.EndTime)
.ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total);
return new PagedDto<DictionaryTypeEntity>(total, entities);
}
}
}

View File

@@ -29,7 +29,7 @@ namespace Yi.RBAC.Sqlsugar.Repositories
var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.UserName), x => x.UserName.Contains(input.UserName!)).
WhereIF(input.Phone is not null, x => x.Phone.ToString()! .Contains(input.Phone.ToString()!)).
WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name!.Contains(input.Name!)).
WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null, x => x.CreationTime >= pageInput.StartTime && x.CreationTime <= pageInput.EndTime).ToPageListAsync(pageInput.PageIndex, pageInput.PageSize);
WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null, x => x.CreationTime >= pageInput.StartTime && x.CreationTime <= pageInput.EndTime).ToPageListAsync(pageInput.PageNum, pageInput.PageSize);
return entities;
}