From db27032fe3d3f4d830f298f2f2c66fcfcfe35f0b Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 4 Sep 2025 19:16:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=88=A9=E7=94=A8js?= =?UTF-8?q?qlparser=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AA=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E6=8B=BC=E8=A3=85sql=E7=9A=84=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1469817729548288]利用jsqlparser新增一个方便拼装sql的工具类 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1469817729548288 --- src/main/java/neatlogic/framework/sqlgenerator/$sql.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/neatlogic/framework/sqlgenerator/$sql.java b/src/main/java/neatlogic/framework/sqlgenerator/$sql.java index af25ce7cd..605ed6afb 100644 --- a/src/main/java/neatlogic/framework/sqlgenerator/$sql.java +++ b/src/main/java/neatlogic/framework/sqlgenerator/$sql.java @@ -17,6 +17,8 @@ package neatlogic.framework.sqlgenerator; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; import neatlogic.framework.util.TimeUtil; import net.sf.jsqlparser.expression.*; import net.sf.jsqlparser.expression.operators.conditional.AndExpression; @@ -255,8 +257,13 @@ public class $sql { } } if (CollectionUtils.isNotEmpty(whereExpressionList)) { + List expressionJSONStringList = new ArrayList<>(); for (ExpressionVo whereExpression : whereExpressionList) { - addWhereExpression(plainSelect, whereExpression); + String expressionJSONString = JSON.toJSONString(whereExpression, SerializerFeature.MapSortField, SerializerFeature.DisableCircularReferenceDetect); + if (!expressionJSONStringList.contains(expressionJSONString)) { + addWhereExpression(plainSelect, whereExpression); + expressionJSONStringList.add(expressionJSONString); + } } } if (CollectionUtils.isNotEmpty(groupByList)) { -- Gitee From 047257e731b73bcf5d2d53293577a70983bb96a4 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 4 Sep 2025 19:18:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=88=A9=E7=94=A8js?= =?UTF-8?q?qlparser=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AA=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E6=8B=BC=E8=A3=85sql=E7=9A=84=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1469817729548288]利用jsqlparser新增一个方便拼装sql的工具类 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1469817729548288 --- src/main/java/neatlogic/framework/sqlgenerator/$sql.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/neatlogic/framework/sqlgenerator/$sql.java b/src/main/java/neatlogic/framework/sqlgenerator/$sql.java index 605ed6afb..964e43d61 100644 --- a/src/main/java/neatlogic/framework/sqlgenerator/$sql.java +++ b/src/main/java/neatlogic/framework/sqlgenerator/$sql.java @@ -259,7 +259,7 @@ public class $sql { if (CollectionUtils.isNotEmpty(whereExpressionList)) { List expressionJSONStringList = new ArrayList<>(); for (ExpressionVo whereExpression : whereExpressionList) { - String expressionJSONString = JSON.toJSONString(whereExpression, SerializerFeature.MapSortField, SerializerFeature.DisableCircularReferenceDetect); + String expressionJSONString = JSON.toJSONString(whereExpression, SerializerFeature.MapSortField); if (!expressionJSONStringList.contains(expressionJSONString)) { addWhereExpression(plainSelect, whereExpression); expressionJSONStringList.add(expressionJSONString); -- Gitee