mybatis-plus 查询,值为null,字段不显示的问题
mybatis-plus 查询,值为null,字段不显示的问题:
例如:在查询数据库表时,如果数据库表中字段为空时,查询结果中,为空的字段不显示
解决方案:
提示:需要修改mybatis-plus的配置即可,将mybatis-plus 的 call-setters-on-nulls 设置为true:
mybatis-plus:
# 全局开启所有实体类的主键id自增
global-config:
db-config:
id-type: auto
# mp 开启驼峰映射
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
还没有评论,来说两句吧...