|
|
|
@ -1,11 +1,12 @@ |
|
|
|
package in.gov.chennaicorporation.gccoffice.pgr.service; |
|
|
|
|
|
|
|
import java.sql.Connection; |
|
|
|
|
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.ResultSetMetaData; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.sql.Statement; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import in.gov.chennaicorporation.gccoffice.pgr.dbconnection.DBConnection; |
|
|
|
import in.gov.chennaicorporation.gccoffice.pgr.dto.Dtoworeopen; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class ReopenZonewiseReports { |
|
|
|
@ -21,7 +23,54 @@ public class ReopenZonewiseReports { |
|
|
|
@Autowired |
|
|
|
DBConnection dbcon; |
|
|
|
|
|
|
|
public String getreopenzoneQuery(String sFrDate,String sToDate,String DEPT_NAME) { |
|
|
|
public List<Dtoworeopen> getAlldtoworeopen() { |
|
|
|
List<Dtoworeopen> complaintdept = new ArrayList<>(); |
|
|
|
Connection con = DBConnection.getConnection(); |
|
|
|
Statement stmt = null; |
|
|
|
ResultSet rs = null; |
|
|
|
|
|
|
|
try { |
|
|
|
stmt = con.createStatement(); |
|
|
|
rs = stmt.executeQuery(getdtoworeopenQuery()); |
|
|
|
|
|
|
|
while (rs.next()) { |
|
|
|
Dtoworeopen dtoworeopens = new Dtoworeopen(); |
|
|
|
dtoworeopens.setId(rs.getString("id_dept")); |
|
|
|
dtoworeopens.setName(rs.getString("dept_name")); |
|
|
|
complaintdept.add(dtoworeopens); |
|
|
|
} |
|
|
|
|
|
|
|
return complaintdept; |
|
|
|
} catch (SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} finally { |
|
|
|
try { |
|
|
|
if (rs != null) { |
|
|
|
rs.close(); |
|
|
|
} |
|
|
|
if (stmt != null) { |
|
|
|
stmt.close(); |
|
|
|
} |
|
|
|
if (con != null) { |
|
|
|
con.close(); |
|
|
|
} |
|
|
|
} catch (SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return Collections.emptyList(); // Return an empty list if there's an error |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getdtoworeopenQuery() { |
|
|
|
return "SELECT id_dept, dept_name " |
|
|
|
+ "FROM EG_DEPARTMENT@ERP " |
|
|
|
+ "WHERE NVL(dept_name, '0') NOT LIKE 'F%' AND dept_name IS NOT NULL AND id_dept >= 32 " |
|
|
|
+ "ORDER BY id_dept"; |
|
|
|
} |
|
|
|
|
|
|
|
public String getreopenzoneQuery(String sFrDate,String sToDate,String DEPT_NAME) { |
|
|
|
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" |
|
|
|
+" FROM eggr_complaintdetails@erp cd," |
|
|
|
+" eggr_redressaldetails@erp rd," |
|
|
|
|