| | |
| | | private static final String NOT_NULL = "_notnull"; |
| | | private static final String IGNORE = "_ignore"; |
| | | |
| | | |
| | | public UBCSSqlKeyword() { |
| | | } |
| | | |
| | |
| | | } |
| | | return sqlwhere; |
| | | } |
| | | |
| | | private static String sqlKeywordValueSqlwhere(String field, Object value, SqlKeyword operation){ |
| | | String sqlwhere=""; |
| | | switch(operation) { |
| | |
| | | } |
| | | return sqlwhere; |
| | | } |
| | | |
| | | private static String dateValueSqlwhere(String field, Object value, SqlKeyword operation){ |
| | | String sqlwhere=""; |
| | | switch(operation) { |
| | |
| | | } |
| | | return sqlwhere; |
| | | } |
| | | |
| | | public static String buildSqlwhere(Map<String, Object> query) { |
| | | StringBuffer sb=new StringBuffer(); |
| | | if (!Func.isEmpty(query)) { |
| | |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static void buildCondition(Map<String, Object> query, QueryWrapper<?> qw) { |
| | | if (!Func.isEmpty(query)) { |
| | | query.forEach((k, v) -> { |
| | |
| | | } |
| | | } |
| | | |
| | | 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)) { |