点检修改
This commit is contained in:
parent
1e085a3833
commit
a587eb8d7c
@ -99,6 +99,35 @@ namespace ZR.Service.MES.dev
|
||||
|
||||
}
|
||||
|
||||
public PagedInfo<DeviceAccountDto> GetList_Point(DeviceAccountQueryDto3 parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<DeviceAccount, DeviceRelPpAt>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.DeviceName), (a, r) => a.DeviceName.Contains(parm.DeviceName))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.DeviceSpecification), (a, r) => a.DeviceSpecification.Contains(parm.DeviceSpecification))
|
||||
.And((a, r) => a.Status == 1)
|
||||
.AndIF(parm.FkDeviceType > 0, (a, r) => a.FkDeviceType == parm.FkDeviceType)
|
||||
.And((a, r) => r.FkPointInspectionPlanId == parm.fkPointInspectionPlanId)
|
||||
;
|
||||
|
||||
|
||||
var temp = Context.Queryable<DeviceAccount>()
|
||||
.LeftJoin<DeviceRelPpAt>((a, r) => a.Id == r.FkDeviceAccountId)
|
||||
.Where(predicate.ToExpression()).Select((a, r) => a);
|
||||
|
||||
|
||||
if (parm.Flag == 0)
|
||||
{
|
||||
int[] exist = temp.Select(a => a.Id).ToArray();
|
||||
temp = Context.Queryable<DeviceAccount>().Where(it => !exist.Contains(it.Id)).Distinct();
|
||||
}
|
||||
|
||||
|
||||
var reponse = temp
|
||||
.ToPage<DeviceAccount, DeviceAccountDto>(parm);
|
||||
|
||||
return reponse;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
@ -238,28 +267,7 @@ namespace ZR.Service.MES.dev
|
||||
}
|
||||
|
||||
#region 点检和设备绑定关系
|
||||
public PagedInfo<DeviceAccountDto> GetList_Point(DeviceAccountQueryDto3 parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<DeviceAccount, DeviceRelPpAt>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.DeviceName), (a, r) => a.DeviceName.Contains(parm.DeviceName))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.DeviceSpecification), (a, r) => a.DeviceSpecification.Contains(parm.DeviceSpecification))
|
||||
.And((a, r) => a.Status == 1)
|
||||
.AndIF(parm.FkDeviceType > 0, (a, r) => a.FkDeviceType == parm.FkDeviceType)
|
||||
.AndIF(parm.Flag == 1, (a, r) => r.FkPointInspectionPlanId == parm.fkPointInspectionPlanId)
|
||||
.AndIF(parm.Flag == 0, (a, r) => r.FkPointInspectionPlanId != parm.fkPointInspectionPlanId || r.FkPointInspectionPlanId == null)
|
||||
;
|
||||
|
||||
|
||||
var response = Context.Queryable<DeviceAccount>()
|
||||
.LeftJoin<DeviceRelPpAt>((a, r) => a.Id == r.FkDeviceAccountId)
|
||||
.Where(predicate.ToExpression())
|
||||
.Select((a, r) => a)
|
||||
.ToPage<DeviceAccount, DeviceAccountDto>(parm);
|
||||
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加绑定关系 巡检计划和设备台账
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user