Browse Source

获取巡检记录接口

master
xincheng 2 years ago
parent
commit
3741b9b36d
  1. 4
      api/app/lib/controllers/patrolRecord/patrolRecord.js

4
api/app/lib/controllers/patrolRecord/patrolRecord.js

@ -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(',') } },

Loading…
Cancel
Save