|
|
@ -1,7 +1,6 @@ |
|
|
package in.gov.chennaicorporation.gccoffice.pgr.service; |
|
|
package in.gov.chennaicorporation.gccoffice.pgr.service; |
|
|
|
|
|
|
|
|
import java.sql.Connection; |
|
|
import java.sql.Connection; |
|
|
|
|
|
|
|
|
import java.sql.PreparedStatement; |
|
|
import java.sql.PreparedStatement; |
|
|
import java.sql.ResultSet; |
|
|
import java.sql.ResultSet; |
|
|
import java.sql.ResultSetMetaData; |
|
|
import java.sql.ResultSetMetaData; |
|
|
@ -21,13 +20,10 @@ public class ZoneWiseDaskboards { |
|
|
@Autowired |
|
|
@Autowired |
|
|
DBConnection dbcon; |
|
|
DBConnection dbcon; |
|
|
|
|
|
|
|
|
public String sFrDate =""; |
|
|
|
|
|
public String sToDate =""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String sFrDate ; |
|
|
|
|
|
public String sToDate ; |
|
|
|
|
|
|
|
|
public String getzonedaskboardQuery(String DEPTID) { |
|
|
|
|
|
|
|
|
public String getzonedaskboardQuery(String sFrDate,String sToDate,String DEPTID) { |
|
|
String sQry= "select * from (SELECT deptid , " |
|
|
String sQry= "select * from (SELECT deptid , " |
|
|
+"nvl(sum( case when complainttype in (52,146) then 1 end),0) as \"NonBURSTLT\" , " |
|
|
+"nvl(sum( case when complainttype in (52,146) then 1 end),0) as \"NonBURSTLT\" , " |
|
|
+"nvl(sum( case when complainttype in (1,97) then 1 end),0) as \"REOFGAR\" , " |
|
|
+"nvl(sum( case when complainttype in (1,97) then 1 end),0) as \"REOFGAR\" , " |
|
|
@ -57,7 +53,7 @@ public class ZoneWiseDaskboards { |
|
|
sToDate = sFrDate; |
|
|
sToDate = sFrDate; |
|
|
} |
|
|
} |
|
|
//sQry += " trunc(complaintdate)=to_date('"+ sFrDate +"','dd/mm/yyyy') and "; |
|
|
//sQry += " trunc(complaintdate)=to_date('"+ sFrDate +"','dd/mm/yyyy') and "; |
|
|
sQry += " trunc(complaintdate) between to_date('"+ sFrDate +"','dd/mm/yyyy') and to_date('"+ sToDate +"','dd/mm/yyyy') and "; |
|
|
|
|
|
|
|
|
sQry += " trunc(complaintdate) between to_date('"+ sFrDate +"','yyyy/mm/dd') and to_date('"+ sToDate +"','yyyy/mm/dd') and "; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
sQry += " a.complaintid=b.complaintid and b.COMPLAINTSTATUSID IN(2,3,4,9) and TRUNC(COMPLAINTDATE) >= trunc(sysdate-730)" |
|
|
sQry += " a.complaintid=b.complaintid and b.COMPLAINTSTATUSID IN(2,3,4,9) and TRUNC(COMPLAINTDATE) >= trunc(sysdate-730)" |
|
|
@ -86,7 +82,7 @@ public class ZoneWiseDaskboards { |
|
|
sToDate = sFrDate; |
|
|
sToDate = sFrDate; |
|
|
} |
|
|
} |
|
|
//sQry += " trunc(complaintdate)=to_date('"+ sFrDate +"','dd/mm/yyyy') and "; |
|
|
//sQry += " trunc(complaintdate)=to_date('"+ sFrDate +"','dd/mm/yyyy') and "; |
|
|
sQry += "and trunc(complaintdate) between to_date('"+ sFrDate +"','dd/mm/yyyy') and to_date('"+ sToDate +"','dd/mm/yyyy') "; |
|
|
|
|
|
|
|
|
sQry += "and trunc(complaintdate) between to_date('"+ sFrDate +"','yyyy/mm/dd') and to_date('"+ sToDate +"','yyyy/mm/dd') "; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (DEPTID != null && !DEPTID.equals("0")) { |
|
|
if (DEPTID != null && !DEPTID.equals("0")) { |
|
|
@ -104,14 +100,14 @@ public class ZoneWiseDaskboards { |
|
|
return sQry; |
|
|
return sQry; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getzonewisedaskboardQuery(String DEPTID) { |
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getzonewisedaskboardQuery(String sFrDate,String sToDate,String DEPTID) { |
|
|
Connection con =DBConnection.getConnection(); |
|
|
Connection con =DBConnection.getConnection(); |
|
|
// Statement stmt3; |
|
|
// Statement stmt3; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
// stmt3 = con.createStatement(); |
|
|
// stmt3 = con.createStatement(); |
|
|
|
|
|
|
|
|
String query = getzonedaskboardQuery(DEPTID); |
|
|
|
|
|
|
|
|
String query = getzonedaskboardQuery(sFrDate,sToDate,DEPTID); |
|
|
|
|
|
|
|
|
PreparedStatement pstmt = con.prepareStatement(query); |
|
|
PreparedStatement pstmt = con.prepareStatement(query); |
|
|
|
|
|
|
|
|
@ -130,8 +126,7 @@ public class ZoneWiseDaskboards { |
|
|
|
|
|
|
|
|
Map<String, Object> row = new HashMap<>(); |
|
|
Map<String, Object> row = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResultSetMetaData metaData = rs3.getMetaData(); |
|
|
|
|
|
|
|
|
ResultSetMetaData metaData = rs3.getMetaData(); |
|
|
int columnCount = metaData.getColumnCount(); |
|
|
int columnCount = metaData.getColumnCount(); |
|
|
for (int i = 1; i <= columnCount; i++) { |
|
|
for (int i = 1; i <= columnCount; i++) { |
|
|
String columnName = metaData.getColumnName(i); |
|
|
String columnName = metaData.getColumnName(i); |
|
|
@ -139,9 +134,7 @@ public class ZoneWiseDaskboards { |
|
|
//System.out.println(columnName+" :"+columnValue); |
|
|
//System.out.println(columnName+" :"+columnValue); |
|
|
row.put(columnName, columnValue); |
|
|
row.put(columnName, columnValue); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rows.add(row); |
|
|
|
|
|
|
|
|
rows.add(row); |
|
|
} |
|
|
} |
|
|
return rows; |
|
|
return rows; |
|
|
} |
|
|
} |
|
|
|