From ed17f7910c9605951b6bb1c7eeef5df5fcbc8eb2 Mon Sep 17 00:00:00 2001 From: king Date: Wed, 18 Mar 2026 11:08:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E9=94=80=E5=94=AE=E6=83=85?= =?UTF-8?q?=E5=86=B5=E8=A1=A8=20=E5=88=86=E7=BB=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/report/xtsy/zhxsqkLineReportEnhance.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkLineReportEnhance.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkLineReportEnhance.java index 2c09e12..5501eeb 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkLineReportEnhance.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkLineReportEnhance.java @@ -31,9 +31,17 @@ public class zhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin { } if (groupFieldList.contains("useyear") || params.containsKey("useyear")) { //年 executePluginSql.append(" tbl_lgbsa.USEYEAR, \n"); + if(!(groupFieldList.contains("usemonth") || params.containsKey("usemonth"))){ + executePluginSql.append(" MAX(USEYEAR) as ny, \n"); //年月 + } } if (groupFieldList.contains("usemonth") || params.containsKey("usemonth")) { //月 executePluginSql.append(" tbl_lgbsa.USEMONTH, \n"); + if(groupFieldList.contains("useyear") || params.containsKey("useyear")){ + executePluginSql.append(" MAX(CONCAT(USEYEAR, LPAD(USEMONTH, 2, '0'))) as ny, \n"); //年月 + }else{ + executePluginSql.append(" MAX(LPAD(USEMONTH, 2, '0')) as ny, \n"); + } } if (groupFieldList.contains("zonename") || params.containsKey("zonename")) { //业务区域 executePluginSql.append(" tbl_lgbsa.ZONEID, \n"); @@ -55,7 +63,7 @@ public class zhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin { executePluginSql.append(" tbl_lgbsa.GOODSID, \n"); executePluginSql.append(" tbl_lgbsa.GOODSNAME, \n"); } - executePluginSql.append(" MAX(CONCAT(USEYEAR, LPAD(USEMONTH, 2, '0'))) as ny, \n"); //年月 + executePluginSql.append(" GROUP_CONCAT(DISTINCT tbl_lgbsa.PROVINCEID ORDER BY tbl_lgbsa.PROVINCEID SEPARATOR ',') as PROVINCEID, \n"); //行政区域ID executePluginSql.append(" GROUP_CONCAT(DISTINCT tbl_lgbsa.PROVINCENAME ORDER BY tbl_lgbsa.PROVINCEID SEPARATOR ',') as PROVINCENAME, \n"); //行政区域名称 executePluginSql.append(" SUM(tbl_lgbsa.MONTHSAQTY) as MONTHSAQTY, \n"); //本月销量