mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'group-unassigned-device' into 'master'
Generate ungrouped device report to a specific device type Closes product-iots#486 See merge request entgra/carbon-device-mgt!513
This commit is contained in:
commit
81e5fc24fb
@ -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…
Reference in New Issue
Block a user