岗位管理:增删改查功能

This commit is contained in:
陈淳
2022-09-13 17:05:53 +08:00
parent 01631860f4
commit 7b6d8671cf
33 changed files with 665 additions and 58 deletions

View File

@@ -0,0 +1,26 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class DeptService : BaseService<DeptEntity>, IDeptService
{
public async Task<PageModel<List<DeptEntity>>> SelctPageList(DeptEntity dept, PageParModel page)
{
RefAsync<int> total = 0;
var data = await _repository._DbQueryable
.WhereIF(!string.IsNullOrEmpty(dept.DeptName), u => u.DeptName.Contains(dept.DeptName))
.WhereIF(dept.IsDeleted.IsNotNull(), u => u.IsDeleted == dept.IsDeleted)
.OrderBy(u => u.OrderNum, OrderByType.Desc)
.ToPageListAsync(page.PageNum, page.PageSize, total);
return new PageModel<List<DeptEntity>>(data, total);
}
}
}

View File

@@ -0,0 +1,28 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class PostService : BaseService<PostEntity>, IPostService
{
public async Task<PageModel<List<PostEntity>>> SelctPageList(PostEntity post, PageParModel page)
{
RefAsync<int> total = 0;
var data = await _repository._DbQueryable
.WhereIF(!string.IsNullOrEmpty(post.PostName), u => u.PostName.Contains(post.PostName))
.WhereIF(!string.IsNullOrEmpty(post.PostCode), u => u.PostCode.Contains(post.PostCode))
.WhereIF(post.IsDeleted.IsNotNull(), u => u.IsDeleted == post.IsDeleted)
.OrderBy(u => u.OrderNum, OrderByType.Desc)
.ToPageListAsync(page.PageNum, page.PageSize, total);
return new PageModel<List<PostEntity>>(data, total);
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class DeptService : BaseService<DeptEntity>, IDeptService
{
public DeptService(IRepository<DeptEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class PostService : BaseService<PostEntity>, IPostService
{
public PostService(IRepository<PostEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class RoleDeptService : BaseService<RoleDeptEntity>, IRoleDeptService
{
public RoleDeptService(IRepository<RoleDeptEntity> repository) : base(repository)
{
}
}
}

View File

@@ -0,0 +1,14 @@
using SqlSugar;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class UserPostService : BaseService<UserPostEntity>, IUserPostService
{
public UserPostService(IRepository<UserPostEntity> repository) : base(repository)
{
}
}
}