-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HCMPRE-1333- Removed dense rank query; using sequential calls to get …
…child table data. (#1210)
- Loading branch information
1 parent
183f6e9
commit 2d2d4cc
Showing
21 changed files
with
611 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
core-services/egov-hrms/src/main/java/org/egov/hrms/repository/AssignmentRowMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.egov.hrms.repository; | ||
|
||
import org.egov.hrms.model.Assignment; | ||
import org.egov.hrms.model.AuditDetails; | ||
import org.springframework.jdbc.core.ResultSetExtractor; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Component | ||
public class AssignmentRowMapper implements ResultSetExtractor<List<Assignment>> { | ||
|
||
@Override | ||
public List<Assignment> extractData(ResultSet rs) throws SQLException { | ||
List<Assignment> assignments = new ArrayList<>(); | ||
while (rs.next()) { | ||
AuditDetails auditDetails = AuditDetails.builder() | ||
.createdBy(rs.getString("createdby")) | ||
.createdDate(rs.getLong("createddate")) | ||
.lastModifiedBy(rs.getString("lastmodifiedby")) | ||
.lastModifiedDate(rs.getLong("lastmodifieddate")) | ||
.build(); | ||
|
||
Assignment assignment = Assignment.builder() | ||
.id(rs.getString("assignment_uuid")) | ||
.employeeId(rs.getString("employeeid")) | ||
.position(rs.getLong("position")) | ||
.department(rs.getString("department")) | ||
.designation(rs.getString("designation")) | ||
.fromDate(rs.getLong("fromdate")) | ||
.toDate(rs.getObject("todate") != null ? rs.getLong("todate") : null) | ||
.govtOrderNumber(rs.getString("govtordernumber")) | ||
.reportingTo(rs.getString("reportingto")) | ||
.isHOD(rs.getBoolean("ishod")) | ||
.isCurrentAssignment(rs.getBoolean("iscurrentassignment")) | ||
.tenantid(rs.getString("tenantid")) | ||
.auditDetails(auditDetails) | ||
.build(); | ||
assignments.add(assignment); | ||
} | ||
return assignments; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...rvices/egov-hrms/src/main/java/org/egov/hrms/repository/DeactivationDetailsRowMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.egov.hrms.repository; | ||
|
||
import org.egov.hrms.model.AuditDetails; | ||
import org.egov.hrms.model.DeactivationDetails; | ||
import org.springframework.jdbc.core.ResultSetExtractor; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Component | ||
public class DeactivationDetailsRowMapper implements ResultSetExtractor<List<DeactivationDetails>> { | ||
|
||
@Override | ||
public List<DeactivationDetails> extractData(ResultSet rs) throws SQLException { | ||
|
||
List<DeactivationDetails> deactivationDetails = new ArrayList<>(); | ||
while (rs.next()) { | ||
AuditDetails auditDetails = AuditDetails.builder() | ||
.createdBy(rs.getString("createdby")) | ||
.createdDate(rs.getLong("createddate")) | ||
.lastModifiedBy(rs.getString("lastmodifiedby")) | ||
.lastModifiedDate(rs.getLong("lastmodifieddate")) | ||
.build(); | ||
|
||
DeactivationDetails deactivationDetail = DeactivationDetails.builder() | ||
.id(rs.getString("deact_uuid")) | ||
.reasonForDeactivation(rs.getString("reasonfordeactivation")) | ||
.orderNo(rs.getString("ordernumber")) | ||
.remarks(rs.getString("remarks")) | ||
.effectiveFrom(rs.getLong("effectivefrom")) | ||
.employeeId(rs.getString("employeeid")) | ||
.tenantId(rs.getString("tenantid")) | ||
.auditDetails(auditDetails) | ||
.build(); | ||
deactivationDetails.add(deactivationDetail); | ||
} | ||
return deactivationDetails; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
...-services/egov-hrms/src/main/java/org/egov/hrms/repository/DepartmentalTestRowMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.egov.hrms.repository; | ||
|
||
import org.egov.hrms.model.AuditDetails; | ||
import org.egov.hrms.model.DepartmentalTest; | ||
import org.springframework.jdbc.core.ResultSetExtractor; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Component | ||
public class DepartmentalTestRowMapper implements ResultSetExtractor<List<DepartmentalTest>> { | ||
|
||
@Override | ||
public List<DepartmentalTest> extractData(ResultSet rs) throws SQLException { | ||
List<DepartmentalTest> departmentalTests = new ArrayList<>(); | ||
while (rs.next()) { | ||
AuditDetails auditDetails = AuditDetails.builder() | ||
.createdBy(rs.getString("createdby")) | ||
.createdDate(rs.getLong("createddate")) | ||
.lastModifiedBy(rs.getString("lastmodifiedby")) | ||
.lastModifiedDate(rs.getLong("lastmodifieddate")) | ||
.build(); | ||
DepartmentalTest departmentalTest = DepartmentalTest.builder() | ||
.id(rs.getString("uuid")) | ||
.test(rs.getString("testname")) | ||
.yearOfPassing(rs.getLong("yearofpassing")) | ||
.remarks(rs.getString("remarks")) | ||
.employeeId(rs.getString("employeeid")) | ||
.tenantId(rs.getString("tenantid")) | ||
.auditDetails(auditDetails) | ||
.build(); | ||
departmentalTests.add(departmentalTest); | ||
} | ||
return departmentalTests; | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
core-services/egov-hrms/src/main/java/org/egov/hrms/repository/DocumentRowMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.egov.hrms.repository; | ||
|
||
import org.egov.hrms.model.AuditDetails; | ||
import org.egov.hrms.model.EmployeeDocument; | ||
import org.egov.hrms.model.enums.EmployeeDocumentReferenceType; | ||
import org.springframework.jdbc.core.ResultSetExtractor; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Component | ||
public class DocumentRowMapper implements ResultSetExtractor<List<EmployeeDocument>> { | ||
|
||
@Override | ||
public List<EmployeeDocument> extractData(ResultSet rs) throws SQLException { | ||
|
||
List<EmployeeDocument> documents = new ArrayList<>(); | ||
while (rs.next()) { | ||
AuditDetails auditDetails = AuditDetails.builder() | ||
.createdBy(rs.getString("createdby")) | ||
.createdDate(rs.getLong("createddate")) | ||
.lastModifiedBy(rs.getString("lastmodifiedby")) | ||
.lastModifiedDate(rs.getLong("lastmodifieddate")) | ||
.build(); | ||
|
||
EmployeeDocument document = EmployeeDocument.builder() | ||
.id(rs.getString("docs_uuid")) | ||
.documentName(rs.getString("documentname")) | ||
.documentId(rs.getString("documentid")) | ||
.referenceType(EmployeeDocumentReferenceType.valueOf(rs.getString("referencetype"))) | ||
.referenceId(rs.getString("referenceid")) | ||
.employeeId(rs.getString("employeeid")) | ||
.tenantId(rs.getString("tenantid")) | ||
.auditDetails(auditDetails) | ||
.build(); | ||
documents.add(document); | ||
} | ||
return documents; | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
...ervices/egov-hrms/src/main/java/org/egov/hrms/repository/EducationalDetailsRowMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.egov.hrms.repository; | ||
|
||
import org.egov.hrms.model.AuditDetails; | ||
import org.egov.hrms.model.EducationalQualification; | ||
import org.springframework.jdbc.core.ResultSetExtractor; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Component | ||
public class EducationalDetailsRowMapper implements ResultSetExtractor<List<EducationalQualification>> { | ||
|
||
@Override | ||
public List<EducationalQualification> extractData(ResultSet rs) throws SQLException { | ||
List<EducationalQualification> educationalQualifications = new ArrayList<>(); | ||
while (rs.next()) { | ||
AuditDetails auditDetails = AuditDetails.builder() | ||
.createdBy(rs.getString("createdby")) | ||
.createdDate(rs.getLong("createddate")) | ||
.lastModifiedBy(rs.getString("lastmodifiedby")) | ||
.lastModifiedDate(rs.getLong("lastmodifieddate")) | ||
.build(); | ||
educationalQualifications.add(EducationalQualification.builder() | ||
.id(rs.getString("uuid")) | ||
.qualification(rs.getString("qualification")) | ||
.stream(rs.getString("stream")) | ||
.yearOfPassing(rs.getLong("yearofpassing")) | ||
.university(rs.getString("university")) | ||
.remarks(rs.getString("remarks")) | ||
.employeeId(rs.getString("employeeid")) | ||
.tenantId(rs.getString("tenantid")) | ||
.isActive(rs.getBoolean("isactive")) | ||
.auditDetails(auditDetails) | ||
.build()); | ||
} | ||
return educationalQualifications; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.