Fixed SQL syntax issue in DeviceStatusMonitoring Task when running on PostgreSQL.

revert-70aa11f8
Harshan Liyanage 8 years ago
parent 51c18d2108
commit 8b9420766f

@ -152,7 +152,8 @@ public class OperationMappingDAOImpl implements OperationMappingDAO {
"DM_DEVICE D ON E.DEVICE_ID = D.ID WHERE " + "DM_DEVICE D ON E.DEVICE_ID = D.ID WHERE " +
"OP.STATUS IN ('"+ Operation.Status.PENDING.name() + "','" + Operation.Status.REPEATED.name() + "') " + "OP.STATUS IN ('"+ Operation.Status.PENDING.name() + "','" + Operation.Status.REPEATED.name() + "') " +
"AND OP.CREATED_TIMESTAMP BETWEEN ? AND ? AND E.STATUS IN ('" + EnrolmentInfo.Status.ACTIVE.name() + "AND OP.CREATED_TIMESTAMP BETWEEN ? AND ? AND E.STATUS IN ('" + EnrolmentInfo.Status.ACTIVE.name() +
"','" + EnrolmentInfo.Status.UNREACHABLE.name() + "') AND D.DEVICE_TYPE_ID = ? GROUP BY ENROLMENT_ID"; "','" + EnrolmentInfo.Status.UNREACHABLE.name() + "') AND D.DEVICE_TYPE_ID = ? GROUP BY ENROLMENT_ID," +
" D.DEVICE_IDENTIFICATION, E.STATUS, E.TENANT_ID";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setLong(1, maxDuration); stmt.setLong(1, maxDuration);
stmt.setLong(2, minDuration); stmt.setLong(2, minDuration);

Loading…
Cancel
Save