From c328f46872b710520721bc23e50487a878a51fe6 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Tue, 3 Sep 2024 22:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8E=9F=E7=85=A4=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoalWashingDailyAnalysisService.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java index c32cc186..bff7d0ad 100644 --- a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java +++ b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/service/CoalWashingDailyAnalysisService.java @@ -157,19 +157,17 @@ public class CoalWashingDailyAnalysisService """ - select to_char(date_trunc('${timeDimension}', a.end_time), 'YYYY-MM-DD') as time + select to_char(date_trunc('${timeDimension}', date), 'YYYY-MM-DD') as time <#list reportFields as field> - <#if field?is_first> , - <#if field == 'coalInfoId'>, d.id as coal_info_id, d.code as coal_info_code, d.name as coal_info_name - <#if field == 'productId'>, p.id as product_id, p.code as product_code, p.name as product_name + <#if field == 'coalInfoId'>, d.id as coal_info_id, max(d.code) as coal_info_code, max(d.name) as coal_info_name + <#if field == 'productId'>, p.id as product_id, max(p.code) as product_code, max(p.name) as product_name - <#if field?has_next>, , sum(d.amount) as amount @@ -180,23 +178,21 @@ public class CoalWashingDailyAnalysisService where 1=1 - <#if startTime??> and a.end_time >= :startTime - <#if endTime??> and a.end_time <= :endTime - <#if productIds??> and a.product_id in (:productIds) - <#if coalInfoIds??> and d.id in (:coalInfoIds) + <#if startTime??> and date >= :startTime + <#if endTime??> and date <= :endTime + <#if productIds?? && productIds?has_content > and a.product_id in :productIds + <#if coalInfoIds?? && coalInfoIds?has_content> and d.id in :coalInfoIds - group by 1, date_trunc('${timeDimension}', a.end_time) + group by 1, date_trunc('${timeDimension}', date) <#list reportFields as field> - <#if field?is_first> , <#if field == 'coalInfoId'>, d.id <#if field == 'productId'>, p.id - <#if field?has_next>,