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.

29 lines
838 B

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package in.gov.chennaicorporation.gccoffice.callcenter.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 CampaignDropdownApiService {
  11. @Autowired
  12. private JdbcTemplate jdbcTemplate;
  13. @Autowired
  14. public void setDataSource(@Qualifier("mysql1913CampaignDataSource") DataSource dataSource) {
  15. this.jdbcTemplate = new JdbcTemplate(dataSource);
  16. }
  17. public List<Map<String,Object>> getAnswerTypes(){
  18. String sql = "SELECT answer_type_id,type_name FROM answer_type";
  19. return jdbcTemplate.queryForList(sql);
  20. }
  21. }