Merge branch 'report-managment' into 'master'

Fix duplicate result issue by adding missing conditions

See merge request entgra/carbon-device-mgt!458
feature/appm-store/pbac
Dharmakeerthi Lasantha 5 years ago
commit 257e8d961f

@ -899,6 +899,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " + ") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " + "WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " + "AND d1.DEVICE_ID = ddi.DEVICE_ID " +
"AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? "; "AND ddi.KEY_FIELD = ? ";
if (dataSourceType.contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_H2)) { if (dataSourceType.contains(DeviceManagementConstants.DataBaseTypes.DB_TYPE_H2)) {
sql += "AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? "; sql += "AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? ";

@ -865,6 +865,7 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " + ") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " + "WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " + "AND d1.DEVICE_ID = ddi.DEVICE_ID " +
"AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? " + "AND ddi.KEY_FIELD = ? " +
"AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " + "AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " +
"ORDER BY ENROLMENT_ID " + "ORDER BY ENROLMENT_ID " +

@ -851,6 +851,7 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " + ") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " + "WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " + "AND d1.DEVICE_ID = ddi.DEVICE_ID " +
"AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? " + "AND ddi.KEY_FIELD = ? " +
"AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " + "AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " +
"LIMIT ? OFFSET ?"; "LIMIT ? OFFSET ?";

@ -667,6 +667,7 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
") d1 " + ") d1 " +
"WHERE d1.DEVICE_ID = e.DEVICE_ID " + "WHERE d1.DEVICE_ID = e.DEVICE_ID " +
"AND d1.DEVICE_ID = ddi.DEVICE_ID " + "AND d1.DEVICE_ID = ddi.DEVICE_ID " +
"AND d1.DEVICE_ID = ddd.DEVICE_ID " +
"AND ddi.KEY_FIELD = ? " + "AND ddi.KEY_FIELD = ? " +
"AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " + "AND CAST( ddi.VALUE_FIELD AS BIGINT ) < ? " +
"LIMIT ? OFFSET ?"; "LIMIT ? OFFSET ?";

Loading…
Cancel
Save