解决mybatis返回map时value值为null,属性和value都不显示
spring boot在配置文件application.yml添加:
mybatis:
configuration:
call-setters-on-nulls: true
spring boot在配置文件application.properties添加:
#当查询数据为空时字段返回为null,不加这个查询数据为空时,字段将被隐藏
mybatis.configuration.call-setters-on-nulls=true
3.在mybatis.xml添加:
<configuration>
<settings>
<setting name="callSettersOnNulls" value="true" />
</settings>
</configuration>