Fix search by user

fixes https://roadmap.entgra.net/issues/10113
temp-changes
osh 1 year ago
parent 2cf7cf8705
commit 96e3c3f0e0

@ -1323,7 +1323,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
} }
//Add the query for owner //Add the query for owner
if (owner != null && !owner.isEmpty()) { if (owner != null && !owner.isEmpty()) {
sql = sql + " AND e.OWNER = ?"; sql = sql + " AND e.OWNER LIKE ?";
isOwnerProvided = true; isOwnerProvided = true;
} else if (ownerPattern != null && !ownerPattern.isEmpty()) { } else if (ownerPattern != null && !ownerPattern.isEmpty()) {
sql = sql + " AND e.OWNER LIKE ?"; sql = sql + " AND e.OWNER LIKE ?";
@ -1351,7 +1351,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
stmt.setString(paramIdx++, request.getOwnership()); stmt.setString(paramIdx++, request.getOwnership());
} }
if (isOwnerProvided) { if (isOwnerProvided) {
stmt.setString(paramIdx++, owner); stmt.setString(paramIdx++, "%" + owner + "%");
} else if (isOwnerPatternProvided) { } else if (isOwnerPatternProvided) {
stmt.setString(paramIdx++, ownerPattern + "%"); stmt.setString(paramIdx++, ownerPattern + "%");
} }

@ -126,7 +126,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
} }
//Add the query for owner //Add the query for owner
if (owner != null && !owner.isEmpty()) { if (owner != null && !owner.isEmpty()) {
sql = sql + " AND e.OWNER = ?"; sql = sql + " AND e.OWNER LIKE ?";
isOwnerProvided = true; isOwnerProvided = true;
} else if (ownerPattern != null && !ownerPattern.isEmpty()) { } else if (ownerPattern != null && !ownerPattern.isEmpty()) {
sql = sql + " AND e.OWNER LIKE ?"; sql = sql + " AND e.OWNER LIKE ?";
@ -158,7 +158,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
stmt.setString(paramIdx++, ownership); stmt.setString(paramIdx++, ownership);
} }
if (isOwnerProvided) { if (isOwnerProvided) {
stmt.setString(paramIdx++, owner); stmt.setString(paramIdx++, "%" + owner + "%");
} else if (isOwnerPatternProvided) { } else if (isOwnerPatternProvided) {
stmt.setString(paramIdx++, ownerPattern + "%"); stmt.setString(paramIdx++, ownerPattern + "%");
} }

Loading…
Cancel
Save