以组合名作为别名,结果用map接收


<select id='getXXX' resultType="java.util.map">
select xx as testName, yy as greatBe from t_table
</select>

Map<String,Object> resultMap = mapper.getXXX();

resultMap.get("testName").toString(); -- 会报空指针异常

debug发现 resultMap中,数据格式是{“testname”:"aaa","greatbe":"bbb"}

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-09-06
  • 2021-12-09
猜你喜欢
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-14
  • 2022-01-11
  • 2021-09-21
相关资源
相似解决方案