From 29d6b38d1530b37d3b1f420fe92acf1f36d04c85 Mon Sep 17 00:00:00 2001 From: Chatura Dilan Perera Date: Mon, 29 Aug 2016 13:57:32 +0530 Subject: [PATCH] Fixed issue in activity getting with response --- .../mgt/dao/impl/GenericOperationDAOImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index 173215e31a..9396124390 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -409,14 +409,15 @@ public class GenericOperationDAOImpl implements OperationDAO { String sql = "SELECT opm.ENROLMENT_ID, opm.CREATED_TIMESTAMP, opm.UPDATED_TIMESTAMP, opm.OPERATION_ID,\n" + "op.OPERATION_CODE, op.TYPE as OPERATION_TYPE, opm.STATUS, en.DEVICE_ID,\n" + - "op.RECEIVED_TIMESTAMP, ops.ID as OP_RES_ID, ops.OPERATION_RESPONSE,\n" + + "ops.RECEIVED_TIMESTAMP, ops.ID as OP_RES_ID, ops.OPERATION_RESPONSE,\n" + "de.DEVICE_IDENTIFICATION, dt.NAME as DEVICE_TYPE\n" + "FROM DM_ENROLMENT_OP_MAPPING AS opm\n" + - "LEFT JOIN DM_OPERATION AS op ON opm.OPERATION_ID = op.ID\n" + - "LEFT JOIN DM_ENROLMENT as en ON opm.ENROLMENT_ID = en.ID\n" + - "LEFT JOIN DM_DEVICE as de ON en.DEVICE_ID = de.ID\n" + - "LEFT JOIN DM_DEVICE_TYPE as dt ON dt.ID = de.DEVICE_TYPE_ID\n" + - "LEFT JOIN DM_DEVICE_OPERATION_RESPONSE as ops ON ops.ID = opm.OPERATION_ID\n" + + "LEFT JOIN DM_OPERATION AS op ON opm.OPERATION_ID = op.ID \n" + + "LEFT JOIN DM_ENROLMENT as en ON opm.ENROLMENT_ID = en.ID \n" + + "LEFT JOIN DM_DEVICE as de ON en.DEVICE_ID = de.ID \n" + + "LEFT JOIN DM_DEVICE_TYPE as dt ON dt.ID = de.DEVICE_TYPE_ID \n" + + "LEFT JOIN DM_DEVICE_OPERATION_RESPONSE as ops ON \n" + + "opm.ENROLMENT_ID = opm.ENROLMENT_ID AND opm.OPERATION_ID = ops.OPERATION_ID \n" + "WHERE opm.UPDATED_TIMESTAMP > ? \n" + "AND de.TENANT_ID = ? \n";