Your Name
2023-09-12 ef6455443ef9ecaafb8ee876df91b577558057ef
优化代码
3个文件已修改
20 ■■■■■ 已修改文件
java110-db/src/main/resources/mapper/common/MarketLogV1ServiceDaoImplMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/MeterMachineV1ServiceDaoImplMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/util/MoneyUtil.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/MarketLogV1ServiceDaoImplMapper.xml
@@ -31,7 +31,7 @@
            and t.person_name= #{personName}
        </if>
        <if test="personNameLike !=null and personNameLike != ''">
            and t.person_name concat('%', #{personName},'%')
            and t.person_name like concat('%', #{personName},'%')
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.create_time &gt; #{startTime}
@@ -132,7 +132,7 @@
            and t.person_name= #{personName}
        </if>
        <if test="personNameLike !=null and personNameLike != ''">
            and t.person_name concat('%', #{personName},'%')
            and t.person_name like concat('%', #{personName},'%')
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.create_time &gt; #{startTime}
java110-db/src/main/resources/mapper/common/MeterMachineV1ServiceDaoImplMapper.xml
@@ -52,7 +52,7 @@
            and t.machine_name= #{machineName}
        </if>
        <if test="machineNameLike !=null and machineNameLike != ''">
            and t.machine_name concat('%', #{machineNameLike},'%')
            and t.machine_name like concat('%', #{machineNameLike},'%')
        </if>
        <if test="roomId !=null and roomId != ''">
            and t.room_id= #{roomId}
@@ -61,7 +61,7 @@
            and t.room_name= #{roomName}
        </if>
        <if test="roomNameLike !=null and roomNameLike != ''">
            and t.room_name concat('%', #{roomNameLike},'%')
            and t.room_name like concat('%', #{roomNameLike},'%')
        </if>
        <if test="curReadingTime !=null and curReadingTime != ''">
            and t.cur_reading_time= #{curReadingTime}
@@ -82,7 +82,7 @@
            and t.fee_config_name= #{feeConfigName}
        </if>
        <if test="feeConfigNameLike !=null and feeConfigNameLike != ''">
            and t.fee_config_name concat('%', #{feeConfigNameLike},'%')
            and t.fee_config_name like concat('%', #{feeConfigNameLike},'%')
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
@@ -187,7 +187,7 @@
            and t.machine_name= #{machineName}
        </if>
        <if test="machineNameLike !=null and machineNameLike != ''">
            and t.machine_name concat('%', #{machineNameLike},'%')
            and t.machine_name like concat('%', #{machineNameLike},'%')
        </if>
        <if test="roomId !=null and roomId != ''">
            and t.room_id= #{roomId}
@@ -196,7 +196,7 @@
            and t.room_name= #{roomName}
        </if>
        <if test="roomNameLike !=null and roomNameLike != ''">
            and t.room_name concat('%', #{roomNameLike},'%')
            and t.room_name like concat('%', #{roomNameLike},'%')
        </if>
        <if test="curReadingTime !=null and curReadingTime != ''">
            and t.cur_reading_time= #{curReadingTime}
@@ -217,7 +217,7 @@
            and t.fee_config_name= #{feeConfigName}
        </if>
        <if test="feeConfigNameLike !=null and feeConfigNameLike != ''">
            and t.fee_config_name concat('%', #{feeConfigNameLike},'%')
            and t.fee_config_name like concat('%', #{feeConfigNameLike},'%')
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
java110-utils/src/main/java/com/java110/utils/util/MoneyUtil.java
@@ -23,7 +23,9 @@
     */
    public static double computePriceScale(double price,String scale,int decimalPlace){
        BigDecimal feeTotalPrice = new BigDecimal(price);
        //todo 解决 群里反馈 进度丢失问题
        //todo 发现了个BUG   MoneyUtil.computePriceScale      计算金额四舍五入时,精度丢失问题,    new BigDecimal(String )  就OK了,  double  会出问题。     例如444.195   四舍五入变成了 44.19
        BigDecimal feeTotalPrice = new BigDecimal(price+"");
        if(DOWN.equals(scale)) {
            feeTotalPrice = feeTotalPrice.setScale(decimalPlace, BigDecimal.ROUND_DOWN);