Fix search by middle part of the username is not working in uninstall table in app store

notification-11094
Lasantha Dharmakeerthi 3 months ago
commit 470f9c52a3

@ -1365,7 +1365,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
query += " AND i.VALUE_FIELD LIKE ?" ; query += " AND i.VALUE_FIELD LIKE ?" ;
} }
if (user != null && !user.isEmpty()) { if (user != null && !user.isEmpty()) {
query += " AND e.OWNER = ?"; query += " AND e.OWNER LIKE ?";
isOwnerProvided = true; isOwnerProvided = true;
} }
if (status != null && !status.isEmpty()) { if (status != null && !status.isEmpty()) {
@ -1395,7 +1395,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
ps.setString(index++, EnrolmentInfo.Status.REMOVED.toString()); ps.setString(index++, EnrolmentInfo.Status.REMOVED.toString());
ps.setString(index++, EnrolmentInfo.Status.DELETED.toString()); ps.setString(index++, EnrolmentInfo.Status.DELETED.toString());
if (isDeviceNameProvided) { if (isDeviceNameProvided) {
ps.setString(index++, name + "%"); ps.setString(index++, "%" + name + "%");
} }
if (isOwnershipProvided) { if (isOwnershipProvided) {
ps.setString(index++, ownership); ps.setString(index++, ownership);
@ -1404,7 +1404,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
ps.setString(index++, "%" + serial + "%"); ps.setString(index++, "%" + serial + "%");
} }
if (isOwnerProvided) { if (isOwnerProvided) {
ps.setString(index++, user); ps.setString(index++, "%" + user + "%");
} }
if (isStatusProvided) { if (isStatusProvided) {
for (String deviceStatus : status) { for (String deviceStatus : status) {

@ -1105,7 +1105,7 @@ public class PostgreSQLDeviceDAOImpl extends GenericDeviceDAOImpl {
isOwnershipProvided = true; isOwnershipProvided = true;
} }
if (user != null && !user.isEmpty()) { if (user != null && !user.isEmpty()) {
query += " AND e.OWNER = ?"; query += " AND e.OWNER LIKE ?";
isOwnerProvided = true; isOwnerProvided = true;
} }
if (status != null && !status.isEmpty()) { if (status != null && !status.isEmpty()) {
@ -1136,13 +1136,13 @@ public class PostgreSQLDeviceDAOImpl extends GenericDeviceDAOImpl {
ps.setString(index++, EnrolmentInfo.Status.REMOVED.toString()); ps.setString(index++, EnrolmentInfo.Status.REMOVED.toString());
ps.setString(index++, EnrolmentInfo.Status.DELETED.toString()); ps.setString(index++, EnrolmentInfo.Status.DELETED.toString());
if (isDeviceNameProvided) { if (isDeviceNameProvided) {
ps.setString(index++, name + "%"); ps.setString(index++, "%" + name + "%");
} }
if (isOwnershipProvided) { if (isOwnershipProvided) {
ps.setString(index++, ownership); ps.setString(index++, ownership);
} }
if (isOwnerProvided) { if (isOwnerProvided) {
ps.setString(index++, user); ps.setString(index++, "%" + user + "%");
} }
if (isStatusProvided) { if (isStatusProvided) {
for (String deviceStatus : status) { for (String deviceStatus : status) {

@ -977,7 +977,7 @@ public class SQLServerDeviceDAOImpl extends GenericDeviceDAOImpl {
isOwnershipProvided = true; isOwnershipProvided = true;
} }
if (user != null && !user.isEmpty()) { if (user != null && !user.isEmpty()) {
query += " AND e.OWNER = ?"; query += " AND e.OWNER LIKE ?";
isOwnerProvided = true; isOwnerProvided = true;
} }
if (status != null && !status.isEmpty()) { if (status != null && !status.isEmpty()) {
@ -1008,13 +1008,13 @@ public class SQLServerDeviceDAOImpl extends GenericDeviceDAOImpl {
ps.setString(index++, EnrolmentInfo.Status.REMOVED.toString()); ps.setString(index++, EnrolmentInfo.Status.REMOVED.toString());
ps.setString(index++, EnrolmentInfo.Status.DELETED.toString()); ps.setString(index++, EnrolmentInfo.Status.DELETED.toString());
if (isDeviceNameProvided) { if (isDeviceNameProvided) {
ps.setString(index++, name + "%"); ps.setString(index++, "%" + name + "%");
} }
if (isOwnershipProvided) { if (isOwnershipProvided) {
ps.setString(index++, ownership); ps.setString(index++, ownership);
} }
if (isOwnerProvided) { if (isOwnerProvided) {
ps.setString(index++, user); ps.setString(index++, "%" + user + "%");
} }
if (isStatusProvided) { if (isStatusProvided) {
for (String deviceStatus : status) { for (String deviceStatus : status) {

Loading…
Cancel
Save