white knight

导航

 

参考 http://blog.csdn.net/gaopeng0071/article/details/75049952

 

使用NamedParameterJdbcTemplate

 

public class xxDao {

@Autowired
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;

public List<Map<String, Object>> getByIds(List<String> ids) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("ids", ids);

return namedParameerJdbcTemplate.queryForList("select aa, bb from tablea where aa in (:ids)", params);
}

}

posted on 2018-03-09 10:15  white knight  阅读(126)  评论(0编辑  收藏  举报