Browse Source

mysql数据库计算精度丢失处理

anderx 2 years ago
parent
commit
b181d3ae87

+ 1 - 1
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -281,7 +281,7 @@
   </select>
   <select id="projectAddDuration">
     update project_task
-    set duration=duration+#{duration}
+    set duration=format(duration+#{duration},2)
     where id =#{pid}
   </select>
   <select id="selectProjectImg" resultType="com.ruoyi.project.domain.ProjectStaffRecord">

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -332,7 +332,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <update id="userAddDuration">
-		update sys_user set duration = duration+#{duration}
+		update sys_user set duration = format(duration+#{duration},2)
 		where user_id = #{userId}
 	</update>
 	<update id="updateUserProjectSum">