|
@ -9,7 +9,7 @@ async function findPatrolRecord (ctx, next) { |
|
|
// patrolPlanId传all查所有
|
|
|
// patrolPlanId传all查所有
|
|
|
if (patrolPlanId == 'all') { |
|
|
if (patrolPlanId == 'all') { |
|
|
/* 如果有startTime && endTime,查询所有符合条件的数据 */ |
|
|
/* 如果有startTime && endTime,查询所有符合条件的数据 */ |
|
|
if (startTime && endTime) { |
|
|
if (startTime !== 'null' && endTime !== 'null') { |
|
|
if (pointId) { |
|
|
if (pointId) { |
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
where: { alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } }, |
|
|
where: { alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } }, |
|
@ -32,7 +32,7 @@ async function findPatrolRecord (ctx, next) { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if (startTime && endTime) { |
|
|
if (startTime !== 'null' && endTime !== 'null') { |
|
|
if (pointId) { |
|
|
if (pointId) { |
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
where: { patrolPlanId: { $in: patrolPlanId.split(',') }, alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } }, |
|
|
where: { patrolPlanId: { $in: patrolPlanId.split(',') }, alarm, inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } }, |
|
|