80 lines
2.6 KiB
C#
80 lines
2.6 KiB
C#
using Infrastructure.Attribute;
|
|
using Mapster;
|
|
using SqlSugar;
|
|
using ZR.Model;
|
|
using ZR.Model.MES.andon;
|
|
using ZR.Model.MES.andon.Dto;
|
|
using ZR.Repository;
|
|
using ZR.Service.mes.andon.Iservice;
|
|
|
|
namespace ZR.Service.mes.andon
|
|
{
|
|
/// <summary>
|
|
/// 安灯报警联系人手表IP字典Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IAndonAlarmReceiverWatchDicService), ServiceLifetime = LifeTime.Transient)]
|
|
public class AndonAlarmReceiverWatchDicService : BaseService<AndonAlarmReceiverWatchDic>, IAndonAlarmReceiverWatchDicService
|
|
{
|
|
/// <summary>
|
|
/// 查询安灯报警联系人手表IP字典列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<AndonAlarmReceiverWatchDicDto> GetList(AndonAlarmReceiverWatchDicQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<AndonAlarmReceiverWatchDic>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<AndonAlarmReceiverWatchDic, AndonAlarmReceiverWatchDicDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public AndonAlarmReceiverWatchDic GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加安灯报警联系人手表IP字典
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public AndonAlarmReceiverWatchDic AddAndonAlarmReceiverWatchDic(AndonAlarmReceiverWatchDic model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改安灯报警联系人手表IP字典
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateAndonAlarmReceiverWatchDic(AndonAlarmReceiverWatchDic model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new AndonAlarmReceiverWatchDic()
|
|
//{
|
|
// Receivername = model.Receivername,
|
|
// Watchip = model.Watchip,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |