Adding temporary development code bits for dashboard analytics feature

revert-70aa11f8
dilanua 9 years ago
parent 274aa0ecd3
commit c3bc22519a

@ -42,4 +42,8 @@ public interface GadgetDataService {
@SuppressWarnings("unused") @SuppressWarnings("unused")
int getUnmonitoredDeviceCount(); int getUnmonitoredDeviceCount();
@SuppressWarnings("unused")
Map<String, Integer> getNonCompliantDeviceCountsByFeatures();
} }

@ -89,7 +89,7 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
Map<String, Integer> filteredNonCompliantDeviceCountsByFeatures = new HashMap<>(); Map<String, Integer> filteredNonCompliantDeviceCountsByFeatures = new HashMap<>();
try { try {
con = this.getConnection(); con = this.getConnection();
String sql = "SELECT FEATURE_CODE, COUNT(DEVICE_ID) AS DEVICE_COUNT FROM DEVICES_VIEW_1 " + String sql = "SELECT FEATURE_CODE, COUNT(DEVICE_ID) AS DEVICE_COUNT FROM DEVICES_VIEW_2 " +
"WHERE TENANT_ID = ? GROUP BY FEATURE_CODE"; "WHERE TENANT_ID = ? GROUP BY FEATURE_CODE";
stmt = con.prepareStatement(sql); stmt = con.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);

@ -131,4 +131,19 @@ class GadgetDataServiceImpl implements GadgetDataService {
return unmonitoredDeviceCount; return unmonitoredDeviceCount;
} }
@Override
public Map<String, Integer> getNonCompliantDeviceCountsByFeatures() {
Map<String, Integer> nonCompliantDeviceCountsByFeatures = null;
try {
GadgetDataServiceDAOFactory.openConnection();
nonCompliantDeviceCountsByFeatures =
GadgetDataServiceDAOFactory.getGadgetDataServiceDAO().getNonCompliantDeviceCountsByFeatures();
} catch (GadgetDataServiceDAOException | SQLException e) {
return null;
} finally {
GadgetDataServiceDAOFactory.closeConnection();
}
return nonCompliantDeviceCountsByFeatures;
}
} }

Loading…
Cancel
Save