瀏覽代碼

2.0 where 拼接添加上主键

pms 2 年之前
父節點
當前提交
c316a088e8

+ 7 - 0
mainFactory/pom.xml

@@ -159,6 +159,13 @@
             <artifactId>nashorn-core</artifactId>
             <version>15.4</version>
         </dependency>
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>1.2.8</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 1 - 0
mainFactory/src/main/java/org/bfkj/application/DataProcess.java

@@ -107,6 +107,7 @@ public class DataProcess {//数据处理对象
             inputData.put("dataObjectId", createLifeCycleCol(Long.valueOf(AppConfig.WORK_ID), Integer.parseInt(serviceId))); // 生成新的生命周期ID
         }
         String dataObjectId = inputData.get("dataObjectId").toString();
+
         inputData = authCheck(inputData, user_id); /*权限检查,添加列权限以及行权限到inputData中*/
         if ("-1".equals(inputData.get("code")) || (Objects.nonNull( inputData.get("message")) && inputData.get("message").toString().equals("服务未授任何数据权限"))) {
             return inputData;

+ 17 - 0
mainFactory/src/main/java/org/bfkj/utils/DruidParserTools.java

@@ -0,0 +1,17 @@
+package org.bfkj.utils;
+
+import org.dom4j.Attribute;
+import org.dom4j.Element;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 算法工具类
+ */
+public class DruidParserTools {
+
+
+}

+ 2 - 2
mainFactory/src/main/java/org/bfkj/utils/MyDbHelper.java

@@ -451,8 +451,8 @@ public class MyDbHelper {//目前只差主键的条件优化
                 filterList.get(filterList.size() - 1).put("connector", "lastConnector");//去掉最后一个连接符,减少whereStr字符串的处理
                 for (Map<String, Object> filterMap : filterList) {//循环条件参数集合
                     Object column = filterMap.get("column");//获取列名
-//                    && !varList.contains(column.toString()) && (MapTools.isBlank(allSQLColumn) || allSQLColumn.contains(column.toString()))
-                    if (Objects.nonNull(column) ) {//列名不为空 且 (可用列未获取 或者 当前列存在于可用列)
+//                    && && (MapTools.isBlank(allSQLColumn) || allSQLColumn.contains(column.toString()
+                    if (Objects.nonNull(column) && !varList.contains(column.toString())) {//列名不为空 且 (可用列未获取 或者 当前列存在于可用列)
                         String connector = Objects.isNull(filterMap.get("connector")) ? "" : filterMap.get("connector").toString();//处理连接字符串
                         Object comparator = Objects.isNull(filterMap.get("comparator")) ? "" : filterMap.get("comparator").toString();//比较符
                         whereStr = whereStr.concat(filterMap.get("left").toString())