using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using ZR.Model;
using ZR.Model.MES.dev.Dto;
using ZR.Model.MES.dev;
using ZR.Service.MES.dev.IService;
using ZR.Repository;
using System.Linq;
namespace ZR.Service.MES.dev
{
///
/// 巡检/点检任务结果表Service业务层处理
///
[AppService(ServiceType = typeof(IDeviceTaskExecuteResultService), ServiceLifetime = LifeTime.Transient)]
public class DeviceTaskExecuteResultService : BaseService, IDeviceTaskExecuteResultService
{
///
/// 查询巡检/点检任务结果表列表
///
///
///
public PagedInfo GetList(DeviceTaskExecuteResultQueryDto parm)
{
var predicate = Expressionable.Create();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
return response;
}
///
/// 获取详情
///
///
///
public DeviceTaskExecuteResult GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
///
/// 添加巡检/点检任务结果表
///
///
///
public DeviceTaskExecuteResult AddDeviceTaskExecuteResult(DeviceTaskExecuteResult model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
///
/// 修改巡检/点检任务结果表
///
///
///
public int UpdateDeviceTaskExecuteResult(DeviceTaskExecuteResult model)
{
//var response = Update(w => w.Id == model.Id, it => new DeviceTaskExecuteResult1()
//{
// PlanType = model.PlanType,
// PlanName = model.PlanName,
// DeviceName = model.DeviceName,
// InspectName = model.InspectName,
// FormType = model.FormType,
// FormTitle = model.FormTitle,
// FormName = model.FormName,
// Person = model.Person,
// Remark = model.Remark,
// CreatedBy = model.CreatedBy,
// CreatedTime = model.CreatedTime,
// UpdatedBy = model.UpdatedBy,
// UpdatedTime = model.UpdatedTime,
//});
//return response;
return Update(model, true);
}
}
}