Commit d886bf93 authored by sbade's avatar sbade

sql condition chnged as req_date< startDate. in pending request summary


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99814 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6b5c2da5
...@@ -229,21 +229,26 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -229,21 +229,26 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
//--- Closing Opening + received - delivered //--- Closing Opening + received - delivered
sql = " select sum(no_request) as no_req from (select count(1) as no_request from ser_request where " + sql = " select sum(no_request) as no_req from (select count(1) as no_request from ser_request where " +
" req_date between ? and ? and emp_code__assign = ? and comp_stat <> 'C' union all select count(1) " + //" req_date between ? and ? " +// commented by swati 05 Dec 2016
" from ser_request where req_date between ? and ? and emp_code__assign = ? " + " req_date < ? "+ // added by swati 05 Dec 2016
"and emp_code__assign = ? and comp_stat <> 'C' union all select count(1) " +
" from ser_request where " +
"req_date between ? and ? " +
//" req_date < ? "+// added by swati 05 Dec 2016
"and emp_code__assign = ? " +
" union all select -1 * count(1) from ser_request where " + " union all select -1 * count(1) from ser_request where " +
" COMP_STAT_DT between ? and ? and emp_code__assign = ? and comp_stat = 'C' )"; " COMP_STAT_DT between ? and ? and emp_code__assign = ? and comp_stat = 'C' )";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, frmDateInTs); pstmt.setTimestamp(1, frmDateInTs);
pstmt.setTimestamp(2, toDateInTs); //pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(3, empCode); pstmt.setString(2, empCode);
pstmt.setTimestamp(4, frmDateInTs); pstmt.setTimestamp(3, frmDateInTs);
pstmt.setTimestamp(5, toDateInTs); pstmt.setTimestamp(4, toDateInTs);
pstmt.setString(6, empCode); pstmt.setString(5, empCode);
pstmt.setTimestamp(7, frmDateInTs); pstmt.setTimestamp(6, frmDateInTs);
pstmt.setTimestamp(8, toDateInTs); pstmt.setTimestamp(7, toDateInTs);
pstmt.setString(9,empCode); pstmt.setString(8,empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -354,15 +359,15 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -354,15 +359,15 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
&& (toDateInTs!=null && toDateInTs.toString().length()>0) && (toDateInTs!=null && toDateInTs.toString().length()>0)
&& (empCode!=null && empCode.trim().length()>0) ) && (empCode!=null && empCode.trim().length()>0) )
{ {
sql = "select count(1) opening_request from ser_request where req_date between ? and ? and emp_code__assign = ? and comp_stat <> 'C'"; sql = "select count(1) opening_request from ser_request where req_date < ? and emp_code__assign = ? and comp_stat <> 'C'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, frmDateInTs); pstmt.setTimestamp(1, frmDateInTs);
pstmt.setTimestamp(2, toDateInTs); //pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(3, empCode); pstmt.setString(2, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData.put("descr","Opening Request" ); rowData.put("descr","Opening" );
rowData.put("count",checkNull(rs.getString("opening_request")) ); rowData.put("count",checkNull(rs.getString("opening_request")) );
rowDataPendingTaskJson.put(count, rowData); rowDataPendingTaskJson.put(count, rowData);
count++; count++;
...@@ -516,27 +521,32 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas ...@@ -516,27 +521,32 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs.close(); rs.close();
rs = null; rs = null;
sql = " select sum(no_request) as no_req from (select count(1) as no_request from ser_request where " + sql = " select sum(no_request) as no_req from (select count(1) as no_request from ser_request where " +
" req_date between ? and ? and emp_code__assign = ? and comp_stat <> 'C' union all select count(1) " + //" req_date between ? and ? " +// commented by swati 05 Dec 2016
" from ser_request where req_date between ? and ? and emp_code__assign = ? " + " req_date < ? "+ // added by swati 05 Dec 2016
"and emp_code__assign = ? and comp_stat <> 'C' union all select count(1) " +
" from ser_request where " +
"req_date between ? and ? " +
//" req_date < ? "+// added by swati 05 Dec 2016
"and emp_code__assign = ? " +
" union all select -1 * count(1) from ser_request where " + " union all select -1 * count(1) from ser_request where " +
" COMP_STAT_DT between ? and ? and emp_code__assign = ? and comp_stat = 'C' )"; " COMP_STAT_DT between ? and ? and emp_code__assign = ? and comp_stat = 'C' )";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, frmDateInTs); pstmt.setTimestamp(1, frmDateInTs);
pstmt.setTimestamp(2, toDateInTs); //pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(3, empCode); pstmt.setString(2, empCode);
pstmt.setTimestamp(4, frmDateInTs); pstmt.setTimestamp(3, frmDateInTs);
pstmt.setTimestamp(5, toDateInTs); pstmt.setTimestamp(4, toDateInTs);
pstmt.setString(6, empCode); pstmt.setString(5, empCode);
pstmt.setTimestamp(7, frmDateInTs); pstmt.setTimestamp(6, frmDateInTs);
pstmt.setTimestamp(8, toDateInTs); pstmt.setTimestamp(7, toDateInTs);
pstmt.setString(9,empCode); pstmt.setString(8,empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
rowData = new JSONObject(); rowData = new JSONObject();
rowData.put("descr","Closed Request" ); rowData.put("descr","Closed" );
rowData.put("count",checkNull(rs.getString("no_req")) ); rowData.put("count",checkNull(rs.getString("no_req")) );
rowDataPendingTaskJson.put(count, rowData); rowDataPendingTaskJson.put(count, rowData);
count++; count++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment