diff --git a/service/ReopenZoneWiseDaskboards.java b/service/ReopenZoneWiseDaskboards.java index 793a876..55fec5a 100644 --- a/service/ReopenZoneWiseDaskboards.java +++ b/service/ReopenZoneWiseDaskboards.java @@ -24,8 +24,8 @@ public class ReopenZoneWiseDaskboards { @Autowired DBConnection dbcon; - public String sFrDate =""; - public String sToDate =""; + public String sFrDate ; + public String sToDate ; public List getAlldtozwreopen() { List complaintdept = new ArrayList<>(); Connection con = DBConnection.getConnection(); @@ -72,7 +72,7 @@ private String getdtozwreopenQuery() { + "ORDER BY id_dept"; } - public String getReopenZonewisedaskboardQuery(String DEPTID) { + public String getReopenZonewisedaskboardQuery(String sFrDate,String sToDate,String DEPTID) { String sQry = "SELECT * FROM (SELECT a.deptid, " + "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\", " + @@ -99,7 +99,7 @@ private String getdtozwreopenQuery() { if (sToDate == null || sToDate.equals("")) { sToDate = sFrDate; } - 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) AND TRUNC(COMPLAINTDATE) >= trunc(sysdate-730) " + @@ -125,7 +125,7 @@ private String getdtozwreopenQuery() { if (sToDate == null || sToDate.equals("")) { sToDate = sFrDate; } - 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")) { @@ -144,11 +144,11 @@ private String getdtozwreopenQuery() { } - public List> getReopenZonewisedashboardquery(String DEPTID) { + public List> getReopenZonewisedashboardquery(String sFrDate,String sToDate,String DEPTID) { Connection con = DBConnection.getConnection(); try { - String query = getReopenZonewisedaskboardQuery(DEPTID); + String query = getReopenZonewisedaskboardQuery(sFrDate,sToDate,DEPTID); PreparedStatement pstmt = con.prepareStatement(query);