zhuangpei-mesbackend/DOAN.Service/MES/group/GroupPersonSkillMatrixService.cs
2024-08-12 14:41:07 +08:00

86 lines
2.7 KiB
C#

using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using DOAN.Model;
using DOAN.Model.Dto;
using DOAN.Model.MES.group;
using DOAN.Model.MES.group.Dto;
using DOAN.Repository;
using DOAN.Service.group.IService;
using System.Linq;
namespace DOAN.Service.group
{
/// <summary>
/// 人员技能矩阵图Service业务层处理
/// </summary>
[AppService(ServiceType = typeof(IGroupPersonSkillMatrixService), ServiceLifetime = LifeTime.Transient)]
public class GroupPersonSkillMatrixService : BaseService<GroupPersonSkillMatrix>, IGroupPersonSkillMatrixService
{
/// <summary>
/// 查询人员技能矩阵图列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public PagedInfo<GroupPersonSkillMatrixDto> GetList(GroupPersonSkillMatrixQueryDto parm)
{
var predicate = Expressionable.Create<GroupPersonSkillMatrix>();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage<GroupPersonSkillMatrix, GroupPersonSkillMatrixDto>(parm);
return response;
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public GroupPersonSkillMatrix GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
/// <summary>
/// 添加人员技能矩阵图
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public GroupPersonSkillMatrix AddGroupPersonSkillMatrix(GroupPersonSkillMatrix model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
/// <summary>
/// 修改人员技能矩阵图
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int UpdateGroupPersonSkillMatrix(GroupPersonSkillMatrix model)
{
//var response = Update(w => w.Id == model.Id, it => new GroupPersonSkillMatrix()
//{
// SkillName = model.SkillName,
// Image = model.Image,
// Vedio = model.Vedio,
// Remark = model.Remark,
// Status = model.Status,
// CreatedBy = model.CreatedBy,
// CreatedTime = model.CreatedTime,
// UpdatedBy = model.UpdatedBy,
// UpdatedTime = model.UpdatedTime,
//});
//return response;
return Update(model, true);
}
}
}