BooleanBuilder 如何根据自定义列名 模糊查询 使用PathBuilder
// 动态传参 // 1. 声明 PathBuilder:MyTable 为类名称,"myTable" 为首字母小写后的类名 PathBuilder<MyTable> path = new PathBuilder<>(MyTable.class, "myTable"); // 2. 判断查询的列的名称是否 不为空 if (!ObjectUtils.isEmpty(xXXXCondition.getColumn1())) { String columnName1 = xXXXCondition.getColumn1(); String value1 = xXXXCondition.getValue1(); booleanBuilder.and(path.getString(columnName1).like('%' + value1 + '%')); }