From a7348f273d95e5738260f733e9df9e2447db0238 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Sun, 31 Mar 2024 16:53:29 +0800 Subject: [PATCH] bugfix --- .../entity/CoalWashingMonthReportEntity.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/coalWashingMonthReport/entity/CoalWashingMonthReportEntity.java b/src/main/java/cn/lihongjie/coal/coalWashingMonthReport/entity/CoalWashingMonthReportEntity.java index 0077dd53..ca231ddb 100644 --- a/src/main/java/cn/lihongjie/coal/coalWashingMonthReport/entity/CoalWashingMonthReportEntity.java +++ b/src/main/java/cn/lihongjie/coal/coalWashingMonthReport/entity/CoalWashingMonthReportEntity.java @@ -13,8 +13,8 @@ import java.time.LocalDate; @Data @Entity - -@Subselect(""" +@Subselect( + """ select gen_random_uuid()::text as id, @@ -40,15 +40,14 @@ select gen_random_uuid()::text as id, '' as create_user_id, '' as update_user_id, null as file_ids, - count(distinct d.date) as days -from t_coal_washing_daily_analysis d + sum(d.xx) as days +from ((select 1.0 / count(1) over (partition by date_trunc('day', date)) as xx , * + from t_coal_washing_daily_analysis)) d group by d.organization_id, d.name, date_trunc('month', d.date) """) public class CoalWashingMonthReportEntity extends OrgCommonEntity { - - @Comment("日期") private LocalDate date; private String remark1;