From 596e9a946987492e99468c04527565728c3a702f Mon Sep 17 00:00:00 2001 From: AJITHKUMAR12 <48044092+AJITHKUMAR12@users.noreply.github.com> Date: Fri, 19 Jun 2026 11:06:35 +0530 Subject: [PATCH] implemented full homeless survey module --- .../Service/ChildrenSurveyService.java | 54 +- .../configuration/DataSourceConfig.java | 22 +- .../Controller/HomelessSurveyController.java | 815 ++++ .../Controller/MainController.java | 168 + .../Service/HomelessSurveyService.java | 4103 +++++++++++++++++ .../modules/childrensurvey/childlist.html | 5 +- .../modules/childrensurvey/nonchildlist.html | 5 +- .../modules/childrensurvey/surveylist.html | 5 +- .../modules/homelesssurvey/aadhar.html | 576 +++ .../modules/homelesssurvey/bankpassbook.html | 576 +++ .../birthcertficatenoreason.html | 576 +++ .../modules/homelesssurvey/caste.html | 576 +++ .../modules/homelesssurvey/cminsurance.html | 576 +++ .../homelesssurvey/comeoutshelter.html | 576 +++ .../homelesssurvey/communitynoreason.html | 576 +++ .../homelesssurvey/currentlyliving.html | 576 +++ .../modules/homelesssurvey/disability.html | 576 +++ .../homelesssurvey/disabiltycertificate.html | 576 +++ .../modules/homelesssurvey/discontinued.html | 576 +++ .../modules/homelesssurvey/driver.html | 576 +++ .../modules/homelesssurvey/education.html | 576 +++ .../homelesssurvey/employmenttype.html | 576 +++ .../modules/homelesssurvey/gccshelter.html | 576 +++ .../modules/homelesssurvey/gendermaster.html | 576 +++ .../homelesssurvey/healthcondition.html | 576 +++ .../modules/homelesssurvey/homelesslist.html | 2085 +++++++++ .../homelesssurvey/homelessreason.html | 576 +++ .../modules/homelesssurvey/martial.html | 576 +++ .../modules/homelesssurvey/movingreason.html | 576 +++ .../homelesssurvey/nonsurveyedhomelist.html | 1007 ++++ .../modules/homelesssurvey/notemployed.html | 576 +++ .../modules/homelesssurvey/occupation.html | 576 +++ .../modules/homelesssurvey/relationtype.html | 576 +++ .../modules/homelesssurvey/religion.html | 576 +++ .../modules/homelesssurvey/sleepingspace.html | 576 +++ .../modules/homelesssurvey/smart.html | 576 +++ .../modules/homelesssurvey/surveyorlist.html | 1257 +++++ .../homelesssurvey/surveyorsreports.html | 1012 ++++ .../modules/homelesssurvey/voterid.html | 576 +++ 39 files changed, 26073 insertions(+), 17 deletions(-) create mode 100644 gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java create mode 100644 gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java create mode 100644 gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/aadhar.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/bankpassbook.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/caste.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/cminsurance.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/communitynoreason.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/currentlyliving.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disability.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/discontinued.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/driver.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/education.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/employmenttype.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gccshelter.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gendermaster.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/healthcondition.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelesslist.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelessreason.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/martial.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/movingreason.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/notemployed.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/occupation.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/relationtype.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/religion.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/sleepingspace.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/smart.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorlist.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html create mode 100644 gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/voterid.html diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java index 110082b5..1b124f9b 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/childrensurvey/Service/ChildrenSurveyService.java @@ -91,7 +91,18 @@ public class ChildrenSurveyService { csr.survey_id, MAX(CASE WHEN cqm.field_name = 'q6' THEN csr.answer END) AS child_name, - MAX(CASE WHEN cqm.field_name = 'q7' THEN gm.english_name END) AS gender, + MAX( + CASE + WHEN cqm.field_name = 'q7' + THEN CASE + WHEN csr.others_answer IS NOT NULL + AND TRIM(csr.others_answer) <> '' + THEN csr.others_answer + ELSE gm.english_name + END + END + ) AS gender, + MAX(CASE WHEN cqm.field_name = 'q10' THEN csr.answer END) AS age, MAX(CASE WHEN cqm.field_name = 'q24' THEN csr.answer END) AS mobile_number, MAX(CASE WHEN cqm.field_name = 'q1' THEN lm.english_name END) AS area, @@ -118,6 +129,7 @@ public class ChildrenSurveyService { """); List params = new ArrayList<>(); + // MAX(CASE WHEN cqm.field_name = 'q7' THEN gm.english_name END) AS gender, // 🔍 NAME if (name != null && !name.isEmpty()) { @@ -241,12 +253,16 @@ public class ChildrenSurveyService { String rawAnswer = row.get("answer") != null ? row.get("answer").toString() : ""; + String othersAnswer = row.get("others_answer") != null + ? row.get("others_answer").toString().trim() + : ""; String finalAnswer = resolveAnswer( qid, questionType, masterTable, - rawAnswer); + rawAnswer, + othersAnswer); // PERSONAL INFORMATION /* @@ -335,10 +351,16 @@ public class ChildrenSurveyService { Integer qid, String questionType, String masterTable, - String rawAnswer) { + String rawAnswer, + String othersAnswer) { try { + if (othersAnswer != null + && !othersAnswer.trim().isEmpty()) { + + return othersAnswer; + } if (rawAnswer == null || rawAnswer.trim().isEmpty()) { return ""; } @@ -983,11 +1005,20 @@ public class ChildrenSurveyService { WHEN cqm.field_name = 'q6' THEN csr.answer END) AS child_name, + MAX( + CASE + WHEN cqm.field_name = 'q7' + THEN CASE + WHEN csr.others_answer IS NOT NULL + AND TRIM(csr.others_answer) <> '' + THEN csr.others_answer + ELSE gm.english_name + END + END + ) AS gender, + + - MAX(CASE - WHEN cqm.field_name = 'q7' - THEN gm.english_name - END) AS gender, MAX(CASE WHEN cqm.field_name = 'q10' @@ -1058,6 +1089,12 @@ public class ChildrenSurveyService { """; return jdbcTemplate.queryForList(sql, loginId, locationId, surveyDate); + /* + * MAX(CASE + * WHEN cqm.field_name = 'q7' + * THEN gm.english_name + * END) AS gender, + */ } // dashboard @@ -3362,8 +3399,7 @@ public class ChildrenSurveyService { GROUP BY pr.survey_id - ORDER BY pr.cdate desc - + ORDER BY MAX(pr.cdate) DESC """); // ORDER BY pr.survey_id diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java index 36b516dd..c0fee04e 100644 --- a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java @@ -24,14 +24,14 @@ import java.util.Properties; @EnableTransactionManagement public class DataSourceConfig { - private static String host = "localhost:3306"; - private static String dbpassword = "root"; + // private static String host = "localhost:3306"; + // private static String dbpassword = "root"; // private static String dbpassword = "gccroot"; // AWS -// private static String host = "gcc-facial-db-instance-1.cf48eqcciziq.ap-south-1.rds.amazonaws.com:3306"; -// private static String dbpassword = "gcc-facial-password"; + private static String host = "gcc-facial-db-instance-1.cf48eqcciziq.ap-south-1.rds.amazonaws.com:3306"; + private static String dbpassword = "gcc-facial-password"; ////////////////////////////// (For GCC APP) //////////////////////// @Configuration @@ -407,7 +407,7 @@ public class DataSourceConfig { dataSource.setPassword(dbpassword); return dataSource; } - + /////////////// Road War ///////////////////// @Bean(name = "mysqlRoadWarDataSource") public DataSource mysqlRoadWarDataSource() { @@ -419,6 +419,18 @@ public class DataSourceConfig { return dataSource; } + // homeles + @Bean(name = "mysqlHomelessSurveyDataSource") + public DataSource mysqlHomelessSurveyDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUrl("jdbc:mysql://" + host + "/gcc_homeless_survey"); + // dataSource.setUrl("jdbc:mysql://" + host + "/gcc_homeless_survey_live"); + dataSource.setUsername("root"); + dataSource.setPassword(dbpassword); + return dataSource; + } + ////////////////////////////// ORACLE //////////////////////// @Bean(name = "oracleDataSource") public DataSource oracleDataSource() { diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java new file mode 100644 index 00000000..ad91febc --- /dev/null +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/HomelessSurveyController.java @@ -0,0 +1,815 @@ +package in.gov.chennaicorporation.gccoffice.homelesssurvey.Controller; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.URL; +import java.net.http.HttpHeaders; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ByteArrayResource; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.Resource; + +import in.gov.chennaicorporation.gccoffice.homelesssurvey.Service.HomelessSurveyService; + +@RestController +@RequestMapping("/gcc/api/homeless-survey") +public class HomelessSurveyController { + + @Autowired + private HomelessSurveyService service; + + @GetMapping("/list") + public ResponseEntity>> getHomelessSurveyList( + + @RequestParam(required = false) String zone, + @RequestParam(required = false) String ward, + @RequestParam(required = false) String fromDate, + @RequestParam(required = false) String toDate) { + + return ResponseEntity.ok( + service.getHomelessSurveyList( + zone, + ward, + fromDate, + toDate)); + } + + @GetMapping("/zones") + public ResponseEntity>> getZones() { + + return ResponseEntity.ok( + service.getZones()); + } + + @GetMapping("/wards") + public ResponseEntity>> getWards( + @RequestParam String zoneId) { + + return ResponseEntity.ok( + service.getWards(zoneId)); + } + + @GetMapping("/nonsurveyed/list") + @ResponseBody + public List> getHomelessNonSurveyedList( + + @RequestParam(required = false) String zone, + @RequestParam(required = false) String ward, + @RequestParam(required = false) String fromDate, + @RequestParam(required = false) String toDate) { + + return service.getHomelessNonSurveyedList( + zone, + ward, + fromDate, + toDate); + } + + @GetMapping("/details") + public ResponseEntity>> getSurveyDetails( + @RequestParam String surveyId) { + + return ResponseEntity.ok( + service.getHomelessSurveyDetails(surveyId)); + } + + @GetMapping("/document-count") + public ResponseEntity getDocumentCount( + @RequestParam String surveyId) { + + return ResponseEntity.ok( + service.getDocumentCount(surveyId)); + } + + @GetMapping("/documents") + public ResponseEntity>> getDocuments( + @RequestParam String surveyId) { + System.out.println("surveyId"); + System.out.println(surveyId); + + return ResponseEntity.ok( + service.getSurveyDocuments(surveyId)); + } + + /* + * @GetMapping("/download") + * public ResponseEntity downloadFile( + * + * @RequestParam String fileUrl) throws Exception { + * + * URL url = new URL(fileUrl); + * + * InputStream inputStream = url.openStream(); + * + * byte[] bytes = inputStream.readAllBytes(); + * + * ByteArrayResource resource = new ByteArrayResource(bytes); + * + * String fileName = fileUrl.substring( + * fileUrl.lastIndexOf("/") + 1); + * + * return ResponseEntity.ok() + * .header( + * HttpHeaders.CONTENT_DISPOSITION, + * "attachment; filename=\"" + + * fileName + "\"") + * .contentLength(bytes.length) + * .body(resource); + * } + */ + @GetMapping("/download-all-documents") + public ResponseEntity downloadAllDocuments( + @RequestParam String surveyId) throws Exception { + + List> documents = service.getSurveyDocuments(surveyId); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + ZipOutputStream zipOut = new ZipOutputStream(baos); + + for (Map doc : documents) { + + String fileUrl = String.valueOf(doc.get("file_url")); + + String documentName = String.valueOf(doc.get("document_name")) + .replaceAll("\\s+", "_"); + + URL url = new URL(fileUrl); + + InputStream is = url.openStream(); + + byte[] fileBytes = is.readAllBytes(); + + String extension = fileUrl.substring(fileUrl.lastIndexOf(".")); + + ZipEntry zipEntry = new ZipEntry( + documentName + "_" + + surveyId + + extension); + + zipOut.putNextEntry(zipEntry); + + zipOut.write(fileBytes); + + zipOut.closeEntry(); + + is.close(); + } + + zipOut.close(); + + return ResponseEntity.ok() + .header( + "Content-Disposition", + "attachment; filename=\"" + + surveyId + + "_Documents.zip\"") + .header( + "Content-Type", + "application/zip") + .body(baos.toByteArray()); + } + + /* + * @GetMapping("/download-document") + * public ResponseEntity downloadDocument( + * + * @RequestParam String fileUrl, + * + * @RequestParam String fileName) { + * + * try { + * + * URL url = new URL(fileUrl); + * + * InputStream is = url.openStream(); + * + * byte[] fileBytes = is.readAllBytes(); + * + * String extension = fileUrl.substring( + * fileUrl.lastIndexOf(".")); + * + * return ResponseEntity.ok() + * .header( + * "Content-Disposition", + * "attachment; filename=\"" + fileName + extension + "\"") + * .header( + * "Content-Type", + * "application/octet-stream") + * .body(fileBytes); + * + * } catch (Exception e) { + * + * throw new RuntimeException(e); + * } + * } + */ + @GetMapping("/categories") + public ResponseEntity>> getCategories() { + + return ResponseEntity.ok( + service.getCategories()); + } + + @GetMapping("/getSurveyorsList") + @ResponseBody + public List> getSurveyorsList( + + @RequestParam(required = false) String zone, + @RequestParam(required = false) String ward, + @RequestParam(required = false) String fromDate, + @RequestParam(required = false) String toDate) { + + return service.getSurveyorsList( + zone, + ward, + fromDate, + toDate); + } + + @GetMapping("/surveyor-details") + public ResponseEntity>> getSurveyorDetails( + + @RequestParam String loginId, + @RequestParam String zone, + @RequestParam String ward, + @RequestParam String surveyDate) { + + return ResponseEntity.ok( + service.getSurveyorWiseSurveyList( + loginId, + zone, + ward, + surveyDate)); + } + + @GetMapping("/gendermasterlist") + public List> getGenderList() { + + return service.getGenderList(); + } + + @PostMapping("/gendersave") + public String saveGender( + @RequestBody Map req) { + + service.saveGender(req); + + return "SUCCESS"; + } + + @PostMapping("/gender-status") + public String updateGenderStatus( + @RequestBody Map req) { + + service.updateGenderStatus(req); + + return "SUCCESS"; + } + + @GetMapping("/relationtypemasterlist") + public List> getRelationTypeList() { + + return service.getRelationTypeList(); + } + + @PostMapping("/relationtypesave") + public String saveRelationType( + @RequestBody Map req) { + + service.saveRelationType(req); + + return "SUCCESS"; + } + + @PostMapping("/relationtype-status") + public String updateRelationTypeStatus( + @RequestBody Map req) { + + service.updateRelationTypeStatus(req); + + return "SUCCESS"; + } + + @GetMapping("/currentlylivingmasterlist") + public List> getCurrentlyLivingList() { + + return service.getCurrentlyLivingList(); + } + + @PostMapping("/currentlylivingsave") + public String saveCurrentlyLiving( + @RequestBody Map req) { + + service.saveCurrentlyLiving(req); + + return "SUCCESS"; + } + + @PostMapping("/currentlyliving-status") + public String updateCurrentlyLivingStatus( + @RequestBody Map req) { + + service.updateCurrentlyLivingStatus(req); + + return "SUCCESS"; + } + + @GetMapping("/martialmasterlist") + public List> getMartialList() { + + return service.getMartialList(); + } + + @PostMapping("/martialsave") + public String saveMartial( + @RequestBody Map req) { + + service.saveMartial(req); + + return "SUCCESS"; + } + + @PostMapping("/martial-status") + public String updateMartialStatus( + @RequestBody Map req) { + + service.updateMartialStatus(req); + + return "SUCCESS"; + } + + @GetMapping("/disabilitytype") + public List> getDisabilityTypeList() { + return service.getDisabilityTypeList(); + } + + @PostMapping("/disabilitytypesave") + public String saveDisabilityType( + @RequestBody Map req) { + service.saveDisabilityType(req); + return "SUCCESS"; + } + + @PostMapping("/disabilitytype-status") + public String updateDisabilityTypeStatus( + @RequestBody Map req) { + service.updateDisabilityTypeStatus(req); + return "SUCCESS"; + } + + @GetMapping("/disabiltycertificatelist") + public List> getDisabilityCertificateMasterList() { + return service.getDisabilityCertificateMasterList(); + } + + @PostMapping("/disabiltycertificategersave") + public String saveDisabilityCertificateMaster( + @RequestBody Map req) { + service.saveDisabilityCertificateMaster(req); + return "SUCCESS"; + } + + @PostMapping("/disabiltycertificate-status") + public String updateDisabilityCertificateMasterStatus( + @RequestBody Map req) { + service.updateDisabilityCertificateMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/healthconditionlist") + public List> getHealthConditionList() { + return service.getHealthConditionList(); + } + + @PostMapping("/healthconditionsave") + public String saveHealthCondition( + @RequestBody Map req) { + service.saveHealthCondition(req); + return "SUCCESS"; + } + + @PostMapping("/healthcondition-status") + public String updateHealthConditionStatus( + @RequestBody Map req) { + service.updateHealthConditionStatus(req); + return "SUCCESS"; + } + + @GetMapping("/educationmasterlist") + public List> getEducationMasterList() { + return service.getEducationMasterList(); + } + + @PostMapping("/educationsave") + public String saveEducationMaster( + @RequestBody Map req) { + service.saveEducationMaster(req); + return "SUCCESS"; + } + + @PostMapping("/education-status") + public String updateEducationMasterStatus( + @RequestBody Map req) { + service.updateEducationMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/discontinuedlist") + public List> getDiscontinuedList() { + return service.getDiscontinuedList(); + } + + @PostMapping("/discontinuedsave") + public String saveDiscontinuedMaster( + @RequestBody Map req) { + service.saveDiscontinuedMaster(req); + return "SUCCESS"; + } + + @PostMapping("/discontinued-status") + public String updateDiscontinuedMasterStatus( + @RequestBody Map req) { + service.updateDiscontinuedMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/employmenttypelist") + public List> getEmploymentTypeList() { + return service.getEmploymentTypeList(); + } + + @PostMapping("/employmenttypesave") + public String saveEmploymentType( + @RequestBody Map req) { + service.saveEmploymentType(req); + return "SUCCESS"; + } + + @PostMapping("/employmenttype-status") + public String updateEmploymentTypeStatus( + @RequestBody Map req) { + service.updateEmploymentTypeStatus(req); + return "SUCCESS"; + } + + @GetMapping("/occupationlist") + public List> getOccupationList() { + return service.getOccupationList(); + } + + @PostMapping("/occupationsave") + public String saveOccupation( + @RequestBody Map req) { + service.saveOccupation(req); + return "SUCCESS"; + } + + @PostMapping("/occupation-status") + public String updateOccupationStatus( + @RequestBody Map req) { + service.updateOccupationStatus(req); + return "SUCCESS"; + } + + @GetMapping("/notemployedlist") + public List> getNotEmployedList() { + return service.getNotEmployedList(); + } + + @PostMapping("/notemployedsave") + public String saveNotEmployed( + @RequestBody Map req) { + service.saveNotEmployed(req); + return "SUCCESS"; + } + + @PostMapping("/notemployed-status") + public String updateNotEmployedStatus( + @RequestBody Map req) { + service.updateNotEmployedStatus(req); + return "SUCCESS"; + } + + @GetMapping("/homelessreasonmasterlist") + public List> getReasonHomelessList() { + return service.getReasonHomelessList(); + } + + @PostMapping("/homelessreasonmasterlist") + public String saveReasonHomeless( + @RequestBody Map req) { + service.saveHomelessReason(req); + return "SUCCESS"; + } + + @PostMapping("/homelessreasonmaster-status") + public String updateHomelessReasonStatus( + @RequestBody Map req) { + service.updateHomelessReasonStatus(req); + return "SUCCESS"; + } + + @GetMapping("/sleepingspacemasterlist") + public List> getSleepingSpaceList() { + return service.getSleepingSpaceList(); + } + + @PostMapping("/sleepingspacesave") + public String saveSleepingSpace( + @RequestBody Map req) { + service.saveSleepingSpace(req); + return "SUCCESS"; + } + + @PostMapping("/sleepingspace-status") + public String updateSleepingSpaceStatus( + @RequestBody Map req) { + service.updateSleepingSpaceStatus(req); + return "SUCCESS"; + } + + @GetMapping("/movingreasonmasterlist") + public List> getMovingReasonList() { + return service.getMovingReasonList(); + } + + @PostMapping("/movingreasonmasterdatasave") + public String saveMovingReason( + @RequestBody Map req) { + service.saveMovingReason(req); + return "SUCCESS"; + } + + @PostMapping("/movingreasonmasterdata-status") + public String updateMovingReasonStatus( + @RequestBody Map req) { + service.updateMovingReasonStatus(req); + return "SUCCESS"; + } + + @GetMapping("/comeoutsheltermasterlist") + public List> getComeOutShelterList() { + return service.getComeOutShelterList(); + } + + @PostMapping("/comeoutsheltersave") + public String saveComeOutShelter( + @RequestBody Map req) { + service.saveComeOutShelter(req); + return "SUCCESS"; + } + + @PostMapping("/comeoutshelter-status") + public String updateComeOutShelterStatus( + @RequestBody Map req) { + service.updateComeOutShelterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/gccsheltermasterlist") + public List> getGCCShelterMasterList() { + return service.getGCCShelterMasterList(); + } + + @PostMapping("/gccsheltermasterdatasave") + public String saveGCCShelterMaster( + @RequestBody Map req) { + service.saveGCCShelterMaster(req); + return "SUCCESS"; + } + + @PostMapping("/gccsheltermasterdata-status") + public String updateGCCShelterMasterStatus( + @RequestBody Map req) { + service.updateGCCShelterMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/birthcertificatmasterlist") + public List> getBirthCertificateNoReasonMasterList() { + return service.getBirthCertificateNoReasonMasterList(); + } + + @PostMapping("/birthcertificatmasterdatasave") + public String saveBirthCertificateNoReasonMaster( + @RequestBody Map req) { + service.saveBirthCertificateNoReasonMaster(req); + return "SUCCESS"; + } + + @PostMapping("/birthcertificatmasterdata-status") + public String updateBirthCertificateNoReasonMasterStatus( + @RequestBody Map req) { + service.updateBirthCertificateNoReasonMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/communitymasterlist") + public List> getCommunityMasterList() { + return service.getCommunityMasterList(); + } + + @PostMapping("/communitycertmasterdatasave") + public String saveCommunityMaster( + @RequestBody Map req) { + service.saveCommunityMaster(req); + return "SUCCESS"; + } + + @PostMapping("/communitycertmasterdata-status") + public String updateCommunityMasterStatus( + @RequestBody Map req) { + service.updateCommunityMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/voteridmasterlist") + public List> getVoterIdMasterList() { + return service.getVoterIdMasterList(); + } + + @PostMapping("/voteridmastersave") + public String saveVoterIdMaster( + @RequestBody Map req) { + service.saveVoterIdMaster(req); + return "SUCCESS"; + } + + @PostMapping("/voteridmaster-status") + public String updateVoterIdMasterStatus( + @RequestBody Map req) { + service.updateVoterIdMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/aadharnoreasonlst") + public List> getAadharCertificateNoReasonMasterList() { + return service.getAadharCertificateNoReasonMasterList(); + } + + @PostMapping("/aadharnoreasonsave") + public String saveAadharCertificateNoReasonMaster( + @RequestBody Map req) { + service.saveAadharCertificateNoReasonMaster(req); + return "SUCCESS"; + } + + @PostMapping("/aadharnoreason-status") + public String updateAadharCertificateNoReasonMasterStatus( + @RequestBody Map req) { + service.updateAadharCertificateNoReasonMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/smartcardnoreasonmasterlist") + public List> getSmartCardNoReasonMasterList() { + return service.getSmartCardNoReasonMasterList(); + } + + @PostMapping("/smartcardnoreasonsave") + public String saveSmartCardNoReasonMaster( + @RequestBody Map req) { + service.saveSmartCardNoReasonMaster(req); + return "SUCCESS"; + } + + @PostMapping("/smartcardnoreasonstatus") + public String updateSmartCardNoReasonMasterStatus( + @RequestBody Map req) { + service.updateSmartCardNoReasonMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/driverlicensemasterlist") + public List> getDriverLicenseNoReasonMasterList() { + return service.getDriverLicenseNoReasonMasterList(); + } + + @PostMapping("/driverlicensesave") + public String saveDriverLicenseNoReasonMaster( + @RequestBody Map req) { + service.saveDriverLicenseNoReasonMaster(req); + return "SUCCESS"; + } + + @PostMapping("/driverlicense-status") + public String updateDriverLicenseNoReasonMasterStatus( + @RequestBody Map req) { + service.updateDriverLicenseNoReasonMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/cminsurancemasterlist") + public List> getCmInsuranceNoReasonMasterList() { + return service.getCmInsuranceNoReasonMasterList(); + } + + @PostMapping("/cminsurancesave") + public String saveCmInsuranceNoReasonMaster( + @RequestBody Map req) { + service.saveCmInsuranceNoReasonMaster(req); + return "SUCCESS"; + } + + @PostMapping("/cminsurance-status") + public String updateCmInsuranceNoReasonMasterStatus( + @RequestBody Map req) { + service.updateCmInsuranceNoReasonMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/bankpassbookreasonmasterlist") + public List> getBankPassbookNoReasonMasterList() { + return service.getBankPassbookNoReasonMasterList(); + } + + @PostMapping("/bankpassbookreasonmaster-save") + public String saveBankPassbookNoReasonMaster( + @RequestBody Map req) { + service.saveBankPassbookNoReasonMaster(req); + return "SUCCESS"; + } + + @PostMapping("/bankpassbookreasonmasterstatus") + public String updateBankPassbookNoReasonMasterStatus( + @RequestBody Map req) { + service.updateBankPassbookNoReasonMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/religionmasterlist") + public List> getReligionMasterList() { + return service.getReligionMasterList(); + } + + @PostMapping("/religionmasterdatasave") + public String saveReligionMaster( + @RequestBody Map req) { + service.saveReligionMaster(req); + return "SUCCESS"; + } + + @PostMapping("/religionmasterdata-status") + public String updateReligionMasterStatus( + @RequestBody Map req) { + service.updateReligionMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/castemasterlist") + public List> getCasteMasterList() { + return service.getCasteMasterList(); + } + + @PostMapping("/castemasterdatasave") + public String saveCasteMaster( + @RequestBody Map req) { + service.saveCasteMaster(req); + return "SUCCESS"; + } + + @PostMapping("/castemasterdata-status") + public String updateCasteMasterStatus( + @RequestBody Map req) { + service.updateCasteMasterStatus(req); + return "SUCCESS"; + } + + @GetMapping("/dashboard") + public ResponseEntity> getDashboard() { + + return ResponseEntity.ok( + service.getDashboard()); + } + + @GetMapping("/zone-wise") + public ResponseEntity>> getZoneWiseCount() { + + return ResponseEntity.ok( + service.getZoneWiseCount()); + } + + @GetMapping("/ward-wise") + public ResponseEntity>> getWardWiseCount( + @RequestParam String zone) { + + return ResponseEntity.ok( + service.getWardWiseCount(zone)); + } + +} diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java new file mode 100644 index 00000000..839a6861 --- /dev/null +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Controller/MainController.java @@ -0,0 +1,168 @@ +package in.gov.chennaicorporation.gccoffice.homelesssurvey.Controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller("HomelessSurveyController") +@RequestMapping("/gcc/homelesssurvey") +public class MainController { + + @GetMapping("/homelesslist/surveyedlist") + public String surveyedlist() { + return "modules/homelesssurvey/homelesslist"; + } + + @GetMapping("/homelesslist/nonsurveyedlist") + public String nonsurveyedlist() { + return "modules/homelesssurvey/nonsurveyedhomelist"; + } + + @GetMapping("/surveylist") + + public String surveylist() { + return "modules/homelesssurvey/surveyorlist"; + } + + @GetMapping("/surveyorsreports") + + public String surveyorsreports() { + return "modules/homelesssurvey/surveyorsreports"; + } + + @GetMapping("/homelesslist/gender") + public String gender() { + return "modules/homelesssurvey/gendermaster"; + } + + @GetMapping("/homelesslist/relationtype") + public String relationtype() { + return "modules/homelesssurvey/relationtype"; + } + + @GetMapping("/homelesslist/currentlyliving") + public String currentlyliving() { + return "modules/homelesssurvey/currentlyliving"; + } + + @GetMapping("/homelesslist/martial") + public String martialstatus() { + return "modules/homelesssurvey/martial"; + } + + @GetMapping("/homelesslist/disabilitytype") + public String disabilitytype() { + return "modules/homelesssurvey/disability"; + } + + @GetMapping("/homelesslist/diable") + public String disabiltycertificate() { + return "modules/homelesssurvey/disabiltycertificate"; + } + + @GetMapping("/homelesslist/healthcondition") + public String healthcondition() { + return "modules/homelesssurvey/healthcondition"; + } + + @GetMapping("/homelesslist/education") + public String education() { + return "modules/homelesssurvey/education"; + } + + @GetMapping("/homelesslist/discontinued") + public String discontinued() { + return "modules/homelesssurvey/discontinued"; + } + + @GetMapping("/homelesslist/employment") + public String employmenttype() { + return "modules/homelesssurvey/employmenttype"; + } + + @GetMapping("/homelesslist/occupation") + public String occupation() { + return "modules/homelesssurvey/occupation"; + } + + @GetMapping("/homelesslist/notemployed") + public String notemployed() { + return "modules/homelesssurvey/notemployed"; + } + + @GetMapping("/homelesslist/homeless") + public String homelessreason() { + return "modules/homelesssurvey/homelessreason"; + } + + @GetMapping("/homelesslist/sleepingspace") + public String sleepingspace() { + return "modules/homelesssurvey/sleepingspace"; + } + + @GetMapping("/homelesslist/moving") + public String movingreason() { + return "modules/homelesssurvey/movingreason"; + } + + @GetMapping("/homelesslist/comeoutshelter") + public String comeoutshelter() { + return "modules/homelesssurvey/comeoutshelter"; + } + + @GetMapping("/homelesslist/gccshelter") + public String gccshelter() { + return "modules/homelesssurvey/gccshelter"; + } + + @GetMapping("/homelesslist/birthcertificate") + public String birthcertficatenoreason() { + return "modules/homelesssurvey/birthcertficatenoreason"; + } + + @GetMapping("/homelesslist/communitycertificate") + public String communitycertificate() { + return "modules/homelesssurvey/communitynoreason"; + } + + @GetMapping("/homelesslist/votercertificate") + public String voterid() { + return "modules/homelesssurvey/voterid"; + } + + @GetMapping("/homelesslist/aadharcertificate") + public String aadhar() { + return "modules/homelesssurvey/aadhar"; + } + + @GetMapping("/homelesslist/smartcertificate") + public String smartcard() { + return "modules/homelesssurvey/smart"; + } + + @GetMapping("/homelesslist/drivercertificate") + public String driverlicense() { + return "modules/homelesssurvey/driver"; + } + + @GetMapping("/homelesslist/cmrcertificate") + public String cminsurance() { + return "modules/homelesssurvey/cminsurance"; + } + + @GetMapping("/homelesslist/bankpassbook") + public String bankpassbook() { + return "modules/homelesssurvey/bankpassbook"; + } + + @GetMapping("/homelesslist/religion") + public String religion() { + return "modules/homelesssurvey/religion"; + } + + @GetMapping("/homelesslist/caste") + public String caste() { + return "modules/homelesssurvey/caste"; + } + +} diff --git a/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java new file mode 100644 index 00000000..b3fffed1 --- /dev/null +++ b/gcc_officer_portal/src/main/java/in/gov/chennaicorporation/gccoffice/homelesssurvey/Service/HomelessSurveyService.java @@ -0,0 +1,4103 @@ +package in.gov.chennaicorporation.gccoffice.homelesssurvey.Service; + +import java.nio.file.Path; +import java.sql.PreparedStatement; +import java.sql.Timestamp; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import java.nio.file.Files; +import javax.sql.DataSource; +import java.nio.file.Paths; +import java.awt.image.BufferedImage; +import javax.imageio.ImageIO; +import java.io.ByteArrayInputStream; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; +import org.springframework.dao.DataAccessException; +import org.springframework.dao.EmptyResultDataAccessException; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.support.GeneratedKeyHolder; +import org.springframework.jdbc.support.KeyHolder; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import javax.imageio.ImageWriteParam; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageOutputStream; +import java.sql.Statement; +import in.gov.chennaicorporation.gccoffice.controller.DateTimeUtil; +import in.gov.chennaicorporation.gccoffice.nulm.repository.NulmRepository; + +@Service +public class HomelessSurveyService { + @Autowired + @Value("${fileBaseUrl}") + + private String fileBaseUrl; + + @Autowired + private JdbcTemplate jdbcTemplate; + @Autowired + private Environment environment; + + @Autowired + public void setDataSource(@Qualifier("mysqlHomelessSurveyDataSource") DataSource dataSource) { + this.jdbcTemplate = new JdbcTemplate(dataSource); + } + + public HomelessSurveyService(Environment environment) { + + this.environment = environment; + + this.fileBaseUrl = environment.getProperty("fileBaseUrl"); + } + + public List> getHomelessSurveyList( + String zone, + String ward, + String fromDate, + String toDate) { + + StringBuilder sql = new StringBuilder(""" + + SELECT + + DATE(MAX(hr.cdate)) AS survey_date, + + hr.survey_id, + + MAX(CASE + WHEN hr.qid = 2 + THEN hr.answer + END) AS name, + + MAX( + CASE + WHEN hr.qid = 7 + THEN CASE + WHEN hr.others_answer IS NOT NULL + AND TRIM(hr.others_answer) <> '' + THEN hr.others_answer + ELSE gm.english_name + END + END + ) AS gender, + + sld.zone AS zone, + + sld.ward AS ward + + FROM homeless_survey_response hr + + LEFT JOIN gender_master gm + ON hr.qid = 7 + AND gm.id = hr.answer + + LEFT JOIN surveyor_location_details sld + ON sld.survey_id = hr.survey_id + + + + + WHERE hr.isactive = 1 + AND hr.isdelete = 0 + AND NOT EXISTS ( + SELECT 1 + FROM homeless_survey_response hr2 + INNER JOIN homeless_survey_questions_master hqm2 + ON hqm2.qid = hr2.qid + WHERE hr2.survey_id = hr.survey_id + AND hqm2.flag = 'N' + ) + + """); + + List params = new ArrayList<>(); + + if (zone != null && !zone.isBlank()) { + + sql.append(""" + AND CAST(sld.zone AS UNSIGNED) = ? + """); + + params.add(zone); + } + + if (ward != null && !ward.isBlank()) { + + sql.append(""" + AND CAST(sld.ward AS UNSIGNED) = ? + """); + + params.add(ward); + } + + if (fromDate != null && !fromDate.isBlank() + && toDate != null && !toDate.isBlank()) { + + sql.append(""" + AND DATE(hr.cdate) BETWEEN ? AND ? + """); + + params.add(fromDate); + params.add(toDate); + } + + sql.append(""" + + GROUP BY + + hr.survey_id, + sld.zone, + sld.ward + + ORDER BY + + MAX(hr.cdate) DESC + + """); + + return jdbcTemplate.queryForList( + sql.toString(), + params.toArray()); + } + + public List> getZones() { + + String sql = """ + + SELECT + + id, + zone_name + FROM gcc_street_vendor.zone_master + ORDER BY zone_name + + """; + + return jdbcTemplate.queryForList(sql); + } + + public List> getWards(String zoneId) { + + String sql = """ + + SELECT + id, + ward_name + FROM gcc_street_vendor.ward_master + WHERE zone_id = ? + ORDER BY ward_name + + """; + + return jdbcTemplate.queryForList( + sql, + zoneId); + } + + public List> getHomelessNonSurveyedList( + String zone, + String ward, + String fromDate, + String toDate) { + + StringBuilder sql = new StringBuilder( + + "SELECT " + + + "DATE(MAX(hr.cdate)) AS survey_date, " + + "hr.survey_id, " + + + "MAX(CASE " + + "WHEN hr.qid = 2 THEN hr.answer " + + "END) AS name, " + + + "MAX(CASE " + + "WHEN hr.qid = 78 THEN hr.answer " + + "END) AS age, " + + + "MAX(CASE " + + "WHEN hr.qid = 8 THEN hr.answer " + + "END) AS dob, " + + + "MAX(CASE " + + "WHEN hr.qid = 79 THEN hr.answer " + + "END) AS remarks, " + + + "IFNULL(MAX(CASE " + + "WHEN hr.qid = 77 " + + "THEN CONCAT('" + fileBaseUrl + "/gccofficialapp/files', hr.answer) " + + "END),'') AS image_url, " + + + "sld.zone AS zone, " + + "sld.ward AS ward " + + + "FROM homeless_survey_response hr " + + + "LEFT JOIN surveyor_location_details sld " + + "ON sld.survey_id = hr.survey_id " + + + "WHERE hr.isactive = 1 " + + "AND hr.isdelete = 0 " + + "AND EXISTS ( " + + "SELECT 1 " + + "FROM homeless_survey_response hr2 " + + "INNER JOIN homeless_survey_questions_master hqm2 " + + "ON hqm2.qid = hr2.qid " + + "WHERE hr2.survey_id = hr.survey_id " + + "AND hqm2.flag = 'N')"); + + List params = new ArrayList<>(); + + if (zone != null && !zone.isBlank()) { + + sql.append( + " AND CAST(sld.zone AS UNSIGNED) = ? "); + + params.add(Integer.parseInt(zone)); + } + + if (ward != null && !ward.isBlank()) { + + sql.append( + " AND CAST(sld.ward AS UNSIGNED) = ? "); + + params.add(Integer.parseInt(ward)); + } + + if (fromDate != null + && !fromDate.isBlank() + && toDate != null + && !toDate.isBlank()) { + + sql.append( + " AND DATE(hr.cdate) BETWEEN ? AND ? "); + + params.add(fromDate); + params.add(toDate); + } + + sql.append( + + " GROUP BY " + + " hr.survey_id, " + + " sld.zone, " + + " sld.ward " + + + " ORDER BY MAX(hr.cdate) DESC "); + + return jdbcTemplate.queryForList( + sql.toString(), + params.toArray()); + } + + public List> getHomelessSurveyDetails( + String surveyId) { + + String sql = + + "SELECT " + + + "hqm.cid, " + + "qcm.english_name AS category_name, " + + + "hqm.qid, " + + "hqm.q_english AS question, " + + "hqm.question_type, " + + "hqm.master_table_name, " + + + "CASE " + + + "WHEN hqm.question_type = 'image' " + + "THEN CONCAT('" + fileBaseUrl + "/gccofficialapp/files', hr.answer) " + + + "WHEN hr.others_answer IS NOT NULL " + + "AND TRIM(hr.others_answer) <> '' " + + "THEN hr.others_answer " + + + "WHEN hqm.question_type = 'radio' " + + "THEN ham.answer " + + + "ELSE hr.answer " + + + "END AS answer " + + + "FROM homeless_survey_response hr " + + + "INNER JOIN homeless_survey_questions_master hqm " + + "ON hqm.qid = hr.qid " + + + "LEFT JOIN question_category_master qcm " + + "ON qcm.id = hqm.cid " + + + "LEFT JOIN homeless_survey_answer_master ham " + + "ON ham.qid = hr.qid " + + "AND ham.id = CAST(hr.answer AS UNSIGNED) " + + + "WHERE hr.survey_id = ? " + + "AND hr.isactive = 1 " + + "AND hr.isdelete = 0 " + + + "ORDER BY hqm.cid, hqm.orderby"; + + List> result = jdbcTemplate.queryForList( + sql, + surveyId); + + for (Map row : result) { + + String questionType = row.get("question_type") == null + ? "" + : row.get("question_type").toString(); + + String masterTable = row.get("master_table_name") == null + ? "" + : row.get("master_table_name").toString(); + + /* + * String answer = row.get("answer") == null + * ? "" + * : row.get("answer").toString(); + */ + String answer = row.get("answer") == null + ? "" + : row.get("answer").toString().trim(); + + try { + + // DROPDOWN + if ("dropdown".equalsIgnoreCase(questionType) + && !masterTable.isBlank() + && answer.matches("\\d+")) { + + String valueSql = "SELECT english_name FROM " + + masterTable + + " WHERE id = ?"; + + String value = jdbcTemplate.queryForObject( + valueSql, + String.class, + Integer.parseInt(answer)); + + row.put("answer", value); + } + + // CHECKBOX / MULTICHECK + else if (("checkbox".equalsIgnoreCase(questionType) + || "multicheck".equalsIgnoreCase(questionType)) + && !masterTable.isBlank() + && !answer.isBlank()) { + + String[] ids = answer.split(","); + + StringBuilder placeholders = new StringBuilder(); + + for (int i = 0; i < ids.length; i++) { + + placeholders.append("?"); + + if (i < ids.length - 1) { + placeholders.append(","); + } + } + + String checkboxSql = "SELECT english_name FROM " + + masterTable + + " WHERE id IN (" + + placeholders + + ") ORDER BY id"; + + List values = jdbcTemplate.query( + checkboxSql, + ids, + (rs, rowNum) -> rs.getString("english_name")); + + row.put( + "answer", + String.join(", ", values)); + } + + } catch (Exception e) { + + System.out.println( + "Master value fetch failed for qid : " + + row.get("qid")); + } + } + + return result; + } + + public List> getSurveyDocuments(String surveyId) { + + String sql = + + "SELECT " + + + "hr.survey_id, " + + + "(" + + " SELECT q2.q_english " + + " FROM homeless_survey_questions_master q2 " + + " WHERE q2.cid = hqm.cid " + + " AND q2.question_type = 'radio' " + + " AND q2.orderby < hqm.orderby " + + " ORDER BY q2.orderby DESC " + + " LIMIT 1 " + + ") AS document_name, " + + + "CONCAT('" + fileBaseUrl + + "/gccofficialapp/files', hr.answer) AS file_url " + + + "FROM homeless_survey_response hr " + + + "INNER JOIN homeless_survey_questions_master hqm " + + "ON hqm.qid = hr.qid " + + + "WHERE hr.survey_id = ? " + + "AND hqm.cid = 5 " + + "AND hqm.question_type = 'image' " + + + "ORDER BY hqm.orderby"; + + return jdbcTemplate.queryForList( + sql, + surveyId); + } + + /* + * public List> getSurveyDocuments(String surveyId) { + * + * String sql = "SELECT " + + * "hr.survey_id, " + + * "hqm.q_english, " + + * "CONCAT('" + fileBaseUrl + + * "/gccofficialapp/files', hr.answer) AS file_url " + + * + * "FROM homeless_survey_response hr " + + * + * "INNER JOIN homeless_survey_questions_master hqm " + + * "ON hqm.qid = hr.qid " + + * + * "WHERE hr.survey_id = ? " + + * "AND hqm.cid = 5 " + + * "AND hqm.question_type = 'image'"; + * + * return jdbcTemplate.queryForList(sql, surveyId); + * } + */ + public List> getCategories() { + + String sql = + + "SELECT " + + "id, " + + "english_name, " + + "orderby " + + + "FROM question_category_master " + + + "WHERE isactive = 1 " + + "AND isdelete = 0 " + + + "ORDER BY orderby"; + + return jdbcTemplate.queryForList(sql); + } + + public List> getSurveyorsList( + + String zone, + String ward, + String fromDate, + String toDate) { + + StringBuilder sql = new StringBuilder(""" + + SELECT + + d.user_name, + d.mobile_no, + sl.loginId, + + sl.zone, + sl.ward, + + COUNT(DISTINCT hs.survey_id) + AS total_survey_done, + + DATE(hs.cdate) + AS survey_date + + FROM homeless_survey_response hs + + INNER JOIN surveyor_location_details sl + ON sl.survey_id = hs.survey_id + + INNER JOIN login_details d + ON d.uid = sl.loginId + + WHERE 1 = 1 + + """); + + List params = new ArrayList<>(); + + if (zone != null && !zone.isEmpty()) { + + sql.append(""" + AND CAST(sl.zone AS UNSIGNED) = ? + """); + + params.add(zone); + } + + if (ward != null && !ward.isEmpty()) { + + sql.append(""" + AND CAST(sl.ward AS UNSIGNED) = ? + """); + + params.add(ward); + } + + if (fromDate != null + && toDate != null + && !fromDate.isEmpty() + && !toDate.isEmpty()) { + + sql.append(""" + AND DATE(hs.cdate) + BETWEEN ? AND ? + """); + + params.add(fromDate); + params.add(toDate); + } + + sql.append(""" + + GROUP BY + + d.user_name, + d.mobile_no, + sl.loginId, + sl.zone, + sl.ward, + DATE(hs.cdate) + + ORDER BY DATE(hs.cdate) DESC + + """); + + return jdbcTemplate.queryForList( + sql.toString(), + params.toArray()); + } + + public List> getSurveyorWiseSurveyList( + String loginId, + String zone, + String ward, + String surveyDate) { + + StringBuilder sql = new StringBuilder(""" + + SELECT + + DATE(MAX(hr.cdate)) AS survey_date, + + hr.survey_id, + + MAX(CASE + WHEN hr.qid = 2 + THEN hr.answer + END) AS name, + MAX( + CASE + WHEN hr.qid = 7 + THEN CASE + WHEN hr.others_answer IS NOT NULL + AND TRIM(hr.others_answer) <> '' + THEN hr.others_answer + ELSE gm.english_name + END + END + ) AS gender, + + + + sld.zone AS zone, + + sld.ward AS ward + + FROM homeless_survey_response hr + + LEFT JOIN gender_master gm + ON hr.qid = 7 + AND gm.id = hr.answer + + LEFT JOIN surveyor_location_details sld + ON sld.survey_id = hr.survey_id + + WHERE hr.isactive = 1 + AND hr.isdelete = 0 + AND sld.loginId = ? + + """); + + List params = new ArrayList<>(); + params.add(loginId); + /* + * MAX(CASE + * WHEN hr.qid = 7 + * THEN gm.english_name + * END) AS gender, + */ + + if (zone != null && !zone.isBlank()) { + + sql.append(""" + AND sld.zone = ? + """); + + params.add(zone); + } + + if (ward != null && !ward.isBlank()) { + + sql.append(""" + AND sld.ward = ? + """); + + params.add(ward); + } + + if (surveyDate != null && !surveyDate.isBlank()) { + + sql.append(""" + AND DATE(hr.cdate) = ? + """); + + params.add(surveyDate); + } + + sql.append(""" + + GROUP BY + + hr.survey_id, + sld.zone, + sld.ward + + ORDER BY + + MAX(hr.cdate) DESC + + """); + + return jdbcTemplate.queryForList( + sql.toString(), + params.toArray()); + } + + public List> getBulkExcelData(String zone, + String ward, + String fromDate, + String toDate) { + + String sql = "SELECT " + + " hs.survey_id, " + + " qm.q_english, " + + " hs.answer " + + "FROM homeless_survey_response hs " + + "INNER JOIN homeless_survey_questions_master qm " + + " ON qm.qid = hs.qid " + + "INNER JOIN surveyor_location_details sl " + + " ON sl.survey_id = hs.survey_id " + + "WHERE hs.isactive = 1 " + + "AND hs.isdelete = 0 "; + + List params = new ArrayList<>(); + + if (zone != null && !zone.isEmpty()) { + sql += " AND sl.zone = ? "; + params.add(zone); + } + + if (ward != null && !ward.isEmpty()) { + sql += " AND sl.ward = ? "; + params.add(ward); + } + + if (fromDate != null && !fromDate.isEmpty()) { + sql += " AND DATE(hs.cdate) >= ? "; + params.add(fromDate); + } + + if (toDate != null && !toDate.isEmpty()) { + sql += " AND DATE(hs.cdate) <= ? "; + params.add(toDate); + } + + sql += " ORDER BY hs.survey_id,qm.orderby "; + + List> rows = jdbcTemplate.queryForList(sql, params.toArray()); + + Map> surveyMap = new LinkedHashMap<>(); + + for (Map row : rows) { + + String surveyId = String.valueOf(row.get("survey_id")); + + String question = String.valueOf(row.get("q_english")); + + String answer = row.get("answer") == null ? "" : String.valueOf(row.get("answer")); + + surveyMap.putIfAbsent( + surveyId, + new LinkedHashMap<>()); + + surveyMap.get(surveyId) + .put("Survey ID", surveyId); + + surveyMap.get(surveyId) + .put(question, answer); + } + + return new ArrayList<>(surveyMap.values()); + } + + public List> getGenderList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM gender_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveGender(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE gender_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM gender_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO gender_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateGenderStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE gender_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getRelationTypeList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM relation_type_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveRelationType(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE relation_type_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM relation_type_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO relation_type_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateRelationTypeStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE relation_type_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getCurrentlyLivingList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM current_living_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveCurrentlyLiving(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE current_living_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM current_living_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO current_living_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateCurrentlyLivingStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE current_living_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getMartialList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM martial_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveMartial(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE martial_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM martial_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO martial_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateMartialStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE martial_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getDisabilityTypeList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM disability_type_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveDisabilityType(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE disability_type_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM disability_type_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO disability_type_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateDisabilityTypeStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE disability_type_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getDisabilityCertificateMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM disable_cert_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveDisabilityCertificateMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE disable_cert_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM disable_cert_no_reason_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO disable_cert_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateDisabilityCertificateMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE disable_cert_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getHealthConditionList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM health_condition_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveHealthCondition(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE health_condition_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM health_condition_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO health_condition_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateHealthConditionStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE health_condition_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getEducationMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM education_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveEducationMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE education_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM education_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO education_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateEducationMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE education_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getDiscontinuedList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM discontinued_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveDiscontinuedMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE discontinued_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM discontinued_reason_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO discontinued_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateDiscontinuedMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE discontinued_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getEmploymentTypeList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM employment_type_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveEmploymentType(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE employment_type_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM employment_type_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO employment_type_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateEmploymentTypeStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE employment_type_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getOccupationList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM occupation_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveOccupation(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE occupation_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM occupation_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO occupation_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateOccupationStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE occupation_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getNotEmployedList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM not_employed_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveNotEmployed(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE not_employed_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM not_employed_reason_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO not_employed_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateNotEmployedStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE not_employed_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getReasonHomelessList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM reason_homeless_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveHomelessReason(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE reason_homeless_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM reason_homeless_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO reason_homeless_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateHomelessReasonStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE reason_homeless_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getSleepingSpaceList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM sleepingspace_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveSleepingSpace(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE sleepingspace_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM sleepingspace_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO sleepingspace_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateSleepingSpaceStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE sleepingspace_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getMovingReasonList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM reason_moving_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveMovingReason(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE reason_moving_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM reason_moving_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO reason_moving_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateMovingReasonStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE reason_moing_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getComeOutShelterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM reason_comeoutshelter_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveComeOutShelter(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE reason_comeoutshelter_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM reason_comeoutshelter_master + + """, + Integer.class); + + String insertSql = """ + + INSERT INTO reason_comeoutshelter_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateComeOutShelterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE reason_comeoutshelter_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getGCCShelterMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM gccshelter_notstayed_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveGCCShelterMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE gccshelter_notstayed_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM gccshelter_notstayed_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO gccshelter_notstayed_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateGCCShelterMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE gccshelter_notstayed_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getBirthCertificateNoReasonMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM birth_cert_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveBirthCertificateNoReasonMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE birth_cert_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM birth_cert_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO birth_cert_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateBirthCertificateNoReasonMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE birth_cert_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getCommunityMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM commu_cert_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveCommunityMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE commu_cert_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM commu_cert_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO commu_cert_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateCommunityMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE commu_cert_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getVoterIdMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM voter_id_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveVoterIdMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE voter_id_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM voter_id_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO voter_id_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateVoterIdMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE voter_id_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getAadharCertificateNoReasonMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM adhar_card_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveAadharCertificateNoReasonMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE adhar_card_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM adhar_card_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO adhar_card_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateAadharCertificateNoReasonMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE adhar_card_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getSmartCardNoReasonMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM smart_card_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveSmartCardNoReasonMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE smart_card_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM smart_card_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO smart_card_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateSmartCardNoReasonMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE smart_card_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getDriverLicenseNoReasonMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM dri_license_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveDriverLicenseNoReasonMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE dri_license_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM dri_license_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO dri_license_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateDriverLicenseNoReasonMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE dri_license_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getCmInsuranceNoReasonMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM cm_insurance_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveCmInsuranceNoReasonMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE cm_insurance_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM cm_insurance_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO cm_insurance_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateCmInsuranceNoReasonMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE cm_insurance_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getBankPassbookNoReasonMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM bank_passbook_no_reason_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveBankPassbookNoReasonMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE bank_passbook_no_reason_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM bank_passbook_no_reason_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO bank_passbook_no_reason_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateBankPassbookNoReasonMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE bank_passbook_no_reason_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getReligionMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM religion_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveReligionMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE religion_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM religion_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO religion_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateReligionMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE religion_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getCasteMasterList() { + + String sql = """ + + SELECT + id, + english_name, + isactive, + isdelete + FROM caste_master + WHERE isactive = 1 + AND isdelete = 0 + ORDER BY orderby + + """; + + return jdbcTemplate.queryForList(sql); + } + + public void saveCasteMaster(Map req) { + + Integer id = req.get("id") != null + ? Integer.parseInt(req.get("id").toString()) + : 0; + + // UPDATE + if (id > 0) { + + String updateSql = """ + + UPDATE caste_master + SET english_name = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + updateSql, + req.get("english_name"), + id); + } + + // INSERT + else { + + Integer nextOrder = jdbcTemplate.queryForObject( + """ + + SELECT IFNULL(MAX(orderby),0) + 1 + FROM caste_master + """, + Integer.class); + + String insertSql = """ + + INSERT INTO caste_master + ( + english_name, + orderby, + + isactive, + isdelete + ) + VALUES + ( + ?, + ?, + + 1, + 0 + ) + + """; + + jdbcTemplate.update( + insertSql, + req.get("english_name"), + nextOrder); + } + } + + public void updateCasteMasterStatus( + Map req) { + + Integer id = Integer.parseInt( + req.get("id").toString()); + + Integer status = Integer.parseInt( + req.get("status").toString()); + + String sql = """ + + UPDATE caste_master + SET + isactive = ?, + isdelete = ? + WHERE id = ? + + """; + + jdbcTemplate.update( + sql, + status, + status == 1 ? 0 : 1, + id); + } + + public List> getZoneWiseCount() { + + String sql = + + "SELECT " + + + "zm.zone_name AS zone, " + + + "COUNT(DISTINCT sld.survey_id) AS total " + + + "FROM gcc_street_vendor.zone_master zm " + + + "LEFT JOIN surveyor_location_details sld " + + "ON sld.zone = zm.zone_name " + + + "GROUP BY zm.zone_name " + + + "ORDER BY CAST(zm.zone_name AS UNSIGNED)"; + + return jdbcTemplate.queryForList(sql); + } + + public List> getWardWiseCount( + String zone) { + + String sql = + + "SELECT " + + + "wm.ward_name AS ward, " + + + "COUNT(DISTINCT sld.survey_id) AS total " + + + "FROM gcc_street_vendor.ward_master wm " + + + "LEFT JOIN surveyor_location_details sld " + + "ON sld.zone = wm.zone_id " + + "AND sld.ward = wm.ward_name " + + + "WHERE wm.zone_id = ? " + + + "GROUP BY wm.ward_name " + + + "ORDER BY CAST(wm.ward_name AS UNSIGNED)"; + + return jdbcTemplate.queryForList( + sql, + zone); + } + + public Map getDashboard() { + + Map response = new HashMap<>(); + + response.put( + "totalHomeless", + getTotalHomeless()); + + response.put( + "zonesCovered", + getZonesCovered()); + + response.put( + "maleCount", + getMaleCount()); + + response.put( + "femaleCount", + getFemaleCount()); + + response.put( + "othersCount", + getOthersCount()); + + response.put( + "zoneWise", + getZoneWiseCount()); + + response.put( + "casteWise", + getCasteWiseCount()); + response.put( + "employedCount", + getEmployedCount()); + + response.put( + "unEmployedCount", + getUnEmployedCount()); + + response.put( + "shelterStayedYes", + getShelterStayedYesCount()); + + response.put( + "shelterStayedNo", + getShelterStayedNoCount()); + response.put( + "youngAdults", + getYoungAdultsCount()); + + response.put( + "middleAgedAdults", + getMiddleAgedCount()); + + response.put( + "olderAdults", + getOlderAdultsCount()); + + return response; + } + + private int getShelterStayedNoCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 44 " + + + "AND answer = '17' " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getShelterStayedYesCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 44 " + + + "AND answer = '16' " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getUnEmployedCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 27 " + + + "AND answer = '13' " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getEmployedCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 27 " + + + "AND answer = '12' " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getOlderAdultsCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 78 " + + + "AND CAST(answer AS UNSIGNED) >= 55 " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getYoungAdultsCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 78 " + + + "AND CAST(answer AS UNSIGNED) BETWEEN 18 AND 34 " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + public Integer getDocumentCount(String surveyId) { + + String sql = """ + + SELECT COUNT(*) + + FROM homeless_survey_response + + WHERE survey_id = ? + + AND qid IN (50,53,56,59,62,65,68,71) + + AND answer IS NOT NULL + + AND TRIM(answer) <> '' + + AND isactive = 1 + + AND isdelete = 0 + + """; + + return jdbcTemplate.queryForObject( + sql, + Integer.class, + surveyId); + } + + private int getMiddleAgedCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 78 " + + + "AND CAST(answer AS UNSIGNED) BETWEEN 35 AND 54 " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getMiddleAgedCount1() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + + "FROM homeless_survey_response " + + + "WHERE qid = 78 " + + + "AND CAST(answer AS UNSIGNED) BETWEEN 35 AND 54 " + + + "AND isactive = 1 " + + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getTotalHomeless() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + "FROM homeless_survey_response " + + "WHERE isactive = 1 " + + "AND isdelete = 0"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getZonesCovered() { + + String sql = + + "SELECT COUNT(DISTINCT zone) " + + "FROM surveyor_location_details"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + public List> getCasteWiseCount() { + + String sql = + + "SELECT " + + + "cm.id, " + + + "cm.english_name AS caste, " + + + "COALESCE(COUNT(DISTINCT hr.survey_id), 0) AS total " + + + "FROM caste_master cm " + + + "LEFT JOIN homeless_survey_response hr " + + + "ON hr.qid = 13 " + + + "AND CAST(hr.answer AS UNSIGNED) = cm.id " + + + "AND hr.isactive = 1 " + + + "AND hr.isdelete = 0 " + + + "WHERE cm.isactive = 1 " + + + "AND cm.isdelete = 0 " + + + "GROUP BY cm.id, cm.english_name " + + + "ORDER BY cm.orderby"; + + return jdbcTemplate.queryForList(sql); + } + + private int getMaleCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + "FROM homeless_survey_response " + + "WHERE qid = 7 " + + "AND answer = '1'"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getFemaleCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + "FROM homeless_survey_response " + + "WHERE qid = 7 " + + "AND answer = '2'"; + + return jdbcTemplate.queryForObject( + sql, + Integer.class); + } + + private int getOthersCount() { + + String sql = + + "SELECT COUNT(DISTINCT survey_id) " + + "FROM homeless_survey_response " + + "WHERE qid = 7 " + + "AND answer = '3'"; + + Integer count = jdbcTemplate.queryForObject( + sql, + Integer.class); + + return count == null ? 0 : count; + } + +} diff --git a/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/childlist.html b/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/childlist.html index 94122e60..9617f94e 100644 --- a/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/childlist.html +++ b/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/childlist.html @@ -1058,7 +1058,10 @@ tbody += ` - ${formatDate(row.survey_date)} + + + ${formatDate(row.survey_date)} + ${row.survey_id || ''} ${row.child_name || ''} diff --git a/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/nonchildlist.html b/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/nonchildlist.html index e5a038db..46bada32 100644 --- a/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/nonchildlist.html +++ b/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/nonchildlist.html @@ -827,7 +827,10 @@ tbody += ` - ${formatDate(row.survey_date)} + + + ${formatDate(row.survey_date)} + ${row.survey_id || ''} diff --git a/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveylist.html b/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveylist.html index 7c2c175c..e00fa226 100644 --- a/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveylist.html +++ b/gcc_officer_portal/src/main/resources/templates/modules/childrensurvey/surveylist.html @@ -792,7 +792,10 @@ // ${item.survey_date || ''} rows += ` - ${formatDate(item.survey_date)} + + + ${formatDate(item.survey_date)} + ${item.user_name || ''} ${item.mobile_no || ''} diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/aadhar.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/aadhar.html new file mode 100644 index 00000000..549bc2c2 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/aadhar.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoAadhar No ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/bankpassbook.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/bankpassbook.html new file mode 100644 index 00000000..e1a59ca4 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/bankpassbook.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoBank Passbook No Reason NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html new file mode 100644 index 00000000..c71abc95 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/birthcertficatenoreason.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoBirth Certificate no ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/caste.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/caste.html new file mode 100644 index 00000000..20ff1581 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/caste.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoCaste NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/cminsurance.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/cminsurance.html new file mode 100644 index 00000000..8dfdb33d --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/cminsurance.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoCM Insurance No ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html new file mode 100644 index 00000000..ffbe2ba3 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/comeoutshelter.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoComing Out of ShelterStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/communitynoreason.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/communitynoreason.html new file mode 100644 index 00000000..bc05c339 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/communitynoreason.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoCommunity No Reason NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/currentlyliving.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/currentlyliving.html new file mode 100644 index 00000000..fc1a63a0 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/currentlyliving.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoCurrently Living NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disability.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disability.html new file mode 100644 index 00000000..2fe1248b --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disability.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoDisablity TypeStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html new file mode 100644 index 00000000..3d01ec35 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/disabiltycertificate.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoDisabilty Certificate NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/discontinued.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/discontinued.html new file mode 100644 index 00000000..46856b20 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/discontinued.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoDiscontinued ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/driver.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/driver.html new file mode 100644 index 00000000..eb2d3b18 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/driver.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoDriver License No ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/education.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/education.html new file mode 100644 index 00000000..8601ff1d --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/education.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoEducation NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/employmenttype.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/employmenttype.html new file mode 100644 index 00000000..dec98d3f --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/employmenttype.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoEmployment TypeStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gccshelter.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gccshelter.html new file mode 100644 index 00000000..19973853 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gccshelter.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoGCCShelter Not Stayed NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gendermaster.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gendermaster.html new file mode 100644 index 00000000..b9964d87 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/gendermaster.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoGender NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/healthcondition.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/healthcondition.html new file mode 100644 index 00000000..e60aa679 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/healthcondition.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoHealth Condition NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelesslist.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelesslist.html new file mode 100644 index 00000000..8eadaed2 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelesslist.html @@ -0,0 +1,2085 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + +
DateSurvey IDNameGenderZoneWardAction
+
+ +
+ + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelessreason.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelessreason.html new file mode 100644 index 00000000..8da2b584 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/homelessreason.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoHomeless Reason NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/martial.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/martial.html new file mode 100644 index 00000000..f75e2457 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/martial.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoMartial Status NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/movingreason.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/movingreason.html new file mode 100644 index 00000000..89f961a5 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/movingreason.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoMoving ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html new file mode 100644 index 00000000..1e7eb7a5 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/nonsurveyedhomelist.html @@ -0,0 +1,1007 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + +
DateSurvey IDNameAgeDOBZoneWardPhotoRemarks
+
+ +
+ + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/notemployed.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/notemployed.html new file mode 100644 index 00000000..8126ae7d --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/notemployed.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoNot Employed Reason NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/occupation.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/occupation.html new file mode 100644 index 00000000..b93a8642 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/occupation.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoOccupation NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/relationtype.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/relationtype.html new file mode 100644 index 00000000..0383ed5e --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/relationtype.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoRelation Type NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/religion.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/religion.html new file mode 100644 index 00000000..59a0ab15 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/religion.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoReligion NameStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/sleepingspace.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/sleepingspace.html new file mode 100644 index 00000000..62b47aae --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/sleepingspace.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoSleeping SpaceStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/smart.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/smart.html new file mode 100644 index 00000000..ec2df2ba --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/smart.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoSmart Card No ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorlist.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorlist.html new file mode 100644 index 00000000..e1db2384 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorlist.html @@ -0,0 +1,1257 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + +
DateSurveyor NameMobile NumberZoneWardTotal Survey DoneAction
+
+ +
+ + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html new file mode 100644 index 00000000..f71ade93 --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/surveyorsreports.html @@ -0,0 +1,1012 @@ + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+ + + + + + +
+ + +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/voterid.html b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/voterid.html new file mode 100644 index 00000000..fdd788ee --- /dev/null +++ b/gcc_officer_portal/src/main/resources/templates/modules/homelesssurvey/voterid.html @@ -0,0 +1,576 @@ + + + + + + + + + +
+
+ +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + +
SlnoVoterId No ReasonStatusDeleteEdit
+ +
+ + + + + + + + +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file