|
|
@@ -16,6 +16,7 @@ import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.dataexpert.dto.AddDataExpertTemplateDto;
|
|
|
+import com.xjrsoft.module.dataexpert.dto.DataExpertConditionsDto;
|
|
|
import com.xjrsoft.module.dataexpert.dto.DataExpertDto;
|
|
|
import com.xjrsoft.module.dataexpert.dto.DataExpertTemplateListDto;
|
|
|
import com.xjrsoft.module.dataexpert.dto.DataExpertTemplatePageDto;
|
|
|
@@ -177,17 +178,16 @@ public class DataExpertTemplateController {
|
|
|
}
|
|
|
}
|
|
|
if(dto.getIds() != null && !dto.getIds().isEmpty()){
|
|
|
- String ids = dto.getIds().toString();
|
|
|
- conditions += " and id in (" + ids.substring(1, ids.length() - 1) + ")";
|
|
|
+ String ids = dto.getIds().toString().substring(1, dto.getIds().size() - 1).replaceAll(",","','");
|
|
|
+ conditions += " and id in ('" + ids + "')";
|
|
|
}
|
|
|
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 (DataExpertConditionsDto condition : dto.getConditions()) {
|
|
|
+ if(condition.getKeyType() == 1){
|
|
|
+ conditions += " and " + condition.getKeyName() + " like '%" + condition.getKeyValue() + "%'";
|
|
|
+ }else if(condition.getKeyType() == 2 && condition.getKeyValue() != null && !"".equals(condition.getKeyValue())){
|
|
|
+ conditions += " and " + condition.getKeyName() + " in (";
|
|
|
+ String[] keyValues = condition.getKeyValue().split(",");
|
|
|
for(int k = 0; k < keyValues.length; k ++){
|
|
|
if(k > 0){
|
|
|
conditions += ",";
|