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
{
///
/// 人员技能矩阵图Service业务层处理
///
[AppService(ServiceType = typeof(IGroupPersonSkillMatrixService), ServiceLifetime = LifeTime.Transient)]
public class GroupPersonSkillMatrixService : BaseService, IGroupPersonSkillMatrixService
{
///
/// 查询人员技能矩阵图列表
///
///
///
public PagedInfo GetList(GroupPersonSkillMatrixQueryDto parm)
{
var predicate = Expressionable.Create();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
return response;
}
///
/// 获取详情
///
///
///
public GroupPersonSkillMatrix GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
///
/// 添加人员技能矩阵图
///
///
///
public GroupPersonSkillMatrix AddGroupPersonSkillMatrix(GroupPersonSkillMatrix model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
///
/// 修改人员技能矩阵图
///
///
///
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);
}
}
}