|
@@ -229,19 +229,22 @@ public abstract class ControllerSupport {
|
|
|
|
|
|
/**
|
|
|
* 转换为数据库模糊查询匹配模式
|
|
|
- *
|
|
|
- * @param column
|
|
|
- * @return
|
|
|
- * @author WANGWEI
|
|
|
*/
|
|
|
protected String toSqlSearchPattern(String column) {
|
|
|
if (StringUtils.isBlank(column)) {
|
|
|
return "%";
|
|
|
- } else {
|
|
|
- column = column.trim().replaceAll("\\s", "%");
|
|
|
- column = "%" + column + "%";
|
|
|
- return column;
|
|
|
}
|
|
|
+ return "%" + column.trim() + "%";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 转换为数据库模糊查询匹配模式 (左边全匹配、右边模糊匹配)
|
|
|
+ */
|
|
|
+ protected String toSqlRightLike(String column) {
|
|
|
+ if (StringUtils.isBlank(column)) {
|
|
|
+ return "%";
|
|
|
+ }
|
|
|
+ return column.trim() + "%";
|
|
|
}
|
|
|
|
|
|
/**
|