田源
2024-04-29 2cedb574c22cf2f77418929e79f23ace0a7e7ac6
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/util/UBCSSqlKeyword.java
@@ -38,7 +38,6 @@
   private static final String NOT_NULL = "_notnull";
   private static final String IGNORE = "_ignore";
   public UBCSSqlKeyword() {
   }
@@ -54,6 +53,7 @@
      }
      return sqlwhere;
   }
   private static String sqlKeywordValueSqlwhere(String field, Object value, SqlKeyword operation){
      String sqlwhere="";
      switch(operation) {
@@ -83,6 +83,7 @@
      }
      return sqlwhere;
   }
   private static String  dateValueSqlwhere(String field, Object value, SqlKeyword operation){
      String sqlwhere="";
      switch(operation) {
@@ -101,6 +102,7 @@
      }
      return sqlwhere;
   }
   public static String buildSqlwhere(Map<String, Object> query) {
      StringBuffer sb=new StringBuffer();
      if (!Func.isEmpty(query)) {
@@ -151,6 +153,7 @@
      return sb.toString();
   }
   public static void buildCondition(Map<String, Object> query, QueryWrapper<?> qw) {
      if (!Func.isEmpty(query)) {
         query.forEach((k, v) -> {
@@ -249,6 +252,52 @@
      }
   }
   public static MPJLambdaWrapper buildConditionByMapString(Map<String, String> query) {
      MPJLambdaWrapper<?>qw=new MPJLambdaWrapper<>();
      if (!Func.isEmpty(query)) {
         query.forEach((k, v) -> {
            if (!Func.hasEmpty(new Object[]{k, v}) && !k.endsWith("_ignore")) {
               if (k.endsWith("_like")) {
                  qw.like(getColumn(k, "_like"), 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.eq(getColumn(k, "_equal"), v);
               }
            }
         });
      };
      return qw;
   }
   public static void buildConditionByMapString(Map<String, String> query, MPJLambdaWrapper<?> qw) {
      if (!Func.isEmpty(query)) {