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
//--- Closing Opening + received - delivered
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) " +
" from ser_request where req_date between ? and ? and emp_code__assign = ? " +
//" req_date between ? and ? " +// commented by swati 05 Dec 2016
" 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 " +
" COMP_STAT_DT between ? and ? and emp_code__assign = ? and comp_stat = 'C' )";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, frmDateInTs);
pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(3, empCode);
pstmt.setTimestamp(4, frmDateInTs);
pstmt.setTimestamp(5, toDateInTs);
pstmt.setString(6, empCode);
pstmt.setTimestamp(7, frmDateInTs);
pstmt.setTimestamp(8, toDateInTs);
pstmt.setString(9,empCode);
//pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(2, empCode);
pstmt.setTimestamp(3, frmDateInTs);
pstmt.setTimestamp(4, toDateInTs);
pstmt.setString(5, empCode);
pstmt.setTimestamp(6, frmDateInTs);
pstmt.setTimestamp(7, toDateInTs);
pstmt.setString(8,empCode);
rs = pstmt.executeQuery();
......@@ -354,15 +359,15 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
&& (toDateInTs!=null && toDateInTs.toString().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.setTimestamp(1, frmDateInTs);
pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(3, empCode);
//pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(2, empCode);
rs = pstmt.executeQuery();
if (rs.next())
{
rowData.put("descr","Opening Request" );
rowData.put("descr","Opening" );
rowData.put("count",checkNull(rs.getString("opening_request")) );
rowDataPendingTaskJson.put(count, rowData);
count++;
......@@ -516,27 +521,32 @@ public class ManagmentDashboard implements ManagmentDashboardLocal, ManagmentDas
rs.close();
rs = null;
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) " +
" from ser_request where req_date between ? and ? and emp_code__assign = ? " +
//" req_date between ? and ? " +// commented by swati 05 Dec 2016
" 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 " +
" COMP_STAT_DT between ? and ? and emp_code__assign = ? and comp_stat = 'C' )";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, frmDateInTs);
pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(3, empCode);
pstmt.setTimestamp(4, frmDateInTs);
pstmt.setTimestamp(5, toDateInTs);
pstmt.setString(6, empCode);
pstmt.setTimestamp(7, frmDateInTs);
pstmt.setTimestamp(8, toDateInTs);
pstmt.setString(9,empCode);
//pstmt.setTimestamp(2, toDateInTs);
pstmt.setString(2, empCode);
pstmt.setTimestamp(3, frmDateInTs);
pstmt.setTimestamp(4, toDateInTs);
pstmt.setString(5, empCode);
pstmt.setTimestamp(6, frmDateInTs);
pstmt.setTimestamp(7, toDateInTs);
pstmt.setString(8,empCode);
rs = pstmt.executeQuery();
if (rs.next())
{
rowData = new JSONObject();
rowData.put("descr","Closed Request" );
rowData.put("descr","Closed" );
rowData.put("count",checkNull(rs.getString("no_req")) );
rowDataPendingTaskJson.put(count, rowData);
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