You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package in.gov.chennaicorporation.gccoffice.pensioner.service;
  2. import java.util.List;
  3. import java.util.Map;
  4. import javax.sql.DataSource;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.beans.factory.annotation.Qualifier;
  7. import org.springframework.jdbc.core.JdbcTemplate;
  8. import org.springframework.stereotype.Service;
  9. @Service
  10. public class DropdownService {
  11. @Autowired
  12. private JdbcTemplate jdbcTemplate;
  13. @Autowired
  14. public void setDataSource(@Qualifier("mysqlPensionerDataSource") DataSource dataSource) {
  15. this.jdbcTemplate = new JdbcTemplate(dataSource);
  16. }
  17. public List<Map<String, Object>> getRetrimentTypes() {
  18. String sql = "SELECT id,retriment_type FROM type_of_retriment";
  19. return jdbcTemplate.queryForList(sql);
  20. }
  21. public List<Map<String, Object>> getCategoryTypes() {
  22. String sql = "SELECT id,category_type FROM type_of_category";
  23. return jdbcTemplate.queryForList(sql);
  24. }
  25. public List<Map<String, Object>> getProvisionalReasonTypes() {
  26. String sql = "SELECT id,provisional_reason FROM reason_for_provisional";
  27. return jdbcTemplate.queryForList(sql);
  28. }
  29. public List<Map<String, Object>> getGisEntryTypes() {
  30. String sql = "SELECT id,gis_entry FROM gis_entry_type";
  31. return jdbcTemplate.queryForList(sql);
  32. }
  33. }