|
|
@@ -394,7 +394,19 @@ public class SqlEntityBuilder {
|
|
|
DefaultFieldSort field = new DefaultFieldSort();
|
|
|
String name = JsonUtil.getString(column, "name");
|
|
|
field.setField(name);
|
|
|
- field.setDirection(Direction.fromString(JsonUtil.getString(column, "direction","ASC")));//
|
|
|
+ field.setDirection(Direction.fromString(JsonUtil.getString(column, "direction","ASC")));
|
|
|
+ String type = JsonUtil.getString(column, "direction");
|
|
|
+ if("custom".equals(type)){
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ stringBuilder.append("FIELD(").append(name);
|
|
|
+ JSONArray value = JsonUtil.getJSONArray(column, "fieldValue");
|
|
|
+ for (Object obj2 : value) {
|
|
|
+ stringBuilder.append(",").append("'").append(obj2).append("'");
|
|
|
+ }
|
|
|
+ stringBuilder.append(")");
|
|
|
+ field.setField(stringBuilder.toString());
|
|
|
+ field.setDirection(Direction.FIELD);
|
|
|
+ }
|
|
|
String direction = buildSortFieldDirection(name, fieldSortList);
|
|
|
if (StringUtil.isNotEmpty(direction)) {
|
|
|
field.setDirection(Direction.fromString(direction));
|