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() .AndIF(!string.IsNullOrEmpty(parm.SkillName),it=>it.SkillName.Contains(parm.SkillName)) .AndIF(parm.Status>0,it=>it.Status==parm.Status) ; var response = Queryable() .Where(predicate.ToExpression()) .ToPage(parm); return response; } /// /// 获取详情 /// /// /// public GroupPersonSkill GetInfo(string Id) { var response = Queryable() .Where(x => x.Id == Id) .First(); return response; } /// /// 添加人员技能矩阵图 /// /// /// public GroupPersonSkill AddGroupPersonSkillMatrix(GroupPersonSkill model) { if(string.IsNullOrEmpty(model.Id)) { model.Id = XueHua; } return Context.Insertable(model).ExecuteReturnEntity(); } /// /// 修改人员技能矩阵图 /// /// /// public int UpdateGroupPersonSkillMatrix(GroupPersonSkill model) { //var response = Update(w => w.Id == model.Id, it => new GroupPersonSkill() //{ // 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); } } }