Index: src/main/java/com/napa/pulse/service/impl/ExportServiceImpl.java =================================================================== diff -u -r0f45a53cb744c1fe4d4576c4aed4f5e0fb43cf8d -r6a3d644e29aee5b07e8d8d8f16a5d4e79e956951 --- src/main/java/com/napa/pulse/service/impl/ExportServiceImpl.java (.../ExportServiceImpl.java) (revision 0f45a53cb744c1fe4d4576c4aed4f5e0fb43cf8d) +++ src/main/java/com/napa/pulse/service/impl/ExportServiceImpl.java (.../ExportServiceImpl.java) (revision 6a3d644e29aee5b07e8d8d8f16a5d4e79e956951) @@ -1378,7 +1378,7 @@ sql += "and ssp.product_id in (Select sp.product_id from STORE_SALES_ROLLUP_NEW sp where sp.dc_site_id = " + " (select s.site_id from site s where s.site_type_code='DC' " + " and s.product_availability_id= (select product_availability_id from site where site_id=ssp.site_id))" + - " and sp.SALES_LAST_12_MONTHS BETWEEN "+skuTableWidgetData.getDcWideSalesMin() + + " and nvl(sp.SALES_LAST_12_MONTHS,0) BETWEEN "+skuTableWidgetData.getDcWideSalesMin() + "AND "+ skuTableWidgetData.getDcWideSalesMax() +" )"; } else if (skuTableWidgetData.getDcWideSalesMax() != null && skuTableWidgetData.getDcWideSalesMin() == null) { @@ -1401,7 +1401,7 @@ sql += "and ssp.product_id in (Select sp.product_id from STORE_SALES_ROLLUP_NEW sp where sp.dc_site_id = " + " (select s.site_id from site s where s.site_type_code='DC' " + " and s.product_availability_id= (select product_availability_id from site where site_id=ssp.site_id))" + - " and sp.SALES_LAST_24_MONTHS BETWEEN "+skuTableWidgetData.getDcWideSalesMin() + + " and nvl(sp.SALES_LAST_24_MONTHS,0) BETWEEN "+skuTableWidgetData.getDcWideSalesMin() + "AND "+ skuTableWidgetData.getDcWideSalesMax() +" )"; } else if (skuTableWidgetData.getDcWideSalesMax() != null && skuTableWidgetData.getDcWideSalesMin() == null) { sql += "and ssp.product_id in (Select sp.product_id from STORE_SALES_ROLLUP_NEW sp where sp.dc_site_id = " + @@ -1429,20 +1429,20 @@ if (skuTableWidgetData.getHubDemandMin() != null && skuTableWidgetData.getHubDemandMax() != null && skuTableWidgetData.getHubDemandMax() >= skuTableWidgetData.getHubDemandMin()) { sql += " AND ssp.product_id IN ( SELECT hdr.product_id FROM hsn_demand_rollup hdr " + " WHERE hdr.hsn_network_id in(select hsn_network_id from hub_spoke_network_mapping where is_active=1 and ssp.site_id=hsn_site_id) " + - " AND hdr.demand_12 BETWEEN "+skuTableWidgetData.getHubDemandMin() + + " AND nvl(hdr.demand_12,0) BETWEEN "+skuTableWidgetData.getHubDemandMin() + " AND "+ skuTableWidgetData.getHubDemandMax() +" ) "; } else if (skuTableWidgetData.getHubDemandMax() != null && skuTableWidgetData.getHubDemandMin() == null) { sql += " AND ssp.product_id IN ( SELECT hdr.product_id FROM hsn_demand_rollup hdr " + " WHERE hdr.hsn_network_id in(select hsn_network_id from hub_spoke_network_mapping where is_active=1 and ssp.site_id=hsn_site_id) " + - " AND hdr.demand_12 <= "+skuTableWidgetData.getHubDemandMax() +" ) "; + " AND nvl(hdr.demand_12,0) <= "+skuTableWidgetData.getHubDemandMax() +" ) "; } else if (skuTableWidgetData.getHubDemandMin() != null && skuTableWidgetData.getHubDemandMax() == null) { sql += " AND ssp.product_id IN ( SELECT hdr.product_id FROM hsn_demand_rollup hdr " + " WHERE hdr.hsn_network_id in(select hsn_network_id from hub_spoke_network_mapping where is_active=1 and ssp.site_id=hsn_site_id) " + - " AND hdr.demand_12 >= "+skuTableWidgetData.getHubDemandMin() +" ) "; + " AND nvl(hdr.demand_12,0) >= "+skuTableWidgetData.getHubDemandMin() +" ) "; } @@ -1452,18 +1452,18 @@ if (skuTableWidgetData.getHubDemandMin() != null && skuTableWidgetData.getHubDemandMax() != null && skuTableWidgetData.getHubDemandMax() >= skuTableWidgetData.getHubDemandMin()) { sql += " AND ssp.product_id IN ( SELECT hdr.product_id FROM hsn_demand_rollup hdr " + " WHERE hdr.hsn_network_id in(select hsn_network_id from hub_spoke_network_mapping where is_active=1 and ssp.site_id=hsn_site_id) " + - " AND hdr.demand_24 BETWEEN "+skuTableWidgetData.getHubDemandMin() + + " AND nvl(hdr.demand_24,0) BETWEEN "+skuTableWidgetData.getHubDemandMin() + " AND "+ skuTableWidgetData.getHubDemandMax() +" ) "; } else if (skuTableWidgetData.getHubDemandMax() != null && skuTableWidgetData.getHubDemandMin() == null) { sql += " AND ssp.product_id IN ( SELECT hdr.product_id FROM hsn_demand_rollup hdr " + " WHERE hdr.hsn_network_id in(select hsn_network_id from hub_spoke_network_mapping where is_active=1 and ssp.site_id=hsn_site_id) " + - " AND hdr.demand_24 <= "+skuTableWidgetData.getHubDemandMax() +" ) "; + " AND nvl(hdr.demand_24,0) <= "+skuTableWidgetData.getHubDemandMax() +" ) "; } else if (skuTableWidgetData.getHubDemandMin() != null && skuTableWidgetData.getHubDemandMax() == null) { sql += " AND ssp.product_id IN ( SELECT hdr.product_id FROM hsn_demand_rollup hdr " + " WHERE hdr.hsn_network_id in(select hsn_network_id from hub_spoke_network_mapping where is_active=1 and ssp.site_id=hsn_site_id) " + - " AND hdr.demand_24 >= "+skuTableWidgetData.getHubDemandMin() +" ) "; + " AND nvl(hdr.demand_24,0) >= "+skuTableWidgetData.getHubDemandMin() +" ) "; } }