mybatis中resultType返回值为java.util.Map返回结果字段值为null的字段会直接不显示怎么办?

mybatis:
  mapper-locations: classpath:/mapper/*.xml
  configuration:
    map-underscore-to-camel-case: true
    call-setters-on-nulls: true #mybatis返回类型为map返回字段值为null的字段

配置一下mybatis的配置文件即可

call-setters-on-nulls: true #mybatis返回类型为map返回字段值为null的字段

call-setters-on-nulls改为true即可

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐