Browse Source

代码提交
1、MyDBHelp中 getParameterListByBookTitle 去掉,目前是支持批量删除的
2、MyDBHelp中
getModify 434行
需要判定key是否存在于allColumn,不存在的丢弃

pms 2 years ago
parent
commit
2ab411aedc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      mainFactory/src/main/java/org/bfkj/utils/MyDbHelper.java

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

@@ -431,6 +431,7 @@ public class MyDbHelper {
                     modifyCol = allColumn;
                 } else {
                     for (String key : valueMap.keySet()) {
+                        if (!allColumn.contains(key)) continue; //需要判定key是否存在于allColumn,不存在的丢弃
                         cuList.add(valueMap.get(key));
                         modifyCol.add(key + "=?");
                     }
@@ -737,7 +738,8 @@ public class MyDbHelper {
         List<Object[]> returnData = new ArrayList<>();
         Pattern regExpression = Pattern.compile("(?<=《)([^》]+)?(?=》)");
         Matcher parameterNames = regExpression.matcher(sql);
-        if ((sql.toLowerCase().trim().startsWith("select") || sql.toLowerCase().trim().startsWith("delete")) && paramsList.size() > 1) {
+        /*目前是支持批量删除的 || sql.toLowerCase().trim().startsWith("delete")*/
+        if ((sql.toLowerCase().trim().startsWith("select") ) && paramsList.size() > 1) {
             Map<String, Object> temMap = paramsList.get(0);
             paramsList = new ArrayList<>() {
                 {