|
@@ -180,9 +180,22 @@ public class DataExpertTemplateController {
|
|
|
String ids = dto.getIds().toString();
|
|
String ids = dto.getIds().toString();
|
|
|
conditions += " and id in (" + ids.substring(1, ids.length() - 1) + ")";
|
|
conditions += " and id in (" + ids.substring(1, ids.length() - 1) + ")";
|
|
|
}
|
|
}
|
|
|
- if(dto.getConditions() != null && !dto.getConditions().isEmpty()){
|
|
|
|
|
- for (String key : dto.getConditions().keySet()) {
|
|
|
|
|
- conditions += " and " + key + " like '%" + dto.getConditions().get(key) + "%'";
|
|
|
|
|
|
|
+ if(dto.getConditions() != null && dto.getConditions().size() != 0){
|
|
|
|
|
+ for (JsonElement condition : dto.getConditions()) {
|
|
|
|
|
+ JsonObject jsonObject = condition.getAsJsonObject();
|
|
|
|
|
+ if(jsonObject.get("keyType").getAsInt() == 1){
|
|
|
|
|
+ conditions += " and " + jsonObject.get("keyName").getAsString() + " like '%" + jsonObject.get("keyValue").getAsString() + "%'";
|
|
|
|
|
+ }else if(jsonObject.get("keyType").getAsInt() == 2){
|
|
|
|
|
+ conditions += " and " + jsonObject.get("keyName") + " in (";
|
|
|
|
|
+ String[] keyValues = jsonObject.get("keyValue").getAsString().split(",");
|
|
|
|
|
+ for(int k = 0; k < keyValues.length; k ++){
|
|
|
|
|
+ if(k > 0){
|
|
|
|
|
+ conditions += ",";
|
|
|
|
|
+ }
|
|
|
|
|
+ conditions += "'" + keyValues[k] + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ conditions += ")";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|