|
|
|
@ -1372,19 +1372,18 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|
|
|
|
throws OperationManagementDAOException {
|
|
|
|
|
Operation operation;
|
|
|
|
|
List<Operation> operations = new ArrayList<>();
|
|
|
|
|
String createdTo = null;
|
|
|
|
|
String createdFrom = null;
|
|
|
|
|
Long createdTo = null;
|
|
|
|
|
Long createdFrom = null;
|
|
|
|
|
ProfileOperation profileOperation = null;
|
|
|
|
|
DateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
|
|
|
boolean isCreatedDayProvided = false;
|
|
|
|
|
boolean isUpdatedDayProvided = false; //updated day = received day
|
|
|
|
|
boolean isOperationCodeProvided = false;
|
|
|
|
|
boolean isStatusProvided = false;
|
|
|
|
|
if (request.getOperationLogFilters().getCreatedDayFrom() != null) {
|
|
|
|
|
createdFrom = simple.format(request.getOperationLogFilters().getCreatedDayFrom());
|
|
|
|
|
createdFrom = request.getOperationLogFilters().getCreatedDayFrom();
|
|
|
|
|
}
|
|
|
|
|
if (request.getOperationLogFilters().getCreatedDayTo() != null) {
|
|
|
|
|
createdTo = simple.format(request.getOperationLogFilters().getCreatedDayTo());
|
|
|
|
|
createdTo = request.getOperationLogFilters().getCreatedDayTo();
|
|
|
|
|
}
|
|
|
|
|
Long updatedFrom = request.getOperationLogFilters().getUpdatedDayFrom();
|
|
|
|
|
Long updatedTo = request.getOperationLogFilters().getUpdatedDayTo();
|
|
|
|
@ -1419,7 +1418,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|
|
|
|
isUpdatedDayProvided = true;
|
|
|
|
|
}
|
|
|
|
|
sql.append(") om ON o.ID = om.OPERATION_ID ");
|
|
|
|
|
if (createdFrom != null && !createdFrom.isEmpty() && createdTo != null && !createdTo.isEmpty()) {
|
|
|
|
|
if (createdFrom != null && createdFrom != 0 && createdTo != null && createdTo != 0) {
|
|
|
|
|
sql.append(" WHERE o.CREATED_TIMESTAMP BETWEEN ? AND ?");
|
|
|
|
|
isCreatedDayProvided = true;
|
|
|
|
|
}
|
|
|
|
@ -1468,8 +1467,8 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|
|
|
|
stmt.setLong(paramIndex++, updatedTo);
|
|
|
|
|
}
|
|
|
|
|
if (isCreatedDayProvided) {
|
|
|
|
|
stmt.setString(paramIndex++, createdFrom);
|
|
|
|
|
stmt.setString(paramIndex++, createdTo);
|
|
|
|
|
stmt.setLong(paramIndex++, createdFrom);
|
|
|
|
|
stmt.setLong(paramIndex++, createdTo);
|
|
|
|
|
}
|
|
|
|
|
if (isStatusProvided) {
|
|
|
|
|
for (String s : status) {
|
|
|
|
@ -1643,14 +1642,13 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|
|
|
|
@Override
|
|
|
|
|
public int getOperationCountForDevice(int enrolmentId, PaginationRequest request)
|
|
|
|
|
throws OperationManagementDAOException {
|
|
|
|
|
String createdTo = null;
|
|
|
|
|
String createdFrom = null;
|
|
|
|
|
DateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
|
|
|
Long createdTo = null;
|
|
|
|
|
Long createdFrom = null;
|
|
|
|
|
if (request.getOperationLogFilters().getCreatedDayFrom() != null) {
|
|
|
|
|
createdFrom = simple.format(request.getOperationLogFilters().getCreatedDayFrom());
|
|
|
|
|
createdFrom = request.getOperationLogFilters().getCreatedDayFrom();
|
|
|
|
|
}
|
|
|
|
|
if (request.getOperationLogFilters().getCreatedDayTo() != null) {
|
|
|
|
|
createdTo = simple.format(request.getOperationLogFilters().getCreatedDayTo());
|
|
|
|
|
createdTo = request.getOperationLogFilters().getCreatedDayTo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Long updatedFrom = request.getOperationLogFilters().getUpdatedDayFrom();
|
|
|
|
@ -1681,7 +1679,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|
|
|
|
isUpdatedDayProvided = true;
|
|
|
|
|
}
|
|
|
|
|
sql += ") om ON o.ID = om.OPERATION_ID ";
|
|
|
|
|
if (createdFrom != null && !createdFrom.isEmpty() && createdTo != null && !createdTo.isEmpty()) {
|
|
|
|
|
if (createdFrom != null && createdFrom != 0 && createdTo != null && createdTo != 0) {
|
|
|
|
|
sql += " WHERE o.CREATED_TIMESTAMP BETWEEN ? AND ?";
|
|
|
|
|
isCreatedDayProvided = true;
|
|
|
|
|
}
|
|
|
|
@ -1717,8 +1715,8 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|
|
|
|
stmt.setLong(paramIndex++, updatedTo);
|
|
|
|
|
}
|
|
|
|
|
if (isCreatedDayProvided) {
|
|
|
|
|
stmt.setString(paramIndex++, createdFrom);
|
|
|
|
|
stmt.setString(paramIndex++, createdTo);
|
|
|
|
|
stmt.setLong(paramIndex++, createdFrom);
|
|
|
|
|
stmt.setLong(paramIndex++, createdTo);
|
|
|
|
|
}
|
|
|
|
|
if (isStatusProvided) {
|
|
|
|
|
for (String s : status) {
|
|
|
|
|