|
@@ -44,6 +44,7 @@ import java.nio.ByteOrder;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import static com.lc.ibps.api.base.constants.StateEnum.ERROR;
|
|
import static com.lc.ibps.api.base.constants.StateEnum.ERROR;
|
|
|
import static com.lc.ibps.api.base.constants.StateEnum.SUCCESS;
|
|
import static com.lc.ibps.api.base.constants.StateEnum.SUCCESS;
|
|
@@ -84,6 +85,9 @@ public class UpdateDataTableImpl extends GenericProvider implements UpdateDataTa
|
|
|
}else if(BeanUtils.isNotEmpty(queryDTO.getType()) && "append".equals(queryDTO.getType())){
|
|
}else if(BeanUtils.isNotEmpty(queryDTO.getType()) && "append".equals(queryDTO.getType())){
|
|
|
String buildApen = append(map,queryDTO.getParams().toArray());
|
|
String buildApen = append(map,queryDTO.getParams().toArray());
|
|
|
list = (List<Map<String, Object>>) commonDao.query(buildApen);
|
|
list = (List<Map<String, Object>>) commonDao.query(buildApen);
|
|
|
|
|
+ }else if(BeanUtils.isNotEmpty(queryDTO.getType()) && "replace".equals(queryDTO.getType())){
|
|
|
|
|
+ String reSql = replace(map,queryDTO.getParams().toArray());
|
|
|
|
|
+ list = (List<Map<String, Object>>) commonDao.query(reSql);
|
|
|
}else{
|
|
}else{
|
|
|
Object[] params = queryDTO.getParams().toArray();
|
|
Object[] params = queryDTO.getParams().toArray();
|
|
|
list = (List<Map<String, Object>>) commonDao.query( map.get("sql_").toString(), params);
|
|
list = (List<Map<String, Object>>) commonDao.query( map.get("sql_").toString(), params);
|
|
@@ -174,6 +178,17 @@ public class UpdateDataTableImpl extends GenericProvider implements UpdateDataTa
|
|
|
String endSql = sql + o;
|
|
String endSql = sql + o;
|
|
|
return endSql;
|
|
return endSql;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public String replace(Map<String, Object> map, Object[] list){
|
|
|
|
|
+ String sql = map.get("sql_").toString();
|
|
|
|
|
+ List<String> strList = Arrays.stream(list)
|
|
|
|
|
+ .map(Object::toString)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ for(int i = 0;i<strList.size();i++){
|
|
|
|
|
+ sql = sql.replace("#{p" + i + "}",strList.get(i));
|
|
|
|
|
+ }
|
|
|
|
|
+ return sql;
|
|
|
|
|
+ }
|
|
|
@Override
|
|
@Override
|
|
|
public APIResult<Void> upEmployee(String str){
|
|
public APIResult<Void> upEmployee(String str){
|
|
|
APIResult<Void> result = new APIResult<>();
|
|
APIResult<Void> result = new APIResult<>();
|