|
|
@ -589,8 +589,11 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
|
|
|
|
"e.DEVICE_IDENTIFICATION AS DEVICE_IDENTIFICATION " +
|
|
|
|
"e.DEVICE_IDENTIFICATION AS DEVICE_IDENTIFICATION " +
|
|
|
|
"FROM DM_ENROLMENT e " +
|
|
|
|
"FROM DM_ENROLMENT e " +
|
|
|
|
"JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " +
|
|
|
|
"JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " +
|
|
|
|
"WHERE e.OWNER = ? AND e.TENANT_ID = ? AND d.DEVICE_TYPE_ID = ? AND e.STATUS IN (" + deviceFilters + ")");
|
|
|
|
"WHERE e.OWNER = ? AND e.TENANT_ID = ? AND e.STATUS IN (" + deviceFilters + ")");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (deviceTypeId != 0) {
|
|
|
|
|
|
|
|
sql.append(" AND d.DEVICE_TYPE_ID = ?");
|
|
|
|
|
|
|
|
}
|
|
|
|
if (deviceOwner != null && !deviceOwner.isEmpty()) {
|
|
|
|
if (deviceOwner != null && !deviceOwner.isEmpty()) {
|
|
|
|
sql.append(" AND e.OWNER LIKE ?");
|
|
|
|
sql.append(" AND e.OWNER LIKE ?");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -607,10 +610,12 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
|
|
|
|
int index = 1;
|
|
|
|
int index = 1;
|
|
|
|
stmt.setString(index++, owner);
|
|
|
|
stmt.setString(index++, owner);
|
|
|
|
stmt.setInt(index++, tenantId);
|
|
|
|
stmt.setInt(index++, tenantId);
|
|
|
|
stmt.setInt(index++, deviceTypeId);
|
|
|
|
|
|
|
|
for (String status : allowingDeviceStatuses) {
|
|
|
|
for (String status : allowingDeviceStatuses) {
|
|
|
|
stmt.setString(index++, status);
|
|
|
|
stmt.setString(index++, status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (deviceTypeId != 0) {
|
|
|
|
|
|
|
|
stmt.setInt(index++, deviceTypeId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (deviceOwner != null && !deviceOwner.isEmpty()) {
|
|
|
|
if (deviceOwner != null && !deviceOwner.isEmpty()) {
|
|
|
|
stmt.setString(index++, "%" + deviceOwner + "%");
|
|
|
|
stmt.setString(index++, "%" + deviceOwner + "%");
|
|
|
|