|
@ -11,14 +11,26 @@ async function findPatrolRecord (ctx, next) { |
|
|
/* 如果有startTime && endTime,查询所有符合条件的数据 */ |
|
|
/* 如果有startTime && endTime,查询所有符合条件的数据 */ |
|
|
if (startTime !== 'null' && endTime !== 'null') { |
|
|
if (startTime !== 'null' && endTime !== 'null') { |
|
|
if (pointId) { |
|
|
if (pointId) { |
|
|
|
|
|
if (alarm == 'null') { |
|
|
|
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
|
|
|
where: { inspectionTime: { $between: [startTime, endTime] }, pointId: { $in: pointId.split(',') } }, |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
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(',') } }, |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
if (alarm == 'null') { |
|
|
|
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
|
|
|
where: { inspectionTime: { $between: [startTime, endTime] } }, |
|
|
|
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
rslt = await models.PatrolRecord.findAll({ |
|
|
where: { alarm, inspectionTime: { $between: [startTime, endTime] } }, |
|
|
where: { alarm, inspectionTime: { $between: [startTime, endTime] } }, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
/* 如果没有startTime && endTime,查询每个点位最新一条符合条件的数据 */ |
|
|
/* 如果没有startTime && endTime,查询每个点位最新一条符合条件的数据 */ |
|
|
let a = [] |
|
|
let a = [] |
|
|