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