using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using DOAN.Model;
using DOAN.Repository;
using System.Linq;
using DOAN.Model.MES.mm.line;
using DOAN.Model.MES.mm.line.Dto;
using DOAN.Service.MES.mm.line.IService;
namespace DOAN.Service.MES.mm.line
{
///
/// mm_line_locationService业务层处理
///
[AppService(ServiceType = typeof(IMmLineLocationService), ServiceLifetime = LifeTime.Transient)]
public class MmLineLocationService : BaseService, IMmLineLocationService
{
///
/// 查询mm_line_location列表
///
///
///
public PagedInfo GetList(MmLineLocationQueryDto parm)
{
var predicate = Expressionable.Create().AndIF(!string.IsNullOrEmpty(parm.LineCode), o => o.LineCode == parm.LineCode);
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
return response;
}
///
/// 获取详情
///
///
///
public MmLineLocation GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
///
/// 添加mm_line_location
///
///
///
public MmLineLocation AddMmLineLocation(MmLineLocation model)
{
model.Id = XueHua;
return Context.Insertable(model).ExecuteReturnEntity();
}
///
/// 修改mm_line_location
///
///
///
public int UpdateMmLineLocation(MmLineLocation model)
{
//var response = Update(w => w.Id == model.Id, it => new MmLineLocation()
//{
// LocationName = model.LocationName,
// LocationCode = model.LocationCode,
// Linecode = model.Linecode,
// Description = model.Description,
// Capacity = model.Capacity,
// Status = model.Status,
//});
//return response;
return Update(model, true);
}
}
}