ludc
2023-05-16 5845950aa395da1a1f56a5fff4c80358cf4b5f7f
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/MPJLambdaWrapperSqlKeyword.java
@@ -78,6 +78,51 @@
      }
   }
   public static void buildConditionByMapString(Map<String, String> query, MPJLambdaWrapper<?> qw) {
      if (!Func.isEmpty(query)) {
         query.forEach((k, v) -> {
            if (!Func.hasEmpty(new Object[]{k, v}) && !k.endsWith("_ignore")) {
               if (k.endsWith("_equal")) {
                  qw.eq(getColumn(k, "_equal"), v);
               } else if (k.endsWith("_notequal")) {
                  qw.ne(getColumn(k, "_notequal"), v);
               } else if (k.endsWith("_likeleft")) {
                  qw.likeLeft(getColumn(k, "_likeleft"), v);
               } else if (k.endsWith("_likeright")) {
                  qw.likeRight(getColumn(k, "_likeright"), v);
               } else if (k.endsWith("_notlike")) {
                  qw.notLike(getColumn(k, "_notlike"), v);
               } else if (k.endsWith("_ge")) {
                  qw.ge(getColumn(k, "_ge"), v);
               } else if (k.endsWith("_le")) {
                  qw.le(getColumn(k, "_le"), v);
               } else if (k.endsWith("_gt")) {
                  qw.gt(getColumn(k, "_gt"), v);
               } else if (k.endsWith("_lt")) {
                  qw.lt(getColumn(k, "_lt"), v);
               } else if (k.endsWith("_datege")) {
                  qw.ge(getColumn(k, "_datege"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss"));
               } else if (k.endsWith("_dategt")) {
                  qw.gt(getColumn(k, "_dategt"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss"));
               } else if (k.endsWith("_dateequal")) {
                  qw.eq(getColumn(k, "_dateequal"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss"));
               } else if (k.endsWith("_datele")) {
                  qw.le(getColumn(k, "_datele"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss"));
               } else if (k.endsWith("_datelt")) {
                  qw.lt(getColumn(k, "_datelt"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss"));
               } else if (k.endsWith("_null")) {
                  qw.isNull(getColumn(k, "_null"));
               } else if (k.endsWith("_notnull")) {
                  qw.isNotNull(getColumn(k, "_notnull"));
               } else {
                  qw.like(getColumn(k, "_like"), v);
               }
            }
         });
      }
   }
   private static String getColumn(String column, String keyword) {
      return StringUtil.humpToUnderline(StringUtil.removeSuffix(column, keyword));
   }