You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
5.4 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //package in.gov.chennaicorporation.gccoffice.pgr.service;
  2. //
  3. //import java.sql.Connection;
  4. //import java.sql.ResultSet;
  5. //import java.sql.ResultSetMetaData;
  6. //import java.sql.Statement;
  7. //import java.util.ArrayList;
  8. //import java.util.HashMap;
  9. //import java.util.List;
  10. //import java.util.Map;
  11. //
  12. //import org.springframework.beans.factory.annotation.Autowired;
  13. //import org.springframework.stereotype.Service;
  14. //
  15. //import in.gov.chennaicorporation.gccoffice.pgr.dbconnection.DBConnection;
  16. //
  17. //@Service
  18. //public class MobileAgeAnalysisReports {
  19. //
  20. // @Autowired
  21. // DBConnection dbcon;
  22. //
  23. // public String sFrDate ="";
  24. // public String sToDate ="";
  25. //
  26. //
  27. //
  28. // public String getmobileageanalysisQuery(int iPenReOpen, int iRptID, int iDaysID, int iDeptID) {
  29. // String sQry= "Select c.dept_name,a.iduser,a.user_name,nvl(b.extrafield2,' ') MOBILENO,a.nos,a.deptid from (SELECT cd.deptid,u.user_name, COUNT (cd.complaintid) nos,max(u.id_user) iduser"
  30. // +" FROM eggr_complaintdetails@erp cd,"
  31. // +" eggr_redressaldetails@erp rd,"
  32. // +" eggr_complaintstatus@erp st,"
  33. // +" eg_user@erp u"
  34. // +" WHERE cd.complaintid = rd.complaintid "
  35. // +" AND rd.complaintstatusid = st.complaintstatusid"
  36. // +" AND rd.redressalofficerid = u.id_user and complaintdate >= '25-oct-2010'";
  37. //
  38. // if ( iPenReOpen == 0 )
  39. // sQry += " AND st.statusname IN ('REGISTERED', 'PROCESSING', 'FORWARDED','REOPENED') and rd.COMPLAINTSTATUSID IN(2,3,4,9) ";
  40. // else if ( iPenReOpen == 1 ) // Pending
  41. // sQry += " AND st.statusname IN ('REGISTERED', 'PROCESSING', 'FORWARDED') and rd.COMPLAINTSTATUSID IN(2,3,4) ";
  42. // else if ( iPenReOpen == 2 ) // ReOpen
  43. // sQry += " AND st.statusname IN ('REOPENED') and rd.COMPLAINTSTATUSID IN(9) ";
  44. //
  45. // if ( iRptID == 1 ) sQry += " and nvl(RECEIVINGCENTERID,0)=1 ";
  46. // else if ( iRptID == 2 ) sQry += " and nvl(RECEIVINGCENTERID,0) !=1 ";
  47. // //Object sComplainttype = "";
  48. //// if ( sComplainttype .equals("52,1,22,32,57,59,70,18,69,7,71,19,58,75,43") ) sQry += " and complainttype not in("+ sComplainttype +") ";
  49. //// else if ( !sComplainttype.equals("0") ) sQry += " and complainttype in("+ sComplainttype +") ";
  50. //
  51. // //if ( !sFrDate.equals("") ) sQry += " and trunc(complaintdate)=to_date('"+ sFrDate +"','dd/mm/yyyy') ";
  52. // if ( !sFrDate.equals("") )
  53. // {
  54. // if (sToDate == null || sToDate.equals("") ) sToDate = sFrDate;
  55. // //sQry += " trunc(complaintdate)=to_date('"+ sFrDate +"','dd/mm/yyyy') and ";
  56. // sQry += " and trunc(complaintdate) between to_date('"+ sFrDate +"','dd/mm/yyyy') and to_date('"+ sToDate +"','dd/mm/yyyy') ";
  57. // }
  58. //
  59. // if ( iDaysID == 1 ) sQry += " and (sysdate-complaintdate)>90 ";
  60. // else if ( iDaysID == 2 ) sQry += " and sysdate-complaintdate>60 and sysdate-complaintdate<=90 ";
  61. // else if ( iDaysID == 3 ) sQry += " and sysdate-complaintdate>30 and sysdate-complaintdate<=60 ";
  62. // else if ( iDaysID == 4 ) sQry += " and sysdate-complaintdate>15 and sysdate-complaintdate<=30 ";
  63. // else if ( iDaysID == 5 ) sQry += " and sysdate-complaintdate>0 and sysdate-complaintdate<=15 ";
  64. //
  65. // sQry += " GROUP BY cd.deptid,u.user_name ORDER BY cd.deptid,u.user_name) a , eg_user@erp b,eg_department@erp c where a.deptid=c.id_dept(+) and ";
  66. // sQry += " a.user_name=b.user_name AND (NVL(DEPT_NAME,0) NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL)";
  67. //
  68. // if ( (iDeptID == 48 || iDeptID == 49 || iDeptID == 50) && iPenReOpen == 2) // ReOpen & Region
  69. // {
  70. // if ( iDeptID == 48 )
  71. // sQry += " and nvl(a.deptid,0) in (32,33,34,35,36,48)";
  72. // else if ( iDeptID == 49 )
  73. // sQry += " and nvl(a.deptid,0) in (42,43,44,45,46,49)";
  74. // else if ( iDeptID == 50 )
  75. // sQry += " and nvl(a.deptid,0) in (37,38,39,40,41,50)";
  76. // }
  77. // else if ( iDeptID != 0 ) sQry += " and nvl(a.deptid,0)= "+ iDeptID;
  78. //
  79. //
  80. //
  81. // //if ( sComplainttype.equals("52,1,22,32,57,59,70,18,69,7,71") ) sQry += " and a.complainttype not in("+ sComplainttype +") ";
  82. // //else if ( !sComplainttype.equals("") ) sQry += " and complainttype in("+ sComplainttype +") ";
  83. //
  84. // sQry += " order by c.dept_name,a.user_name";
  85. // System.out.println("Gen Query:" + sQry);
  86. // return sQry.toString();
  87. // }
  88. //
  89. // public List<Map<String, Object>> getMobileAgeAnalysiswise(String iPenReOpen, String sComplaintType, String rptId, String deptId, String zoneAge,String PgrUserID,String fromDate, String toDate) {
  90. // Connection con =DBConnection.getConnection();
  91. // Statement stmt3;
  92. // try {
  93. // stmt3 = con.createStatement();
  94. //
  95. //
  96. // System.out.println( "checkingMobileAgeAnalysis...");
  97. // ResultSet rs3 = stmt3.executeQuery(getmobileageanalysisQuery(0, 0, 0, 0));
  98. //
  99. //
  100. // List<Map<String, Object>> rows = new ArrayList<>();
  101. //
  102. // while (rs3.next()) {
  103. //
  104. // Map<String, Object> row = new HashMap<>();
  105. //
  106. //
  107. // ResultSetMetaData metaData = rs3.getMetaData();
  108. // int columnCount = metaData.getColumnCount();
  109. // for (int i = 1; i <= columnCount; i++) {
  110. // String columnName = metaData.getColumnName(i);
  111. // Object columnValue = rs3.getObject(i);
  112. // System.out.println(columnName+" :"+columnValue);
  113. // row.put(columnName, columnValue);
  114. // }
  115. //
  116. //
  117. // rows.add(row);
  118. // }
  119. // return rows;
  120. // }
  121. // catch (Exception e){
  122. // e.printStackTrace();
  123. // }
  124. // return null;
  125. //
  126. //}
  127. //
  128. //
  129. //}