|
|
@@ -179,6 +179,26 @@ public class ApiService {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ // sql管理列表-获取带分页的page数据
|
|
|
+ public Map sqlListHasPaging(Map<String, String> maps) {
|
|
|
+ String page = "1"; // 页数
|
|
|
+ String perPage = "15"; // 显示多少条
|
|
|
+ Map res = new HashMap<>();
|
|
|
+ Map bindData = commonUtil.filterApiBindParams(maps);
|
|
|
+ if(maps.containsKey("page")) {
|
|
|
+ page = maps.get("page");
|
|
|
+ }
|
|
|
+ if(maps.containsKey("perPage")) {
|
|
|
+ perPage = maps.get("perPage");
|
|
|
+ }
|
|
|
+ Integer count = pageDao.getAllSqlListHasPagingCount(bindData);
|
|
|
+ List info = pageDao.getAllSqlListHasPaging(bindData, page, perPage, count);
|
|
|
+ res.put("count", count);
|
|
|
+ res.put("rows", info);
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
// 获取全部sql_details
|
|
|
public List sqlList() {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
@@ -353,6 +373,47 @@ public class ApiService {
|
|
|
return retInfo;
|
|
|
}
|
|
|
|
|
|
+ // 添加sql_details表数据
|
|
|
+ public Map addSql(Map maps, String authorization) {
|
|
|
+ String sqlDesc = "";
|
|
|
+ String isList = maps.get("is_list").toString();
|
|
|
+ String sqlType = maps.get("sql_type").toString();
|
|
|
+ String isEnable = maps.get("is_enable").toString();
|
|
|
+ String sqlCode = maps.get("sql_code").toString();
|
|
|
+ String sqlName = maps.get("sql_name").toString();
|
|
|
+ String sqlString = maps.get("sql_string").toString();
|
|
|
+ if(maps.containsKey("sql_description")) {
|
|
|
+ sqlDesc = maps.get("sql_description").toString();
|
|
|
+ }
|
|
|
+ // 通过是否存在id,判读是新增还是修改
|
|
|
+ String editId = "";
|
|
|
+ if (maps.containsKey("id")) {
|
|
|
+ editId = maps.get("id").toString();
|
|
|
+ }
|
|
|
+ String createdAt = commonUtil.getNowYYMMDDHHIISS();
|
|
|
+ Map<String, Object> addPagePamars = new HashMap<>();
|
|
|
+ addPagePamars.put("isList", isList);
|
|
|
+ addPagePamars.put("sqlType", sqlType);
|
|
|
+ addPagePamars.put("isEnable", isEnable);
|
|
|
+ addPagePamars.put("sqlCode", sqlCode);
|
|
|
+ addPagePamars.put("sqlName", sqlName);
|
|
|
+ addPagePamars.put("sqlString", sqlString);
|
|
|
+ addPagePamars.put("sqlDesc", sqlDesc);
|
|
|
+ Map<String, Object> loginResult = this.userInfo(authorization);
|
|
|
+ addPagePamars.put("actionUser", loginResult.get("userName")); // 获取当前用户信息
|
|
|
+ if (editId.length()==0) {
|
|
|
+ // 如果不存在说明是新增
|
|
|
+ addPagePamars.put("createdAt", createdAt);
|
|
|
+ }
|
|
|
+ // 添加/编辑Sql
|
|
|
+ Integer pageId = apiDao.addSqlDetails(addPagePamars, editId);
|
|
|
+ Map retInfo = new HashMap<>();
|
|
|
+ if(pageId <= 0){
|
|
|
+ retInfo.put("sysErrorCode", "500");
|
|
|
+ }
|
|
|
+ return retInfo;
|
|
|
+ }
|
|
|
+
|
|
|
// 转换tree结构数据
|
|
|
private List<Map<String, Object>> treeMenu(List<Map<String, Object>> renderMenu){
|
|
|
// 处理的数据存在
|