From c1bf94d6be583da5efb9e9a17d4a7346fb77b3d5 Mon Sep 17 00:00:00 2001 From: yunsheng Date: Sat, 23 Jun 2018 11:14:40 +0800 Subject: [PATCH] =?UTF-8?q?format=E6=BD=9C=E5=9C=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit format返回的是字符串格式,超过3位会有逗号 --- .../main/resources/mapper/AppClientCostTimeTotalStatDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cachecloud-open-web/src/main/resources/mapper/AppClientCostTimeTotalStatDao.xml b/cachecloud-open-web/src/main/resources/mapper/AppClientCostTimeTotalStatDao.xml index a802f141..8c8fc75c 100644 --- a/cachecloud-open-web/src/main/resources/mapper/AppClientCostTimeTotalStatDao.xml +++ b/cachecloud-open-web/src/main/resources/mapper/AppClientCostTimeTotalStatDao.xml @@ -24,7 +24,7 @@ max_instance_port = if(hundred_max>#{hundredMax},max_instance_port,#{maxInstancePort}), max_instance_id = if(hundred_max>#{hundredMax},max_instance_id,#{maxInstanceId}), max_client_ip = if(hundred_max>#{hundredMax},max_client_ip,#{maxClientIp}), - mean = format(total_cost/total_count,2), + mean = CONVERT(total_cost/total_count,DECIMAL(12,2)), create_time = now(), accumulation = accumulation + 1; @@ -47,7 +47,7 @@ max_instance_port = if(hundred_max>#{clientCostTime.hundredMax},max_instance_port,#{clientCostTime.maxInstancePort}), max_instance_id = if(hundred_max>#{clientCostTime.hundredMax},max_instance_id,#{clientCostTime.maxInstanceId}), max_client_ip = if(hundred_max>#{clientCostTime.hundredMax},max_client_ip,#{clientCostTime.maxClientIp}), - mean = format(total_cost/total_count,2), + mean = CONVERT(total_cost/total_count,DECIMAL(12,2)), create_time = now(), accumulation = accumulation + 1; @@ -61,4 +61,4 @@ where app_id=#{appId} and collect_time between #{startTime} and #{endTime} and command=#{command} - \ No newline at end of file +