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"); //本月销量