public BigDecimal getTax() {
return tax == null ? BigDecimal.ZERO : tax;
}
这是自定义的一个类 对null 做出了处理。
但是如果是直接从xml 查询返回的该对象, tax() 字段还是会产生null
<resultMap id="twoToNine" type="" >
<result column="tax_data" property="tax" jdbcType="DECIMAL" />
<result column="fiscal_ret" property="revenue" jdbcType="DECIMAL" />
<result column="corp_name" property="name" jdbcType="VARCHAR"/>
</resultMap>