综合浏览数据表自定义查询自定义导出功能

master
guoxin 1 year ago
parent 47f9f95818
commit 699973e3cd
  1. 17
      shandan-system/src/main/java/com/keyware/shandan/browser/entity/SearchConditionVo.java

@ -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;
}
}
}