Generate ungrouped device report to a specific device type

merge-requests/516/head
Vinojini Paramasivam 5 years ago committed by Dharmakeerthi Lasantha
parent 4fccb02631
commit d01f05e51f

@ -837,7 +837,9 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
"ENROLMENT.STATUS " + "ENROLMENT.STATUS " +
"FROM DM_DEVICE AS DEVICE, DM_DEVICE_TYPE AS DEVICE_TYPE, DM_ENROLMENT " + "FROM DM_DEVICE AS DEVICE, DM_DEVICE_TYPE AS DEVICE_TYPE, DM_ENROLMENT " +
"AS ENROLMENT " + "AS ENROLMENT " +
"WHERE DEVICE.ID NOT IN " + "WHERE DEVICE_TYPE.NAME = ? AND DEVICE" +
".ID " +
"NOT IN " +
"(SELECT DEVICE_ID " + "(SELECT DEVICE_ID " +
"FROM DM_DEVICE_GROUP_MAP " + "FROM DM_DEVICE_GROUP_MAP " +
"WHERE GROUP_ID IN (SELECT ID FROM DM_GROUP WHERE GROUP_NAME NOT IN (", "WHERE GROUP_ID IN (SELECT ID FROM DM_GROUP WHERE GROUP_NAME NOT IN (",
@ -846,6 +848,7 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
groupNames.stream().map(e -> "?").forEach(sql::add); groupNames.stream().map(e -> "?").forEach(sql::add);
try (PreparedStatement stmt = connection.prepareStatement(String.valueOf(sql))) { try (PreparedStatement stmt = connection.prepareStatement(String.valueOf(sql))) {
int index = 1; int index = 1;
stmt.setString(index++, paginationRequest.getDeviceType());
for (String groupName : groupNames) { for (String groupName : groupNames) {
stmt.setString(index++, groupName); stmt.setString(index++, groupName);
} }

Loading…
Cancel
Save