mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request 'Fix search by user in device listing page' (#133) from osh.silva/device-mgt-core:search-10113 into master
Reviewed-on: https://repository.entgra.net/community/device-mgt-core/pulls/133
This commit is contained in:
commit
f277f77fa9
@ -1323,7 +1323,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
|
||||
}
|
||||
//Add the query for owner
|
||||
if (owner != null && !owner.isEmpty()) {
|
||||
sql = sql + " AND e.OWNER = ?";
|
||||
sql = sql + " AND e.OWNER LIKE ?";
|
||||
isOwnerProvided = true;
|
||||
} else if (ownerPattern != null && !ownerPattern.isEmpty()) {
|
||||
sql = sql + " AND e.OWNER LIKE ?";
|
||||
@ -1351,7 +1351,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO {
|
||||
stmt.setString(paramIdx++, request.getOwnership());
|
||||
}
|
||||
if (isOwnerProvided) {
|
||||
stmt.setString(paramIdx++, owner);
|
||||
stmt.setString(paramIdx++, "%" + owner + "%");
|
||||
} else if (isOwnerPatternProvided) {
|
||||
stmt.setString(paramIdx++, ownerPattern + "%");
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
}
|
||||
//Add the query for owner
|
||||
if (owner != null && !owner.isEmpty()) {
|
||||
sql = sql + " AND e.OWNER = ?";
|
||||
sql = sql + " AND e.OWNER LIKE ?";
|
||||
isOwnerProvided = true;
|
||||
} else if (ownerPattern != null && !ownerPattern.isEmpty()) {
|
||||
sql = sql + " AND e.OWNER LIKE ?";
|
||||
@ -158,7 +158,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
stmt.setString(paramIdx++, ownership);
|
||||
}
|
||||
if (isOwnerProvided) {
|
||||
stmt.setString(paramIdx++, owner);
|
||||
stmt.setString(paramIdx++, "%" + owner + "%");
|
||||
} else if (isOwnerPatternProvided) {
|
||||
stmt.setString(paramIdx++, ownerPattern + "%");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user