|
|
|
@ -96,26 +96,27 @@ public class SearchConditionVo extends PageVo implements Serializable { |
|
|
|
|
if (StringUtils.isBlankAny(table, fieldName)) { |
|
|
|
|
return Strings.EMPTY; |
|
|
|
|
} |
|
|
|
|
String value = fieldValue; |
|
|
|
|
if (Arrays.asList(STRING_TYPES).contains(dataType) || |
|
|
|
|
Arrays.asList(DATE_TYPES).contains(dataType)) { |
|
|
|
|
fieldValue = "'" + fieldValue + "'"; |
|
|
|
|
value = "'" + fieldValue + "'"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ("like_all".equalsIgnoreCase(logicJudgement)) { |
|
|
|
|
logicJudgement = "like"; |
|
|
|
|
fieldValue = fieldValue.substring(1, fieldValue.length() - 1); |
|
|
|
|
fieldValue = "'%" + fieldValue + "%'"; |
|
|
|
|
value = fieldValue.substring(1, fieldValue.length() - 1); |
|
|
|
|
value = "'%" + value + "%'"; |
|
|
|
|
} else if ("like_left".equalsIgnoreCase(logicJudgement)) { |
|
|
|
|
logicJudgement = "like"; |
|
|
|
|
fieldValue = fieldValue.substring(1); |
|
|
|
|
fieldValue = "'%" + fieldValue; |
|
|
|
|
value = fieldValue.substring(1); |
|
|
|
|
value = "'%" + value; |
|
|
|
|
} else if ("like_right".equalsIgnoreCase(logicJudgement)) { |
|
|
|
|
logicJudgement = "like"; |
|
|
|
|
fieldValue = fieldValue.substring(0, fieldValue.length() - 1); |
|
|
|
|
fieldValue = fieldValue + "%'"; |
|
|
|
|
value = fieldValue.substring(0, fieldValue.length() - 1); |
|
|
|
|
value = value + "%'"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return " " + logicJoin + " \"" + table + "\".\"" + fieldName + "\" " + logicJudgement + " " + fieldValue; |
|
|
|
|
return " " + logicJoin + " \"" + table + "\".\"" + fieldName + "\" " + logicJudgement + " " + value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|