using Infrastructure.Attribute;
using SqlSugar;
using ZR.Model;
using ZR.Model.dc;
using ZR.Model.Dto;
using ZR.Repository;
using ZR.Service.MES.dc.IService;
namespace ZR.Service.Business
{
///
/// Service业务层处理
///
[AppService(ServiceType = typeof(IDeviceUploadDataService), ServiceLifetime = LifeTime.Transient)]
public class DeviceUploadDataService : BaseService, IDeviceUploadDataService
{
///
/// 查询列表
///
///
///
public PagedInfo GetList(DeviceUploadDataQueryDto parm)
{
var predicate = Expressionable.Create();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
return response;
}
///
/// 获取详情
///
///
///
public DeviceUploadData GetInfo(long Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
///
/// 添加
///
///
///
public DeviceUploadData AddDeviceUploadData(DeviceUploadData model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
///
/// 修改
///
///
///
public int UpdateDeviceUploadData(DeviceUploadData model)
{
//var response = Update(w => w.Id == model.Id, it => new DeviceUploadData()
//{
// FactoryCode = model.FactoryCode,
// WorkshopCode = model.WorkshopCode,
// LineCode = model.LineCode,
// DeviceCode = model.DeviceCode,
// DictCode = model.DictCode,
// Remark = model.Remark,
// Value01 = model.Value01,
// Value02 = model.Value02,
// Value03 = model.Value03,
// Value04 = model.Value04,
// Value05 = model.Value05,
// Value06 = model.Value06,
// Value07 = model.Value07,
// Value08 = model.Value08,
// Value09 = model.Value09,
// Value10 = model.Value10,
//});
//return response;
return Update(model, true);
}
}
}