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.

137 lines
4.9 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. //
  18. //@Service
  19. //public class MobileAgeAnalysisComplaintReports {
  20. //
  21. // @Autowired
  22. // DBConnection dbcon;
  23. //
  24. // public String sFrDate ="";
  25. // public String sToDate ="";
  26. //
  27. //
  28. //
  29. // public String getMobileAgeAnalysisComplaintQuery(Integer iDeptID, Integer iPgrUserID) {
  30. //
  31. // int iPenReOpen = 0;
  32. //
  33. // StringBuilder queryBuilder = new StringBuilder();
  34. // queryBuilder.append("SELECT a.*, NVL(TO_CHAR(a.complaintdate, 'dd-mm-rrrr'), ' ') compdate, c.DEPT_NAME, u.user_name FROM ");
  35. // queryBuilder.append("eggr_complaintdetails@erp a, EG_DEPARTMENT@ERP c, eggr_redressaldetails@erp b, eg_user@erp u ");
  36. // queryBuilder.append("WHERE a.deptid = c.id_dept AND (NVL(DEPT_NAME, '0') NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) ");
  37. // queryBuilder.append("AND a.complaintid = b.complaintid AND complaintdate >= TO_DATE('25-Oct-2010', 'DD-Mon-YYYY') ");
  38. // queryBuilder.append("AND u.id_user = b.redressalofficerid ");
  39. //
  40. // if (iPenReOpen == 0) {
  41. // queryBuilder.append("AND b.COMPLAINTSTATUSID IN (2, 3, 4, 9) ");
  42. // } else if (iPenReOpen == 1) {
  43. // queryBuilder.append("AND b.COMPLAINTSTATUSID IN (2, 3, 4) ");
  44. // } else if (iPenReOpen == 2) {
  45. // queryBuilder.append("AND b.COMPLAINTSTATUSID IN (9) ");
  46. // }
  47. //
  48. // /* if (iRptID == 1) {
  49. // queryBuilder.append("AND NVL(a.RECEIVINGCENTERID, 0) = 1 ");
  50. // } else if (iRptID == 2) {
  51. // queryBuilder.append("AND NVL(a.RECEIVINGCENTERID, 0) != 1 ");
  52. // }
  53. //*/
  54. // if (iDeptID != 0) {
  55. // queryBuilder.append("AND NVL(a.deptid, 0) = ").append(iDeptID).append(" ");
  56. // }
  57. ///*
  58. // if (iDaysID == 1) {
  59. // queryBuilder.append("AND (SYSDATE - complaintdate) > 90 ");
  60. // } else if (iDaysID == 2) {
  61. // queryBuilder.append("AND SYSDATE - complaintdate > 60 AND SYSDATE - complaintdate <= 90 ");
  62. // } else if (iDaysID == 3) {
  63. // queryBuilder.append("AND SYSDATE - complaintdate > 30 AND SYSDATE - complaintdate <= 60 ");
  64. // } else if (iDaysID == 4) {
  65. // queryBuilder.append("AND SYSDATE - complaintdate > 15 AND SYSDATE - complaintdate <= 30 ");
  66. // } else if (iDaysID == 5) {
  67. // queryBuilder.append("AND SYSDATE - complaintdate > 0 AND SYSDATE - complaintdate <= 15 ");
  68. // }
  69. //*/
  70. // if (iPgrUserID != 0 && iDeptID != 37) {
  71. // queryBuilder.append("AND NVL(b.redressalofficerid, 0) = ").append(iPgrUserID).append(" ");
  72. // }
  73. //
  74. // if (!sFrDate.isEmpty() && !sToDate.isEmpty()) {
  75. // queryBuilder.append("AND TRUNC(complaintdate) BETWEEN TO_DATE('").append(sFrDate).append("', 'DD/MM/YYYY') ");
  76. // queryBuilder.append("AND TO_DATE('").append(sToDate).append("', 'DD/MM/YYYY') ");
  77. // }
  78. ///*
  79. // if ("52,1,22,32,57,59,70,18,69,7,71,19,58,75,43".equals(sComplainttype)) {
  80. // queryBuilder.append("AND a.complainttype NOT IN ('52,1,22,32,57,59,70,18,69,7,71,19,75,58,43,146,97,113,114,130,145,118,138,99,152,119,181,112,166') ");
  81. // } else if (!"0".equals(sComplainttype)) {
  82. // queryBuilder.append("AND complainttype IN (").append(sComplainttype).append(") ");
  83. // }
  84. //*/
  85. // queryBuilder.append("ORDER BY user_name, a.complaintdate");
  86. //
  87. // String sqlQuery = queryBuilder.toString();
  88. // System.out.println("sQry: " + sqlQuery);
  89. // return sqlQuery;
  90. // }
  91. //
  92. //
  93. //
  94. //
  95. //
  96. //
  97. //
  98. // public List<Map<String, Object>> getMobileAgeAnalysisComplaints( Integer deptId, Integer pgrUserId) {
  99. // Connection con =DBConnection.getConnection();
  100. // Statement stmt3;
  101. // try {
  102. // stmt3 = con.createStatement();
  103. //
  104. //
  105. // System.out.println( "checkingmobileageanalysiscomreports...");
  106. // //String sComplainttype ="52,1,22,32,57,59,70,18,69,7,71,19,75,58,43,146,97,113,114,130,145,118,138,99,152,119,181,112,166";
  107. // ResultSet rs4 = stmt3.executeQuery(getMobileAgeAnalysisComplaintQuery(deptId, pgrUserId));
  108. //
  109. //
  110. // List<Map<String, Object>> rows = new ArrayList<>();
  111. //
  112. // while (rs4.next()) {
  113. //
  114. // Map<String, Object> row = new HashMap<>();
  115. //
  116. //
  117. // ResultSetMetaData metaData = rs4.getMetaData();
  118. // int columnCount = metaData.getColumnCount();
  119. // for (int i = 1; i <= columnCount; i++) {
  120. // String columnName = metaData.getColumnName(i);
  121. // Object columnValue = rs4.getObject(i);
  122. // // System.out.println(columnName+" :"+columnValue);
  123. // row.put(columnName, columnValue);
  124. // }
  125. //
  126. //
  127. // rows.add(row);
  128. // }
  129. // return rows;
  130. // }
  131. // catch (Exception e){
  132. // e.printStackTrace();
  133. // }
  134. // return null;
  135. //}
  136. //
  137. //}