weixin_37648315
沙发土豆土豆沙发
2017-09-25 11:00

JDBC获取多行数据转成List<Map>报错

  • oracle

业务需求将sql返回的多行数据,分别生成多个map,存放进一个List,语句如下:
public List getJgnrLjList(Long jgnrId, Long ajywId) {
String sql = "SELECT ID," +
" MC," +
" DM," +
" JGXID," +
" JGXDM," +
" SJID," +
" DQCJ," +
" GJZBS," +
" (SELECT DM" +
" FROM T_AJJG_XT_DMX" +
" WHERE ID = (SELECT XTDM" +
" FROM T_AJJG_JGNR_SSWP" +
" WHERE SFYX_ST = '1'" +
" AND JGNRID = C.ID)) SSWPDM,'' SSWPLIST" +
" FROM T_AJJG_JGNR C" +
" START WITH C.ID = ?" +
"CONNECT BY PRIOR C.SJID = C.ID" +
" AND C.SFYX_ST = '1'" +
" ORDER BY C.DQCJ";
return super.getJdbcTemplate().queryForList(sql, jgnrId);
}

报错:Incorrect column count: expected 1, actual 18

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换