我收到不兼容的类型错误。
Required: List<java.lang.String> Found: List<java.util.Map<java.lang.String, java.lang.Objectaq>
我在做什么错?
String sql = "SELECT distinct case_name FROM case WHERE case_class IN (:case_class)";
Map<String, List> paramMap = Collections.singletonMap("case_class", listCaseClass);
List<String> cases = jdbcTemplate.queryForList(sql, paramMap, String.class);
我收到不兼容类型错误。必需:List
像这样更改您的代码:
String sql =
"SELECT distinct case_name FROM case WHERE case_class IN (:case_class) ";
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("case_class", listCaseClass);
List<String> cases = jdbcTemplate.queryForList(sql, paramMap, String.class);