|
|
@ -97,7 +97,7 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
|
|
|
"WHERE DEVICE_TYPE_ID = t.ID " +
|
|
|
|
"WHERE DEVICE_TYPE_ID = t.ID " +
|
|
|
|
"AND d.ID= i.DEVICE_ID " +
|
|
|
|
"AND d.ID= i.DEVICE_ID " +
|
|
|
|
"AND i.KEY_FIELD = 'serial' " +
|
|
|
|
"AND i.KEY_FIELD = 'serial' " +
|
|
|
|
"AND i.VALUE_FIELD = ? " +
|
|
|
|
"AND i.VALUE_FIELD LIKE ? " +
|
|
|
|
"AND d.TENANT_ID = ? ";
|
|
|
|
"AND d.TENANT_ID = ? ";
|
|
|
|
isSerialProvided = true;
|
|
|
|
isSerialProvided = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -136,7 +136,7 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
int paramIdx = 1;
|
|
|
|
int paramIdx = 1;
|
|
|
|
if (isSerialProvided) {
|
|
|
|
if (isSerialProvided) {
|
|
|
|
stmt.setString(paramIdx++, serial);
|
|
|
|
stmt.setString(paramIdx++, "%" + serial + "%");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stmt.setInt(paramIdx++, tenantId);
|
|
|
|
stmt.setInt(paramIdx++, tenantId);
|
|
|
|
if (isDeviceTypeProvided) {
|
|
|
|
if (isDeviceTypeProvided) {
|
|
|
|