|
|
@@ -14,6 +14,7 @@ public class DbApiService {
|
|
|
@Autowired
|
|
|
DbApiDao dbApiDao;
|
|
|
public Map<String, Object> transferSql(String sqlCode, Map<String, String[]> maps){
|
|
|
+ System.out.println("参数--------长度-----"+maps.size());
|
|
|
Map hasSql = dbApiDao.dbQueryForMap(sqlCode);
|
|
|
boolean isEmpty = hasSql.containsKey("sysErrorCode");
|
|
|
if(isEmpty) {
|
|
|
@@ -31,6 +32,7 @@ public class DbApiService {
|
|
|
if(paramsKey.length() >= 4) {
|
|
|
fourBeforestring = paramsKey.substring(0,4);
|
|
|
if (fourBeforestring.equals("api_")) {
|
|
|
+ System.out.println("参数-------------------"+paramsValue);
|
|
|
bindData.put(paramsKey, paramsValue);
|
|
|
}
|
|
|
}
|
|
|
@@ -69,14 +71,11 @@ public class DbApiService {
|
|
|
Map res = new HashMap<>();
|
|
|
Object sql = sqlData.get("sql_string");// 获取sql语句
|
|
|
Object isList = sqlData.get("is_list");// 是否查单条数据
|
|
|
-
|
|
|
if(isList.equals(2)) {
|
|
|
// 如果查询单条数据
|
|
|
String selectSql = sql.toString();
|
|
|
- Map info = dbApiDao.dbCustomQueryForMap(selectSql, bindData);
|
|
|
- Integer count = info.isEmpty() ? 0 : 1;
|
|
|
- res.put("count", count);
|
|
|
- res.put("rows", info);
|
|
|
+ res = dbApiDao.dbCustomQueryForMap(selectSql, bindData);
|
|
|
+
|
|
|
} else if(isList.equals(1)) {
|
|
|
// 如果是查询列表
|
|
|
Integer nowPage = Integer.parseInt(page); // 当前第几页
|