商业的高精度计算,一定要用BigDecimal的String构造方法BigDecimal(double val) 是不准确的BigDecimal(String val) 才是精确的select IFNULL(sum(quantity),0) as count from mmall_cart where user_id = #{userId}