Browse Source

docs: 添加说明文档

weijianghai 2 years ago
parent
commit
8cd5d687ea

+ 3 - 3
src/main/java/META-INF/MANIFEST.MF

@@ -1,3 +1,3 @@
-Manifest-Version: 1.0
-Main-Class: com.nokia.hb.HbApplication
-
+Manifest-Version: 1.0
+Main-Class: com.nokia.hb.HbApplication
+

+ 211 - 211
src/main/java/com/nokia/hb/Controller/DataViewController.java

@@ -1,211 +1,211 @@
-//package com.nokia.hb.Controller;
-//
-//import com.alibaba.fastjson.JSON;
-//import com.nokia.hb.Service.DataViewService;
-//import org.springframework.stereotype.Controller;
-//import org.springframework.web.bind.annotation.GetMapping;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.RequestParam;
-//import org.springframework.web.bind.annotation.ResponseBody;
-//
-//import javax.servlet.http.HttpServletResponse;
-//import java.io.ByteArrayInputStream;
-//import java.io.IOException;
-//import java.io.UnsupportedEncodingException;
-//import java.time.LocalDate;
-//import java.time.format.DateTimeFormatter;
-//import java.util.*;
-//
-//@Controller
-//@RequestMapping("/")
-//public class DataViewController {
-//    public DataViewService dataViewService = new DataViewService();
-//
-//    @GetMapping("initProvince")
-//    @ResponseBody
-//    public List<String> initProvince(String type) {
-//        System.out.println("initProvince");
-//        System.out.println(type);
-//        return dataViewService.initProvince(type);
-//
-//    }
-//
-//    @GetMapping("initCitys")
-//    @ResponseBody
-//    public List<String> initCitys(String type, String province) {
-//        System.out.println("initCitys");
-//        System.out.println(type);
-//        System.out.println(province);
-//
-//
-//        return dataViewService.initCitys(type, province);
-//
-//    }
-//
-//    @GetMapping("search")
-//    @ResponseBody
-//    public String search(String from, String range, String stype, String ttype, String provinces, String citys) {
-//        String[] split = range.split("-");
-//        String t1 = split[0].trim();
-//        String t2 = split[1].trim();
-//        if (!"".equals(citys)) {
-//            String[] split1 = citys.split(",");
-//            citys = "";
-//            for (String s : split1) {
-//                citys += "'" + s + "'" + ",";
-//            }
-//            citys = citys.substring(0, citys.length() - 1);
-//        }
-//        String[] split2 = provinces.split(",");
-//        provinces = "";
-//        for (String s : split2) {
-//            provinces += "'" + s + "'" + ",";
-//        }
-//        provinces = provinces.substring(0, provinces.length() - 1);
-//        Map<String, List<Object>> search = dataViewService.search(from, t1, t2, stype, ttype, provinces, citys);
-//        String s = JSON.toJSONString(search);
-//
-//        System.out.println(s);
-//        return s;
-//
-//    }
-//
-//
-//    @GetMapping("typeExport")
-//    public void typeExport(HttpServletResponse response, String from, String provinces, String citys, String ttype, String range) {
-//        //from :local roaming
-//        //etype :导出全量
-//        //ttype:天 7天
-//        //range: 20210721 - 20210728
-//
-//        String[] split = range.split("-");
-//        String t1 = split[0].trim();
-//        String t2 = split[1].trim();
-//
-//
-//
-//        String s = dataViewService.typeExport(from, provinces, citys, ttype, t1, t2);
-//
-//
-////        list.toString().getBytes();
-//        ByteArrayInputStream bis = null;
-//        try {
-//            bis = new ByteArrayInputStream(s.getBytes("gbk"));
-//        } catch (UnsupportedEncodingException e) {
-//            e.printStackTrace();
-//        }
-//        // 下载本地文件
-//        String fileName = "5GTypeDownload_" + range + ".csv"; // 文件的默认保存名
-//        // 读到流中
-//        //InputStream inStream = new FileInputStream("/home/ubantu/Desktop/seq.java");// 文件的存放路径
-//        // 设置输出的格式
-//        response.reset();
-//        response.setContentType("text/plain");
-//        response.addHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
-//        response.setCharacterEncoding("UTF-8");
-//        // 循环取出流中的数据
-//        byte[] b = new byte[100];
-//        int len;
-//        try {
-//            while ((len = bis.read(b)) > 0)
-//                response.getOutputStream().write(b, 0, len);
-//            bis.close();
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
-//
-//    @GetMapping("exportAll")
-//    public void typeExport(HttpServletResponse response, @RequestParam String ttype, @RequestParam String range) {
-//
-//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-//        String[] split = range.split("-");
-//        String sts = split[0].trim();
-//        String ets = split[1].trim();//最后日期
-//        LocalDate sld = LocalDate.parse(sts, formatter);
-//        LocalDate eld = LocalDate.parse(ets, formatter);
-//        LocalDate smld = sld.minusDays(Integer.valueOf(ttype));
-//        LocalDate emld = eld.minusDays(Integer.valueOf(ttype));
-//        String smts = formatter.format(smld);
-//        String emts = formatter.format(emld);
-//        String s = dataViewService.exportAll(ttype, sts, ets, smts, emts);
-//
-//
-////        list.toString().getBytes();
-//        ByteArrayInputStream bis = null;
-//        try {
-////            bis = new ByteArrayInputStream(s.getBytes("UTF-8"));
-//            bis = new ByteArrayInputStream(s.getBytes("gbk"));
-//        } catch (UnsupportedEncodingException e) {
-//            e.printStackTrace();
-//        }
-//        // 下载本地文件
-//        String fileName = "5GTypeAllDownload_" + range + ".csv"; // 文件的默认保存名
-//        // 读到流中
-//        //InputStream inStream = new FileInputStream("/home/ubantu/Desktop/seq.java");// 文件的存放路径
-//        // 设置输出的格式
-//        response.reset();
-//        response.setContentType("text/plain");
-//        response.addHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
-//        response.setCharacterEncoding("UTF-8");
-//        // 循环取出流中的数据
-//        byte[] b = new byte[100];
-//        int len;
-//        try {
-//            while ((len = bis.read(b)) > 0)
-//                response.getOutputStream().write(b, 0, len);
-//            bis.close();
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
-//
-//    @GetMapping("exportClose")
-//    public void typeExportClose(HttpServletResponse response, @RequestParam String ttype, @RequestParam String range) {
-//
-//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-//        String[] split = range.split("-");
-//        String sts = split[0].trim();
-//        String ets = split[1].trim();//最后日期
-//        LocalDate sld = LocalDate.parse(sts, formatter);
-//        LocalDate eld = LocalDate.parse(ets, formatter);
-//        LocalDate smld = sld.minusDays(Integer.valueOf(ttype));
-//        LocalDate emld = eld.minusDays(Integer.valueOf(ttype));
-//        String smts = formatter.format(smld);
-//        String emts = formatter.format(emld);
-//        String s = dataViewService.exportClose(ttype, sts, ets, smts, emts);
-//
-//
-////        list.toString().getBytes();
-//        ByteArrayInputStream bis = null;
-//        try {
-////            bis = new ByteArrayInputStream(s.getBytes("UTF-8"));
-//            bis = new ByteArrayInputStream(s.getBytes("gbk"));
-//        } catch (UnsupportedEncodingException e) {
-//            e.printStackTrace();
-//        }
-//        // 下载本地文件
-//        String fileName = "5GTypeCloseDownload_" + range + ".csv"; // 文件的默认保存名
-//        // 读到流中
-//        //InputStream inStream = new FileInputStream("/home/ubantu/Desktop/seq.java");// 文件的存放路径
-//        // 设置输出的格式
-//        response.reset();
-//        response.setContentType("text/plain");
-//        response.addHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
-//        response.setCharacterEncoding("UTF-8");
-//        // 循环取出流中的数据
-//        byte[] b = new byte[100];
-//        int len;
-//        try {
-//            while ((len = bis.read(b)) > 0)
-//                response.getOutputStream().write(b, 0, len);
-//            bis.close();
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
-//
-//}
+//package com.nokia.hb.Controller;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.nokia.hb.Service.DataViewService;
+//import org.springframework.stereotype.Controller;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RequestParam;
+//import org.springframework.web.bind.annotation.ResponseBody;
+//
+//import javax.servlet.http.HttpServletResponse;
+//import java.io.ByteArrayInputStream;
+//import java.io.IOException;
+//import java.io.UnsupportedEncodingException;
+//import java.time.LocalDate;
+//import java.time.format.DateTimeFormatter;
+//import java.util.*;
+//
+//@Controller
+//@RequestMapping("/")
+//public class DataViewController {
+//    public DataViewService dataViewService = new DataViewService();
+//
+//    @GetMapping("initProvince")
+//    @ResponseBody
+//    public List<String> initProvince(String type) {
+//        System.out.println("initProvince");
+//        System.out.println(type);
+//        return dataViewService.initProvince(type);
+//
+//    }
+//
+//    @GetMapping("initCitys")
+//    @ResponseBody
+//    public List<String> initCitys(String type, String province) {
+//        System.out.println("initCitys");
+//        System.out.println(type);
+//        System.out.println(province);
+//
+//
+//        return dataViewService.initCitys(type, province);
+//
+//    }
+//
+//    @GetMapping("search")
+//    @ResponseBody
+//    public String search(String from, String range, String stype, String ttype, String provinces, String citys) {
+//        String[] split = range.split("-");
+//        String t1 = split[0].trim();
+//        String t2 = split[1].trim();
+//        if (!"".equals(citys)) {
+//            String[] split1 = citys.split(",");
+//            citys = "";
+//            for (String s : split1) {
+//                citys += "'" + s + "'" + ",";
+//            }
+//            citys = citys.substring(0, citys.length() - 1);
+//        }
+//        String[] split2 = provinces.split(",");
+//        provinces = "";
+//        for (String s : split2) {
+//            provinces += "'" + s + "'" + ",";
+//        }
+//        provinces = provinces.substring(0, provinces.length() - 1);
+//        Map<String, List<Object>> search = dataViewService.search(from, t1, t2, stype, ttype, provinces, citys);
+//        String s = JSON.toJSONString(search);
+//
+//        System.out.println(s);
+//        return s;
+//
+//    }
+//
+//
+//    @GetMapping("typeExport")
+//    public void typeExport(HttpServletResponse response, String from, String provinces, String citys, String ttype, String range) {
+//        //from :local roaming
+//        //etype :导出全量
+//        //ttype:天 7天
+//        //range: 20210721 - 20210728
+//
+//        String[] split = range.split("-");
+//        String t1 = split[0].trim();
+//        String t2 = split[1].trim();
+//
+//
+//
+//        String s = dataViewService.typeExport(from, provinces, citys, ttype, t1, t2);
+//
+//
+////        list.toString().getBytes();
+//        ByteArrayInputStream bis = null;
+//        try {
+//            bis = new ByteArrayInputStream(s.getBytes("gbk"));
+//        } catch (UnsupportedEncodingException e) {
+//            e.printStackTrace();
+//        }
+//        // 下载本地文件
+//        String fileName = "5GTypeDownload_" + range + ".csv"; // 文件的默认保存名
+//        // 读到流中
+//        //InputStream inStream = new FileInputStream("/home/ubantu/Desktop/seq.java");// 文件的存放路径
+//        // 设置输出的格式
+//        response.reset();
+//        response.setContentType("text/plain");
+//        response.addHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
+//        response.setCharacterEncoding("UTF-8");
+//        // 循环取出流中的数据
+//        byte[] b = new byte[100];
+//        int len;
+//        try {
+//            while ((len = bis.read(b)) > 0)
+//                response.getOutputStream().write(b, 0, len);
+//            bis.close();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//
+//    @GetMapping("exportAll")
+//    public void typeExport(HttpServletResponse response, @RequestParam String ttype, @RequestParam String range) {
+//
+//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
+//        String[] split = range.split("-");
+//        String sts = split[0].trim();
+//        String ets = split[1].trim();//最后日期
+//        LocalDate sld = LocalDate.parse(sts, formatter);
+//        LocalDate eld = LocalDate.parse(ets, formatter);
+//        LocalDate smld = sld.minusDays(Integer.valueOf(ttype));
+//        LocalDate emld = eld.minusDays(Integer.valueOf(ttype));
+//        String smts = formatter.format(smld);
+//        String emts = formatter.format(emld);
+//        String s = dataViewService.exportAll(ttype, sts, ets, smts, emts);
+//
+//
+////        list.toString().getBytes();
+//        ByteArrayInputStream bis = null;
+//        try {
+////            bis = new ByteArrayInputStream(s.getBytes("UTF-8"));
+//            bis = new ByteArrayInputStream(s.getBytes("gbk"));
+//        } catch (UnsupportedEncodingException e) {
+//            e.printStackTrace();
+//        }
+//        // 下载本地文件
+//        String fileName = "5GTypeAllDownload_" + range + ".csv"; // 文件的默认保存名
+//        // 读到流中
+//        //InputStream inStream = new FileInputStream("/home/ubantu/Desktop/seq.java");// 文件的存放路径
+//        // 设置输出的格式
+//        response.reset();
+//        response.setContentType("text/plain");
+//        response.addHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
+//        response.setCharacterEncoding("UTF-8");
+//        // 循环取出流中的数据
+//        byte[] b = new byte[100];
+//        int len;
+//        try {
+//            while ((len = bis.read(b)) > 0)
+//                response.getOutputStream().write(b, 0, len);
+//            bis.close();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//
+//    @GetMapping("exportClose")
+//    public void typeExportClose(HttpServletResponse response, @RequestParam String ttype, @RequestParam String range) {
+//
+//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
+//        String[] split = range.split("-");
+//        String sts = split[0].trim();
+//        String ets = split[1].trim();//最后日期
+//        LocalDate sld = LocalDate.parse(sts, formatter);
+//        LocalDate eld = LocalDate.parse(ets, formatter);
+//        LocalDate smld = sld.minusDays(Integer.valueOf(ttype));
+//        LocalDate emld = eld.minusDays(Integer.valueOf(ttype));
+//        String smts = formatter.format(smld);
+//        String emts = formatter.format(emld);
+//        String s = dataViewService.exportClose(ttype, sts, ets, smts, emts);
+//
+//
+////        list.toString().getBytes();
+//        ByteArrayInputStream bis = null;
+//        try {
+////            bis = new ByteArrayInputStream(s.getBytes("UTF-8"));
+//            bis = new ByteArrayInputStream(s.getBytes("gbk"));
+//        } catch (UnsupportedEncodingException e) {
+//            e.printStackTrace();
+//        }
+//        // 下载本地文件
+//        String fileName = "5GTypeCloseDownload_" + range + ".csv"; // 文件的默认保存名
+//        // 读到流中
+//        //InputStream inStream = new FileInputStream("/home/ubantu/Desktop/seq.java");// 文件的存放路径
+//        // 设置输出的格式
+//        response.reset();
+//        response.setContentType("text/plain");
+//        response.addHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
+//        response.setCharacterEncoding("UTF-8");
+//        // 循环取出流中的数据
+//        byte[] b = new byte[100];
+//        int len;
+//        try {
+//            while ((len = bis.read(b)) > 0)
+//                response.getOutputStream().write(b, 0, len);
+//            bis.close();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//
+//}

+ 93 - 93
src/main/java/com/nokia/hb/Controller/TemplateController.java

@@ -1,93 +1,93 @@
-package com.nokia.hb.Controller;
-
-import com.nokia.hb.Pojo.RetData;
-import com.nokia.hb.Pojo.TreeNode;
-import com.nokia.hb.utils.DbUtil;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.servlet.http.HttpSession;
-import java.util.List;
-
-@Controller
-@RequestMapping("/")
-public class TemplateController {
-    /**
-     * 用户登录
-     */
-    @PostMapping("userLogin")
-    @ResponseBody
-    public Object userLogin(String username, String password, HttpSession session) {
-        return DbUtil.userLogin(username, password, session);
-    }
-
-    @GetMapping("initTreeCitys")
-    @ResponseBody
-    public List<TreeNode> initTreeCitys() {
-        return DbUtil.initTreeCitys();
-    }
-
-    @GetMapping("initTreeIndicator")
-    @ResponseBody
-    public List<TreeNode> initTreeIndicator() {
-        return DbUtil.initTreeIndicator();
-    }
-
-
-    @PostMapping("renderTable")
-    @ResponseBody
-    public RetData renderTable(String citys, String quxians, String indicators, String ttype, String sdate, HttpSession session) {
-
-        return DbUtil.renderTable(citys,quxians,indicators,ttype,sdate,session);
-    }
-    
-    @PostMapping({"conditionRenderTable"})
-    @ResponseBody
-    public RetData conditionRenderTable(String condition, String searchType, String indicators, String ttype, String sdate)
-    {
-      String[] split = condition.split("\n");
-      String c = "";
-      for (String s : split) {
-        c = c + "'" + s + "',";
-      }
-      c = c.substring(0, c.length() - 1);
-      return DbUtil.conditionRenderTable(c, searchType, indicators, ttype, sdate);
-    }
-
-    /**
-     * 添加指标模板
-     *
-     * @param templateName 指标模板名称
-     * @param indicators 指标
-     */
-    @PostMapping("addTemplate")
-    @ResponseBody
-    public Object addTemplate(String templateName, String indicators, HttpSession session) {
-
-        return DbUtil.addTemplate(templateName, indicators,session);
-    }
-
-    /**
-     * 获取指标模板
-     */
-    @GetMapping("initTreeIndicatorTemplate")
-    @ResponseBody
-    public List<TreeNode> initTreeIndicatorTemplate(HttpSession session) {
-        return DbUtil.initTreeIndicatorTemplate(session);
-    }
-
-    /**
-     * 删除指标模板
-     *
-     * @param ids 模板id
-     */
-    @PostMapping("deleteTemplate")
-    @ResponseBody
-    public Object deleteTemplate(String ids) {
-
-        return DbUtil.deleteTemplate(ids);
-    }
-}
+package com.nokia.hb.Controller;
+
+import com.nokia.hb.Pojo.RetData;
+import com.nokia.hb.Pojo.TreeNode;
+import com.nokia.hb.utils.DbUtil;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpSession;
+import java.util.List;
+
+@Controller
+@RequestMapping("/")
+public class TemplateController {
+    /**
+     * 用户登录
+     */
+    @PostMapping("userLogin")
+    @ResponseBody
+    public Object userLogin(String username, String password, HttpSession session) {
+        return DbUtil.userLogin(username, password, session);
+    }
+
+    @GetMapping("initTreeCitys")
+    @ResponseBody
+    public List<TreeNode> initTreeCitys() {
+        return DbUtil.initTreeCitys();
+    }
+
+    @GetMapping("initTreeIndicator")
+    @ResponseBody
+    public List<TreeNode> initTreeIndicator() {
+        return DbUtil.initTreeIndicator();
+    }
+
+
+    @PostMapping("renderTable")
+    @ResponseBody
+    public RetData renderTable(String citys, String quxians, String indicators, String ttype, String sdate, HttpSession session) {
+
+        return DbUtil.renderTable(citys,quxians,indicators,ttype,sdate,session);
+    }
+    
+    @PostMapping({"conditionRenderTable"})
+    @ResponseBody
+    public RetData conditionRenderTable(String condition, String searchType, String indicators, String ttype, String sdate)
+    {
+      String[] split = condition.split("\n");
+      String c = "";
+      for (String s : split) {
+        c = c + "'" + s + "',";
+      }
+      c = c.substring(0, c.length() - 1);
+      return DbUtil.conditionRenderTable(c, searchType, indicators, ttype, sdate);
+    }
+
+    /**
+     * 添加指标模板
+     *
+     * @param templateName 指标模板名称
+     * @param indicators 指标
+     */
+    @PostMapping("addTemplate")
+    @ResponseBody
+    public Object addTemplate(String templateName, String indicators, HttpSession session) {
+
+        return DbUtil.addTemplate(templateName, indicators,session);
+    }
+
+    /**
+     * 获取指标模板
+     */
+    @GetMapping("initTreeIndicatorTemplate")
+    @ResponseBody
+    public List<TreeNode> initTreeIndicatorTemplate(HttpSession session) {
+        return DbUtil.initTreeIndicatorTemplate(session);
+    }
+
+    /**
+     * 删除指标模板
+     *
+     * @param ids 模板id
+     */
+    @PostMapping("deleteTemplate")
+    @ResponseBody
+    public Object deleteTemplate(String ids) {
+
+        return DbUtil.deleteTemplate(ids);
+    }
+}

+ 43 - 43
src/main/java/com/nokia/hb/Controller/ViewController.java

@@ -1,43 +1,43 @@
-package com.nokia.hb.Controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.servlet.ModelAndView;
-
-@Controller
-@RequestMapping("/")
-public class ViewController {
-//    @GetMapping("view")
-//    public ModelAndView  view()
-//    {
-//        ModelAndView model = new ModelAndView("view");
-//        return model;
-//    }
-
-    /**
-     * 登录页面
-     */
-    @GetMapping("login")
-    public ModelAndView  login()
-    {
-        ModelAndView model = new ModelAndView("login");
-        return model;
-    }
-
-    @GetMapping("template")
-    public ModelAndView  template()
-    {
-        ModelAndView model = new ModelAndView("template");
-        return model;
-    }
-
-    @GetMapping("error")
-    public ModelAndView error()
-    {
-        ModelAndView model = new ModelAndView("error");
-        return model;
-    }
-
-
-}
+package com.nokia.hb.Controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping("/")
+public class ViewController {
+//    @GetMapping("view")
+//    public ModelAndView  view()
+//    {
+//        ModelAndView model = new ModelAndView("view");
+//        return model;
+//    }
+
+    /**
+     * 登录页面
+     */
+    @GetMapping("login")
+    public ModelAndView  login()
+    {
+        ModelAndView model = new ModelAndView("login");
+        return model;
+    }
+
+    @GetMapping("template")
+    public ModelAndView  template()
+    {
+        ModelAndView model = new ModelAndView("template");
+        return model;
+    }
+
+    @GetMapping("error")
+    public ModelAndView error()
+    {
+        ModelAndView model = new ModelAndView("error");
+        return model;
+    }
+
+
+}

+ 50 - 50
src/main/java/com/nokia/hb/Dao/DataViewDao.java

@@ -1,50 +1,50 @@
-//package com.nokia.hb.Dao;
-//
-//import com.alibaba.fastjson.JSON;
-//import com.nokia.hb.utils.DbUtil;
-//import javafx.application.Application;
-//import javafx.stage.Stage;
-//
-//import java.awt.image.DataBuffer;
-//import java.util.HashMap;
-//import java.util.List;
-//import java.util.Map;
-//
-//public class DataViewDao {
-//
-//
-//    public static String typeExport(String from, String provinces, String citys, String ttype, String t1, String t2) {
-//
-//
-//        return DbUtil.typeExport(from, provinces, citys, ttype, t1, t2);
-//    }
-//
-//    public static String exportAll(String ttype, String sts, String ets, String smts, String emts) {
-//        return DbUtil.exportAll(ttype, sts, ets, smts, emts);
-//    }
-//
-//    public static Map<String, List<Object>> search(String from, String t1, String t2, String stype, String ttype, String provinces, String citys) {
-//        Map<String, List<Object>>res = null;
-//        if("5G开关打开率".equals(stype)){
-//            res=DbUtil.searchRate(from, t1, t2, ttype, provinces, citys);
-//        }else {
-//            res=DbUtil.search(from, t1, t2, stype, ttype, provinces, citys);
-//        }
-//
-//        return res;
-//    }
-//
-//    public static String exportClose(String ttype, String sts, String ets, String smts, String emts) {
-//        return DbUtil.exportClose(ttype, sts, ets, smts, emts);
-//    }
-//
-//
-//    public List<String> initProvince(String type) {
-//        return DbUtil.initProvince(type);
-//    }
-//
-//    public List<String> initCitys(String type, String province) {
-//        return DbUtil.initCitys(type, province);
-//    }
-//
-//}
+//package com.nokia.hb.Dao;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.nokia.hb.utils.DbUtil;
+//import javafx.application.Application;
+//import javafx.stage.Stage;
+//
+//import java.awt.image.DataBuffer;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//public class DataViewDao {
+//
+//
+//    public static String typeExport(String from, String provinces, String citys, String ttype, String t1, String t2) {
+//
+//
+//        return DbUtil.typeExport(from, provinces, citys, ttype, t1, t2);
+//    }
+//
+//    public static String exportAll(String ttype, String sts, String ets, String smts, String emts) {
+//        return DbUtil.exportAll(ttype, sts, ets, smts, emts);
+//    }
+//
+//    public static Map<String, List<Object>> search(String from, String t1, String t2, String stype, String ttype, String provinces, String citys) {
+//        Map<String, List<Object>>res = null;
+//        if("5G开关打开率".equals(stype)){
+//            res=DbUtil.searchRate(from, t1, t2, ttype, provinces, citys);
+//        }else {
+//            res=DbUtil.search(from, t1, t2, stype, ttype, provinces, citys);
+//        }
+//
+//        return res;
+//    }
+//
+//    public static String exportClose(String ttype, String sts, String ets, String smts, String emts) {
+//        return DbUtil.exportClose(ttype, sts, ets, smts, emts);
+//    }
+//
+//
+//    public List<String> initProvince(String type) {
+//        return DbUtil.initProvince(type);
+//    }
+//
+//    public List<String> initCitys(String type, String province) {
+//        return DbUtil.initCitys(type, province);
+//    }
+//
+//}

+ 38 - 38
src/main/java/com/nokia/hb/Pojo/Col.java

@@ -1,38 +1,38 @@
-package com.nokia.hb.Pojo;
-
-public class Col {
-    String field;
-    String title;
-
-    public Col() {
-    }
-
-    public Col(String field, String title) {
-        this.field = field;
-        this.title = title;
-    }
-
-    public String getField() {
-        return field;
-    }
-
-    public void setField(String field) {
-        this.field = field;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    @Override
-    public String toString() {
-        return "{" +
-                "field:'" + field + '\'' +
-                ", title:'" + title + '\'' +
-                '}';
-    }
-}
+package com.nokia.hb.Pojo;
+
+public class Col {
+    String field;
+    String title;
+
+    public Col() {
+    }
+
+    public Col(String field, String title) {
+        this.field = field;
+        this.title = title;
+    }
+
+    public String getField() {
+        return field;
+    }
+
+    public void setField(String field) {
+        this.field = field;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    @Override
+    public String toString() {
+        return "{" +
+                "field:'" + field + '\'' +
+                ", title:'" + title + '\'' +
+                '}';
+    }
+}

+ 60 - 60
src/main/java/com/nokia/hb/Pojo/RetData.java

@@ -1,60 +1,60 @@
-package com.nokia.hb.Pojo;
-
-import java.util.List;
-import java.util.Map;
-
-public class RetData {
-    /**
-     * 错误信息
-     */
-    String msg;
-    List<Col> cols;
-    List<Map<String,String>> datas;
-
-    public RetData() {
-    }
-
-    public RetData(List<Col> cols, List<Map<String, String>> datas) {
-        this.cols = cols;
-        this.datas = datas;
-    }
-
-    public RetData(List<Col> cols, List<Map<String, String>> datas, String msg) {
-        this.cols = cols;
-        this.datas = datas;
-        this.msg = msg;
-    }
-
-    public List<Col> getCols() {
-        return cols;
-    }
-
-    public void setCols(List<Col> cols) {
-        this.cols = cols;
-    }
-
-    public List<Map<String, String>> getDatas() {
-        return datas;
-    }
-
-    public void setDatas(List<Map<String, String>> datas) {
-        this.datas = datas;
-    }
-
-    public String getMsg() {
-        return msg;
-    }
-
-    public void setMsg(String msg) {
-        this.msg = msg;
-    }
-
-    @Override
-    public String toString() {
-        return "RetData{" +
-                "msg='" + msg + '\'' +
-                ", cols=" + cols +
-                ", datas=" + datas +
-                '}';
-    }
-}
+package com.nokia.hb.Pojo;
+
+import java.util.List;
+import java.util.Map;
+
+public class RetData {
+    /**
+     * 错误信息
+     */
+    String msg;
+    List<Col> cols;
+    List<Map<String,String>> datas;
+
+    public RetData() {
+    }
+
+    public RetData(List<Col> cols, List<Map<String, String>> datas) {
+        this.cols = cols;
+        this.datas = datas;
+    }
+
+    public RetData(List<Col> cols, List<Map<String, String>> datas, String msg) {
+        this.cols = cols;
+        this.datas = datas;
+        this.msg = msg;
+    }
+
+    public List<Col> getCols() {
+        return cols;
+    }
+
+    public void setCols(List<Col> cols) {
+        this.cols = cols;
+    }
+
+    public List<Map<String, String>> getDatas() {
+        return datas;
+    }
+
+    public void setDatas(List<Map<String, String>> datas) {
+        this.datas = datas;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String toString() {
+        return "RetData{" +
+                "msg='" + msg + '\'' +
+                ", cols=" + cols +
+                ", datas=" + datas +
+                '}';
+    }
+}

+ 74 - 74
src/main/java/com/nokia/hb/Pojo/TreeNode.java

@@ -1,74 +1,74 @@
-package com.nokia.hb.Pojo;
-
-import java.util.List;
-
-public class TreeNode {
-
-    String title = "";
-    String id = "";
-    boolean spread = false;
-    List<TreeNode> children = null;
-
-    public TreeNode() {
-    }
-
-    public TreeNode(String title, String id, List<TreeNode> children) {
-        this.title = title;
-        this.id = id;
-        this.children = children;
-    }
-
-    public TreeNode(String title, String id, boolean spread, List<TreeNode> children) {
-        this.title = title;
-        this.id = id;
-        this.spread = spread;
-        this.children = children;
-    }
-
-    public TreeNode(String title, String id) {
-        this.title = title;
-        this.id = id;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public boolean isSpread() {
-        return spread;
-    }
-
-    public void setSpread(boolean spread) {
-        this.spread = spread;
-    }
-
-    public List<TreeNode> getChildren() {
-        return children;
-    }
-
-    public void setChildren(List<TreeNode> children) {
-        this.children = children;
-    }
-
-    @Override
-    public String toString() {
-        return "TreeNode{" +
-                "title='" + title + '\'' +
-                ", id='" + id + '\'' +
-                ", spread=" + spread +
-                ", children=" + children +
-                '}';
-    }
-}
+package com.nokia.hb.Pojo;
+
+import java.util.List;
+
+public class TreeNode {
+
+    String title = "";
+    String id = "";
+    boolean spread = false;
+    List<TreeNode> children = null;
+
+    public TreeNode() {
+    }
+
+    public TreeNode(String title, String id, List<TreeNode> children) {
+        this.title = title;
+        this.id = id;
+        this.children = children;
+    }
+
+    public TreeNode(String title, String id, boolean spread, List<TreeNode> children) {
+        this.title = title;
+        this.id = id;
+        this.spread = spread;
+        this.children = children;
+    }
+
+    public TreeNode(String title, String id) {
+        this.title = title;
+        this.id = id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public boolean isSpread() {
+        return spread;
+    }
+
+    public void setSpread(boolean spread) {
+        this.spread = spread;
+    }
+
+    public List<TreeNode> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<TreeNode> children) {
+        this.children = children;
+    }
+
+    @Override
+    public String toString() {
+        return "TreeNode{" +
+                "title='" + title + '\'' +
+                ", id='" + id + '\'' +
+                ", spread=" + spread +
+                ", children=" + children +
+                '}';
+    }
+}

+ 37 - 37
src/main/java/com/nokia/hb/Service/DataViewService.java

@@ -1,37 +1,37 @@
-//package com.nokia.hb.Service;
-//
-//import com.nokia.hb.Dao.DataViewDao;
-//import org.springframework.stereotype.Service;
-//
-//import java.util.HashMap;
-//import java.util.List;
-//import java.util.Map;
-//
-//@Service
-//public class DataViewService {
-//    public DataViewDao dataViewDao = new DataViewDao();
-//
-//    public List<String> initProvince(String type) {
-//        return dataViewDao.initProvince(type);
-//    }
-//
-//    public List<String> initCitys(String type, String province) {
-//        return dataViewDao.initCitys(type, province);
-//    }
-//
-//    public String typeExport(String from, String provinces, String citys, String ttype, String t1, String t2) {
-//        return DataViewDao.typeExport(from, provinces, citys, ttype, t1, t2);
-//    }
-//
-//    public String exportAll(String ttype, String sts, String ets, String smts, String emts) {
-//        return DataViewDao.exportAll(ttype, sts, ets, smts, emts);
-//    }
-//
-//    public Map<String, List<Object>> search(String from, String t1, String t2, String stype, String ttype, String provinces, String citys) {
-//        return DataViewDao.search(from, t1, t2, stype, ttype, provinces, citys);
-//    }
-//
-//    public String exportClose(String ttype, String sts, String ets, String smts, String emts) {
-//        return DataViewDao.exportClose(ttype, sts, ets, smts, emts);
-//    }
-//}
+//package com.nokia.hb.Service;
+//
+//import com.nokia.hb.Dao.DataViewDao;
+//import org.springframework.stereotype.Service;
+//
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//@Service
+//public class DataViewService {
+//    public DataViewDao dataViewDao = new DataViewDao();
+//
+//    public List<String> initProvince(String type) {
+//        return dataViewDao.initProvince(type);
+//    }
+//
+//    public List<String> initCitys(String type, String province) {
+//        return dataViewDao.initCitys(type, province);
+//    }
+//
+//    public String typeExport(String from, String provinces, String citys, String ttype, String t1, String t2) {
+//        return DataViewDao.typeExport(from, provinces, citys, ttype, t1, t2);
+//    }
+//
+//    public String exportAll(String ttype, String sts, String ets, String smts, String emts) {
+//        return DataViewDao.exportAll(ttype, sts, ets, smts, emts);
+//    }
+//
+//    public Map<String, List<Object>> search(String from, String t1, String t2, String stype, String ttype, String provinces, String citys) {
+//        return DataViewDao.search(from, t1, t2, stype, ttype, provinces, citys);
+//    }
+//
+//    public String exportClose(String ttype, String sts, String ets, String smts, String emts) {
+//        return DataViewDao.exportClose(ttype, sts, ets, smts, emts);
+//    }
+//}

+ 836 - 836
src/main/java/com/nokia/hb/utils/DbUtil.java

@@ -1,836 +1,836 @@
-package com.nokia.hb.utils;
-
-import com.nokia.hb.Pojo.Col;
-import com.nokia.hb.Pojo.RetData;
-import com.nokia.hb.Pojo.TreeNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.util.StringUtils;
-
-import javax.servlet.http.HttpSession;
-import java.sql.*;
-import java.util.*;
-
-@SuppressWarnings("unchecked")
-public class DbUtil {
-    private static final Logger log = LoggerFactory.getLogger(DbUtil.class);
-    private static Connection conn = null;
-
-    // private final static String url =
-    // "jdbc:postgresql://127.0.0.1:5432/postgres";
-    // private final static String user = "postgres";
-    // private final static String password = "ava1234";
-
-    private final static String url = "jdbc:postgresql://10.100.68.195:5432/sqmmt";
-    private final static String user = "pmparse";
-    private final static String password = "abc123!";
-
-    static {
-        try {
-            conn = DriverManager.getConnection(url, user, password);
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static Map<String, String> initZnEnMap() {
-        String sql = "select distinct indicator_en,indicator_cn from pm_parse.per_cfg_indicator;";
-        Map<String, String> m = new HashMap<>();
-        m.put("cellname", "小区中文名");
-        m.put("city", "地市");
-        m.put("quxian", "区县");
-        m.put("vendor", "厂家");
-        try {
-            PreparedStatement psmt = null;
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(600);
-            ResultSet rs = psmt.executeQuery();
-            while (rs.next()) {
-                m.put(rs.getString("indicator_en"), rs.getString("indicator_cn"));
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-        return m;
-    }
-
-    public static RetData conditionRenderTable(String condition, String searchType, String indicators, String ttype,
-            String sdate) {
-        Map<String, String> ezMap = initZnEnMap();
-        String[] timeArray = sdate.split(" - ");
-        String startTime = timeArray[0];
-        String endTime = timeArray[1];
-        String sql = "select a.cellname,a.city,a.quxian,a.vendor,b.* from \n(select eci,cellname,city,quxian,vendor from pm_parse.per_cfg_cell where "
-                + searchType + " in (" + condition + ")) a\ninner join \n(select " + indicators
-                + " from pm_parse.pm_4g_" + ttype + " where sdate>='" + startTime + "' and sdate <= '" + endTime
-                + "') b\n" + "on a.eci=b.eci";
-        // 全网
-        if ("all".equals(searchType)) {
-            sql = "select a.cellname,a.city,a.quxian,a.vendor,b.* from pm_parse.per_cfg_cell a\ninner join \n(select "
-                    + indicators + " from pm_parse.pm_4g_" + ttype + " where sdate>='" + startTime + "' and sdate <= '"
-                    + endTime + "') b\n" + "on a.eci=b.eci";
-        }
-
-        List<Map<String, String>> datas = new ArrayList<>();
-        List<Col> cols = new ArrayList<>();
-        try {
-            PreparedStatement psmt = null;
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(600);
-            ResultSet rs = psmt.executeQuery();
-            ResultSetMetaData rsmd = rs.getMetaData();
-            List<String> heads = new ArrayList<>();
-            String columnName;
-            for (int i = 1; i <= rsmd.getColumnCount(); i++) {
-                columnName = rsmd.getColumnName(i);
-                heads.add(columnName);
-                cols.add(new Col(columnName, (String) ezMap.get(columnName)));
-            }
-            while (rs.next()) {
-                Map<String, String> m = new HashMap<>();
-                for (String head : heads) {
-                    String string = rs.getString(head);
-                    m.put(head, string);
-                }
-                datas.add(m);
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-        return new RetData(cols, datas);
-    }
-
-    public static RetData renderTable(String citys, String quxians, String indicators, String ttype, String sdate,
-            HttpSession session) {
-        log.debug("indicators: {}", indicators);
-        log.debug("citys: {}", citys);
-        log.debug("quxians: {}", quxians);
-        log.debug("ttype: {}", ttype);
-        log.debug("sdate: {}", sdate);
-        // 获取城市数组
-        String[] cityArray = StringUtils.delete(citys, "'").split(",");
-        // 获取拥有的城市权限
-        Map<String, String> areas = (Map<String, String>) session.getAttribute("areas");
-        log.debug("{} areas: {}", areas.keySet().size(), areas.keySet());
-        log.debug("{} cityArray: {}", cityArray.length, Arrays.toString(cityArray));
-        // 地区权限校验
-        for (String t : cityArray) {
-            if (!areas.containsKey(t)) {
-                log.debug("没有权限的city: {}", t);
-                return new RetData(null, null, "没有" + t + "的权限");
-            }
-        }
-
-        String[] timeArray = sdate.split(" - ");
-        String startTime = timeArray[0];
-        String endTime = timeArray[1];
-
-        String sql = "select b.* from \n" +
-                "(select eci from pm_parse.per_cfg_cell where quxian in (" + quxians + ")) a\n" +
-                "inner join \n" +
-                "(select eci," + indicators + " from pm_parse.pm_4g_" + ttype +
-                " where sdate>='" + startTime +
-                "' and sdate <= '" + endTime + "') b\n" +
-                "on a.eci=b.eci";
-
-        if (indicators.contains("eci")) {
-            sql = "select b.* from \n" +
-                    "(select eci from pm_parse.per_cfg_cell where quxian in (" + quxians + ")) a\n" +
-                    "inner join \n" +
-                    "(select " + indicators + " from pm_parse.pm_4g_" + ttype +
-                    " where sdate>='" + startTime +
-                    "' and sdate <= '" + endTime + "') b\n" +
-                    "on a.eci=b.eci";
-        }
-        List<Map<String, String>> datas = new ArrayList<>();
-        List<Col> cols = new ArrayList<>();
-        try {
-            PreparedStatement psmt = null;
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(60 * 10);
-            ResultSet rs = psmt.executeQuery();
-            ResultSetMetaData rsmd = rs.getMetaData();
-            List<String> heads = new ArrayList<>();
-
-            for (int i = 1; i <= rsmd.getColumnCount(); i++) {
-                String columnName = rsmd.getColumnName(i);
-                heads.add(columnName);
-                cols.add(new Col(columnName, columnName));
-            }
-            while (rs.next()) {
-                Map<String, String> m = new HashMap<>();
-                for (String head : heads) {
-                    String string = rs.getString(head);
-                    m.put(head, string);
-                }
-                datas.add(m);
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-        return new RetData(cols, datas);
-    }
-
-    public static List<TreeNode> initTreeCitys() {
-        String sql = "select distinct * from pm_parse.per_cfg_area order by city,quxian";
-        PreparedStatement psmt = null;
-        TreeNode allTree = new TreeNode("地市选择", "地市选择", new ArrayList<>());
-        // int i = 0;
-        try {
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(60 * 10);
-            ResultSet rs = psmt.executeQuery();
-            Map<String, List<TreeNode>> m = new HashMap<>();
-
-            while (rs.next()) {
-                String city = rs.getString("city");
-                String quxian = rs.getString("quxian");
-                String id = city + quxian;
-                TreeNode t = new TreeNode(quxian, id, null);
-                if (m.keySet().contains(city)) {
-                    m.get(city).add(t);
-                } else {
-                    List<TreeNode> l = new ArrayList<>();
-                    l.add(t);
-                    m.put(city, l);
-                }
-
-            }
-
-            for (String s : m.keySet()) {
-                allTree.getChildren().add(new TreeNode(s, s, m.get(s)));
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-        List<TreeNode> res = new ArrayList<>();
-        allTree.setSpread(true);
-        res.add(allTree);
-        log.debug("initTreeCitys: {}", res);
-        return res;
-    }
-
-    public static List<TreeNode> initTreeIndicator() {
-        // String sql = "select distinct * from pm_parse.per_cfg_indicator order by
-        // indicator_type,indicator_cn,indicator_en";
-        String sql = "select distinct * from pm_parse.per_cfg_indicator order by indicator_id,indicator_type,indicator_cn,indicator_en";
-        PreparedStatement psmt = null;
-        TreeNode allTree = new TreeNode("指标选择", "指标选择", new ArrayList<>());
-        try {
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(60 * 10);
-            ResultSet rs = psmt.executeQuery();
-            Map<String, List<TreeNode>> m = new HashMap<>();
-
-            while (rs.next()) {
-                String indicator_type = rs.getString("indicator_type");
-                String indicator_cn = rs.getString("indicator_cn");
-                String indicator_id = rs.getString("indicator_id");
-                TreeNode t = new TreeNode(indicator_cn, indicator_id, null);
-                if (m.keySet().contains(indicator_type)) {
-                    m.get(indicator_type).add(t);
-                } else {
-                    List<TreeNode> l = new ArrayList<>();
-                    l.add(t);
-                    m.put(indicator_type, l);
-                }
-
-            }
-            // int i = 0;
-            for (String s : m.keySet()) {
-                allTree.getChildren().add(new TreeNode(s, s, m.get(s)));
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-        List<TreeNode> res = new ArrayList<>();
-        allTree.setSpread(true);
-        res.add(allTree);
-        log.debug("initTreeIndicator: {}", res);
-        return res;
-    }
-
-    // public static Map<String, List<Object>> searchRate(String from, String t1,
-    // String t2, String ttype, String provinces, String citys) {
-    //
-    //
-    // HashMap<String, List<Object>> res = new HashMap<>();
-    // PreparedStatement psmt = null;
-    // String pn = "province_name";
-    // String cn = "city_name";
-    // if ("roaming".equals(from)) {
-    // pn = "roaming_province_name";
-    // cn = "roaming_city_name";
-    // }
-    // String sql = "select a.sdate as dt,round(a.openusers/b.users,4) as num from
-    // \n" +
-    // "(select sdate,sum(user_count) as openusers from
-    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
-    // stype='打开5G开关用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
-    // provinces + ") and " + cn + " in (" + citys + ") group by sdate ) a\n" +
-    // "inner join\n" +
-    // "(select sdate,sum(user_count) as users from
-    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
-    // stype='5G终端用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
-    // provinces + ") and " + cn + " in (" + citys + ") group by sdate) b\n" +
-    // "on a.sdate=b.sdate\n" +
-    // "order by a.sdate";
-    // if ("".equals(citys)) {
-    // sql = "select a.sdate as dt,round(a.openusers/b.users,4) as num from \n" +
-    // "(select sdate,sum(user_count) as openusers from
-    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
-    // stype='打开5G开关用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
-    // provinces + ") group by sdate ) a\n" +
-    // "inner join\n" +
-    // "(select sdate,sum(user_count) as users from
-    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
-    // stype='5G终端用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
-    // provinces + ") group by sdate) b\n" +
-    // "on a.sdate=b.sdate\n" +
-    // "order by a.sdate";
-    // }
-    //
-    // List<Object> dtList = new ArrayList<>();
-    // List<Object> numList = new ArrayList<>();
-    // try {
-    // psmt = conn.prepareStatement(sql);
-    //
-    // psmt.setQueryTimeout(60 * 10);
-    // psmt.setLong(1, Integer.valueOf(t1));
-    // psmt.setLong(2, Integer.valueOf(t2));
-    // psmt.setLong(3, Integer.valueOf(t1));
-    // psmt.setLong(4, Integer.valueOf(t2));
-    //
-    //// psmt.setString(5,provinces);
-    //// psmt.setString(6,citys);
-    // ResultSet rs = psmt.executeQuery();
-    // while (rs.next()) {
-    // String dt = rs.getString("dt");
-    // Long num = rs.getLong("num");
-    // dtList.add(dt);
-    // numList.add(num);
-    // }
-    // res.put("dt", dtList);
-    // res.put("num", numList);
-    // } catch (SQLException e) {
-    // e.printStackTrace();
-    // }
-    // return res;
-    // }
-
-    // public static HashMap<String, List<Object>> search(String from, String t1,
-    // String t2, String stype, String ttype, String provinces, String citys) {
-    // HashMap<String, List<Object>> res = new HashMap<>();
-    // PreparedStatement psmt = null;
-    // String pn = "province_name";
-    // String cn = "city_name";
-    // if ("roaming".equals(from)) {
-    // pn = "roaming_province_name";
-    // cn = "roaming_city_name";
-    // }
-    //// String sql = "select sdate,sum(user_count) from
-    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between '20210720' and
-    // '20210727' and stype='5G终端用户数' and size_type='7天' and province_name in ('河北')
-    // and city_name in ('石家庄','唐山') group by sdate;";
-    // String sql = "select sdate as dt ,sum(user_count) as num from
-    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
-    // stype=? and size_type=? and " + pn + " in (" + provinces + ") and " + cn + "
-    // in (" + citys + ") group by sdate order by sdate;";
-    // if ("".equals(citys)) {
-    // sql = "select sdate as dt ,sum(user_count) as num from
-    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
-    // stype=? and size_type=? and " + pn + " in (" + provinces + ") group by sdate
-    // order by sdate;";
-    // }
-    //
-    // List<Object> dtList = new ArrayList<>();
-    // List<Object> numList = new ArrayList<>();
-    // try {
-    // psmt = conn.prepareStatement(sql);
-    //
-    // psmt.setQueryTimeout(60 * 10);
-    // psmt.setLong(1, Integer.valueOf(t1));
-    // psmt.setLong(2, Integer.valueOf(t2));
-    // psmt.setString(3, stype);
-    // psmt.setString(4, ttype + "天");
-    //// psmt.setString(5,provinces);
-    //// psmt.setString(6,citys);
-    // ResultSet rs = psmt.executeQuery();
-    // while (rs.next()) {
-    // String dt = rs.getString("dt");
-    // Long num = rs.getLong("num");
-    // dtList.add(dt);
-    // numList.add(num);
-    // }
-    // res.put("dt", dtList);
-    // res.put("num", numList);
-    // } catch (SQLException e) {
-    // e.printStackTrace();
-    // }
-    // return res;
-    // }
-
-    // public static String typeExport(String from, String provinces, String citys,
-    // String ttype, String t1, String t2) {
-    // String res = "";
-    // String pn = "province_name";
-    // String cn = "city_name";
-    // String guishu = "归属地";
-    // String area = citys;
-    // if ("roaming".equals(from)) {
-    // pn = "roaming_province_name";
-    // cn = "roaming_city_name";
-    // guishu = "拜访地";
-    // }
-    // String sql = "with tab as (\n" +
-    // "select distinct\n" +
-    // "stype,\n" +
-    // "'" + guishu + "' as 维度, \n" +
-    // "size_type as 粒度,\n" +
-    // "'" + area + "' as 区域, \n" +
-    // "sdate as 日期,\n" +
-    // "sum(user_count) over(partition by stype,sdate,size_type) as user_count\n" +
-    // "from sqmdb_5g.user_terminal_status_5g_abstract\n" +
-    // "where sdate between ? and ? \n" +
-    // "and " + pn + " in ('" + provinces + "') and " + cn + " in ('" + citys + "')
-    // \n" +
-    // "and size_type = '" + ttype + "天'\n" +
-    // ") \n" +
-    // "\n" +
-    // "select \n" +
-    // "a.维度,\n" +
-    // "a.粒度,\n" +
-    // "a.区域,\n" +
-    // "a.日期,\n" +
-    // "sum(a.user_count) as 终端用户数,\n" +
-    // "sum(b.user_count) as 打开5G开关用户数,\n" +
-    // "sum(c.user_count) as 关闭5G开关用户数,\n" +
-    // "round(sum(b.user_count)/sum(a.user_count),4) as 开关打开率\n" +
-    // "from tab a\n" +
-    // "join tab b on b.日期=a.日期 and b.stype = '打开5G开关用户数'\n" +
-    // "join tab c on c.日期=a.日期 and c.stype = '关闭5G开关用户数'\n" +
-    // "where a.stype = '5G终端用户数'\n" +
-    // "group by \n" +
-    // "a.维度,\n" +
-    // "a.粒度,\n" +
-    // "a.区域,\n" +
-    // "a.日期\n" +
-    // "order by 日期";
-    //
-    // if ("".equals(citys)) {
-    // area = provinces;
-    // sql = "with tab as (\n" +
-    // "select distinct\n" +
-    // "stype,\n" +
-    // "'" + guishu + "' as 维度, \n" +
-    // "size_type as 粒度,\n" +
-    // "'" + area + "' as 区域, \n" +
-    // "sdate as 日期,\n" +
-    // "sum(user_count) over(partition by stype,sdate,size_type) as user_count\n" +
-    // "from sqmdb_5g.user_terminal_status_5g_abstract\n" +
-    // "where sdate between ? and ? \n" +
-    // "and " + pn + " in ('" + provinces + "') \n" +
-    // "and size_type = '" + ttype + "天'\n" +
-    // ") \n" +
-    // "\n" +
-    // "select \n" +
-    // "a.维度,\n" +
-    // "a.粒度,\n" +
-    // "a.区域,\n" +
-    // "a.日期,\n" +
-    // "sum(a.user_count) as 终端用户数,\n" +
-    // "sum(b.user_count) as 打开5G开关用户数,\n" +
-    // "sum(c.user_count) as 关闭5G开关用户数,\n" +
-    // "round(sum(b.user_count)/sum(a.user_count),4) as 开关打开率\n" +
-    // "from tab a\n" +
-    // "join tab b on b.日期=a.日期 and b.stype = '打开5G开关用户数'\n" +
-    // "join tab c on c.日期=a.日期 and c.stype = '关闭5G开关用户数'\n" +
-    // "where a.stype = '5G终端用户数'\n" +
-    // "group by \n" +
-    // "a.维度,\n" +
-    // "a.粒度,\n" +
-    // "a.区域,\n" +
-    // "a.日期\n" +
-    // "order by 日期";
-    // }
-    //
-    //
-    // PreparedStatement psmt = null;
-    //
-    //
-    // try {
-    // psmt = conn.prepareStatement(sql);
-    // psmt.setQueryTimeout(60 * 10);
-    //
-    // psmt.setLong(1, Integer.valueOf(t1));
-    // psmt.setLong(2, Integer.valueOf(t2));
-    // ResultSet rs = psmt.executeQuery();
-    // res = rsprocess(rs);
-    // } catch (SQLException e) {
-    // e.printStackTrace();
-    // }
-    // return res;
-    // }
-
-    // public static String exportAll(String ttype, String sts, String ets, String
-    // smts, String emts) {
-    // String res = "";
-    // String range = smts + "-" + ets;
-    // PreparedStatement psmt = null;
-    // String sql = "select '" + ttype + "天' as \"粒度\",\n" +
-    // "'" + range + "' as \"开始(结束)时间\",\n" +
-    // "msisdn as \"号码\",\n" +
-    // "province_name as \"归属省\",\n" +
-    // "city_name as \"归属地市\",\n" +
-    // "roaming_province_name as \"拜访省\",\n" +
-    // "roaming_city_name as \"拜访地市\",\n" +
-    // "tml_brand as \"终端品牌\",\n" +
-    // "tml_name as \"终端型号\",\n" +
-    // "case when last_open_date >= ? then 1 else 0 end as \"开关是否打开\" \n" +
-    // "from sqmdb_5g.user_terminal_status_5g_agg\n" +
-    // "where sdate=? \n" +
-    // "and last_chg_date >= ? ";
-    //
-    // try {
-    // psmt = conn.prepareStatement(sql);
-    // psmt.setQueryTimeout(60 * 10);
-    //
-    // psmt.setLong(1, Integer.valueOf(emts));
-    // psmt.setLong(2, Integer.valueOf(ets));
-    // psmt.setLong(3, Integer.valueOf(emts));
-    //
-    // ResultSet rs = psmt.executeQuery();
-    // res = rsprocess(rs);
-    // } catch (SQLException e) {
-    // e.printStackTrace();
-    // }
-    // return res;
-    // }
-
-    // public static String exportClose(String ttype, String sts, String ets, String
-    // smts, String emts) {
-    // String res = "";
-    // String range = smts + "-" + ets;
-    // PreparedStatement psmt = null;
-    // String sql = "select '" + ttype + "天' as \"粒度\",\n" +
-    // "'" + range + "' as \"开始(结束)时间\",\n" +
-    // "msisdn as \"号码\",\n" +
-    // "province_name as \"归属省\",\n" +
-    // "city_name as \"归属地市\",\n" +
-    // "roaming_province_name as \"拜访省\",\n" +
-    // "roaming_city_name as \"拜访地市\",\n" +
-    // "tml_brand as \"终端品牌\",\n" +
-    // "tml_name as \"终端型号\",\n" +
-    // "0 as \"开关是否打开\"\n" +
-    // "from sqmdb_5g.user_terminal_status_5g_agg\n" +
-    // "where sdate=? \n" +
-    // "and last_chg_date >= ? \n" +
-    // "and (last_open_date < ? or last_open_date is null) ";
-    //
-    // try {
-    // psmt = conn.prepareStatement(sql);
-    // psmt.setQueryTimeout(60 * 10);
-    //
-    // psmt.setLong(1, Integer.valueOf(ets));
-    // psmt.setLong(2, Integer.valueOf(emts));
-    // psmt.setLong(3, Integer.valueOf(emts));
-    //
-    // ResultSet rs = psmt.executeQuery();
-    // res = rsprocess(rs);
-    // } catch (SQLException e) {
-    // e.printStackTrace();
-    // }
-    // return res;
-    // }
-
-    // public static String rsprocess(ResultSet rs) {
-    // List<String> heads = new ArrayList<>();
-    // String headStr = "";
-    // StringBuffer sb = new StringBuffer();
-    // try {
-    // ResultSetMetaData rsmd = rs.getMetaData();
-    // for (int i = 1; i <= rsmd.getColumnCount(); i++) {
-    // String columnName = rsmd.getColumnName(i);
-    // heads.add(columnName);
-    // headStr += columnName + ",";
-    //
-    // }
-    //
-    // headStr = headStr.substring(0, headStr.length() - 1);
-    // sb.append(headStr + "\n");
-    // while (rs.next()) {
-    // String line = "";
-    // for (String head : heads) {
-    // line += rs.getString(head) + ",";
-    //
-    // }
-    // line = line.substring(0, line.length() - 1);
-    // sb.append(line + "\n");
-    // }
-    //
-    // } catch (SQLException throwables) {
-    // throwables.printStackTrace();
-    // }
-    // return sb.toString();
-    // }
-
-    public static Object userLogin(String username, String password, HttpSession session) {
-        log.debug("username: {}, password: {}", username, password);
-        // 查询用户信息
-        String sql = "select * from pm_parse.user where username='" + username + "'";
-        PreparedStatement psmt;
-        try {
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(60 * 10);
-            ResultSet rs = psmt.executeQuery();
-            // 没有查到数据
-            if (!rs.next()) {
-                return "用户名或密码错误!";
-            }
-
-            String passwordStore = rs.getString("password");
-            log.debug("passwordStore: {}", passwordStore);
-            // 密码错误
-            if (!password.equals(passwordStore)) {
-                return "用户名或密码错误!";
-            }
-
-            // 查询地区权限
-            sql = "select area from pm_parse.user_area where username='" + username + "'";
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(60 * 10);
-            rs = psmt.executeQuery();
-            Map<String, String> map = new HashMap<>();
-            while (rs.next()) {
-                String area = rs.getString("area");
-                map.put(area, "");
-            }
-
-            log.debug("areas: {}", map.keySet());
-            // 保存session
-            session.setMaxInactiveInterval(30 * 60);
-            session.setAttribute("username", username);
-            session.setAttribute("areas", map);
-            return null;
-        } catch (SQLException e) {
-            e.printStackTrace();
-            return "数据库异常!";
-        }
-    }
-
-    public static Object addTemplate(String templateName, String indicators, HttpSession session) {
-        log.debug("templateName: {}", templateName);
-        log.debug("indicators: {}", indicators);
-        String username = (String) session.getAttribute("username");
-        long id = System.currentTimeMillis();
-        String sql = "insert into pm_parse.indicator_template (id, template_name, username) values (?, ?, ?)";
-        PreparedStatement psmt;
-        try {
-            conn.setAutoCommit(false);
-            psmt = conn.prepareStatement(sql);
-            psmt.setObject(1, id);
-            psmt.setObject(2, templateName);
-            psmt.setObject(3, username);
-            int rs = psmt.executeUpdate();
-            if (rs < 1) {
-                conn.rollback();
-                return "添加失败";
-            }
-
-            String[] indicatorArray = StringUtils.delete(indicators, "'").split(",");
-            sql = "insert into pm_parse.indicator_template_item (template_id, indicator_id) values (?, ?)";
-            psmt = conn.prepareStatement(sql);
-            for (String s : indicatorArray) {
-                psmt.setObject(1, id);
-                psmt.setObject(2, Integer.valueOf(s));
-                rs = psmt.executeUpdate();
-                if (rs < 1) {
-                    conn.rollback();
-                    return "添加失败";
-                }
-            }
-
-            conn.commit();
-        } catch (SQLException e) {
-            e.printStackTrace();
-            try {
-                conn.rollback();
-            } catch (SQLException ex) {
-                e.printStackTrace();
-                return "添加失败";
-            }
-            return "添加失败";
-        }
-
-        return null;
-    }
-
-    public static List<TreeNode> initTreeIndicatorTemplate(HttpSession session) {
-        // 查询用户指标模板
-        String username = (String) session.getAttribute("username");
-        String sql = "select id, template_name from pm_parse.indicator_template where username = ?";
-        PreparedStatement psmt = null;
-        TreeNode allTree = new TreeNode("指标模板选择", "指标模板选择", true, new ArrayList<>());
-        try {
-            psmt = conn.prepareStatement(sql);
-            psmt.setQueryTimeout(60 * 10);
-            psmt.setObject(1, username);
-            ResultSet rs = psmt.executeQuery();
-            while (rs.next()) {
-                String id = rs.getString("id");
-                String templateName = rs.getString("template_name");
-                TreeNode t = new TreeNode(templateName, id, new ArrayList<>());
-                allTree.getChildren().add(t);
-                // 查询模板下的指标
-                sql = "select x.indicator_cn, x.indicator_en from pm_parse.per_cfg_indicator x where x.indicator_id " +
-                        "in (select indicator_id from pm_parse.indicator_template_item where template_id = ?)";
-                psmt = conn.prepareStatement(sql);
-                psmt.setQueryTimeout(60 * 10);
-                psmt.setObject(1, Long.valueOf(id));
-                ResultSet r = psmt.executeQuery();
-                while (r.next()) {
-                    String indicatorCn = r.getString("indicator_cn");
-                    String indicatorEn = r.getString("indicator_en");
-                    t.getChildren().add(new TreeNode(indicatorCn, indicatorEn));
-                }
-            }
-        } catch (SQLException e) {
-            e.printStackTrace();
-        }
-        List<TreeNode> res = new ArrayList<>();
-        res.add(allTree);
-        log.debug("initTreeIndicatorTemplate: {}", res);
-        return res;
-    }
-
-    public static Object deleteTemplate(String ids) {
-        log.debug("ids: {}", ids);
-        String sql = "delete from pm_parse.indicator_template where id in (" + ids + ")";
-        PreparedStatement psmt;
-        try {
-            conn.setAutoCommit(false);
-            psmt = conn.prepareStatement(sql);
-            int rs = psmt.executeUpdate();
-            if (rs < 1) {
-                conn.rollback();
-                return "删除失败";
-            }
-
-            sql = "delete from pm_parse.indicator_template_item where template_id in (" + ids + ")";
-            psmt = conn.prepareStatement(sql);
-            rs = psmt.executeUpdate();
-            if (rs < 1) {
-                conn.rollback();
-                return "删除失败";
-            }
-
-            conn.commit();
-        } catch (SQLException e) {
-            e.printStackTrace();
-            try {
-                conn.rollback();
-            } catch (SQLException ex) {
-                e.printStackTrace();
-                return "删除失败";
-            }
-            return "删除失败";
-        }
-
-        return null;
-    }
-
-    // public static List<String> initCitys(String type, String province) {
-    // PreparedStatement psmt = null;
-    // if (type == null) {
-    // type = "roaming";
-    // }
-    //
-    // String sql = "select distinct roaming_city_name as city from
-    // sqmdb_5g.user_terminal_status_5g_abstract where roaming_province_name=? and
-    // roaming_city_name!='null' order by roaming_city_name";
-    //// Map<String,List<String>>res = new HashMap<>();
-    // List<String> res = new ArrayList<>();
-    // if ("roaming".equals(type)) {
-    // sql = "select distinct roaming_city_name as city from
-    // sqmdb_5g.user_terminal_status_5g_abstract where roaming_province_name=? and
-    // roaming_city_name!='null' order by roaming_city_name";
-    //// sql = "select distinct city from sqmdb_5g.roaming_area where province = ?
-    // order by city";
-    //
-    // } else {
-    // sql = "select distinct city_name as city from
-    // sqmdb_5g.user_terminal_status_5g_abstract where province_name=? and
-    // roaming_city_name!='null' order by city_name";
-    //// sql = "select distinct city from sqmdb_5g.local_area where province = ?
-    // order by city";
-    // }
-    // try {
-    // psmt = conn.prepareStatement(sql);
-    // psmt.setQueryTimeout(60 * 10);
-    // psmt.setString(1, province);
-    //
-    // ResultSet rs = psmt.executeQuery();
-    // while (rs.next()) {
-    // String city = rs.getString("city");
-    // res.add(city);
-    //// if(res.keySet().contains(province)){
-    //// List<String> ls = res.get(province);
-    //// ls.add(city);
-    //// }else {
-    //// List<String>as = new ArrayList<>();
-    //// as.add(city);
-    //// res.put(province,as);
-    //// }
-    // }
-    // } catch (SQLException e) {
-    // e.printStackTrace();
-    // }
-    // return res;
-    // }
-
-    // public static List<String> initProvince(String type) {
-    // PreparedStatement psmt = null;
-    // if (type == null) {
-    // type = "roaming";
-    // }
-    // String sql = "";
-    //// String sql = "select distinct roaming_province_name as province from
-    // sqmdb_5g.user_terminal_status_5g_abstract order by roaming_province_name";
-    ////// Map<String,List<String>>res = new HashMap<>();
-    // List<String> res = new ArrayList<>();
-    // if ("roaming".equals(type)) {
-    // sql = "select distinct roaming_province_name as province from
-    // sqmdb_5g.user_terminal_status_5g_abstract order by roaming_province_name";
-    //// sql = "select distinct province from sqmdb_5g.roaming_area order by
-    // province";
-    //
-    // } else {
-    // sql = "select distinct province_name as province from
-    // sqmdb_5g.user_terminal_status_5g_abstract order by province_name";
-    //// sql = "select distinct province from sqmdb_5g.local_area order by
-    // province";
-    // }
-    // try {
-    // psmt = conn.prepareStatement(sql);
-    // psmt.setQueryTimeout(60 * 10);
-    //
-    // ResultSet rs = psmt.executeQuery();
-    // while (rs.next()) {
-    // String province = rs.getString("province");
-    // res.add(province);
-    //// if(res.keySet().contains(province)){
-    //// List<String> ls = res.get(province);
-    //// ls.add(city);
-    //// }else {
-    //// List<String>as = new ArrayList<>();
-    //// as.add(city);
-    //// res.put(province,as);
-    //// }
-    // }
-    // } catch (SQLException e) {
-    // e.printStackTrace();
-    // }
-    // return res;
-    // }
-
-}
+package com.nokia.hb.utils;
+
+import com.nokia.hb.Pojo.Col;
+import com.nokia.hb.Pojo.RetData;
+import com.nokia.hb.Pojo.TreeNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpSession;
+import java.sql.*;
+import java.util.*;
+
+@SuppressWarnings("unchecked")
+public class DbUtil {
+    private static final Logger log = LoggerFactory.getLogger(DbUtil.class);
+    private static Connection conn = null;
+
+    // private final static String url =
+    // "jdbc:postgresql://127.0.0.1:5432/postgres";
+    // private final static String user = "postgres";
+    // private final static String password = "ava1234";
+
+    private final static String url = "jdbc:postgresql://10.100.68.195:5432/sqmmt";
+    private final static String user = "pmparse";
+    private final static String password = "abc123!";
+
+    static {
+        try {
+            conn = DriverManager.getConnection(url, user, password);
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static Map<String, String> initZnEnMap() {
+        String sql = "select distinct indicator_en,indicator_cn from pm_parse.per_cfg_indicator;";
+        Map<String, String> m = new HashMap<>();
+        m.put("cellname", "小区中文名");
+        m.put("city", "地市");
+        m.put("quxian", "区县");
+        m.put("vendor", "厂家");
+        try {
+            PreparedStatement psmt = null;
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(600);
+            ResultSet rs = psmt.executeQuery();
+            while (rs.next()) {
+                m.put(rs.getString("indicator_en"), rs.getString("indicator_cn"));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return m;
+    }
+
+    public static RetData conditionRenderTable(String condition, String searchType, String indicators, String ttype,
+            String sdate) {
+        Map<String, String> ezMap = initZnEnMap();
+        String[] timeArray = sdate.split(" - ");
+        String startTime = timeArray[0];
+        String endTime = timeArray[1];
+        String sql = "select a.cellname,a.city,a.quxian,a.vendor,b.* from \n(select eci,cellname,city,quxian,vendor from pm_parse.per_cfg_cell where "
+                + searchType + " in (" + condition + ")) a\ninner join \n(select " + indicators
+                + " from pm_parse.pm_4g_" + ttype + " where sdate>='" + startTime + "' and sdate <= '" + endTime
+                + "') b\n" + "on a.eci=b.eci";
+        // 全网
+        if ("all".equals(searchType)) {
+            sql = "select a.cellname,a.city,a.quxian,a.vendor,b.* from pm_parse.per_cfg_cell a\ninner join \n(select "
+                    + indicators + " from pm_parse.pm_4g_" + ttype + " where sdate>='" + startTime + "' and sdate <= '"
+                    + endTime + "') b\n" + "on a.eci=b.eci";
+        }
+
+        List<Map<String, String>> datas = new ArrayList<>();
+        List<Col> cols = new ArrayList<>();
+        try {
+            PreparedStatement psmt = null;
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(600);
+            ResultSet rs = psmt.executeQuery();
+            ResultSetMetaData rsmd = rs.getMetaData();
+            List<String> heads = new ArrayList<>();
+            String columnName;
+            for (int i = 1; i <= rsmd.getColumnCount(); i++) {
+                columnName = rsmd.getColumnName(i);
+                heads.add(columnName);
+                cols.add(new Col(columnName, (String) ezMap.get(columnName)));
+            }
+            while (rs.next()) {
+                Map<String, String> m = new HashMap<>();
+                for (String head : heads) {
+                    String string = rs.getString(head);
+                    m.put(head, string);
+                }
+                datas.add(m);
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return new RetData(cols, datas);
+    }
+
+    public static RetData renderTable(String citys, String quxians, String indicators, String ttype, String sdate,
+            HttpSession session) {
+        log.debug("indicators: {}", indicators);
+        log.debug("citys: {}", citys);
+        log.debug("quxians: {}", quxians);
+        log.debug("ttype: {}", ttype);
+        log.debug("sdate: {}", sdate);
+        // 获取城市数组
+        String[] cityArray = StringUtils.delete(citys, "'").split(",");
+        // 获取拥有的城市权限
+        Map<String, String> areas = (Map<String, String>) session.getAttribute("areas");
+        log.debug("{} areas: {}", areas.keySet().size(), areas.keySet());
+        log.debug("{} cityArray: {}", cityArray.length, Arrays.toString(cityArray));
+        // 地区权限校验
+        for (String t : cityArray) {
+            if (!areas.containsKey(t)) {
+                log.debug("没有权限的city: {}", t);
+                return new RetData(null, null, "没有" + t + "的权限");
+            }
+        }
+
+        String[] timeArray = sdate.split(" - ");
+        String startTime = timeArray[0];
+        String endTime = timeArray[1];
+
+        String sql = "select b.* from \n" +
+                "(select eci from pm_parse.per_cfg_cell where quxian in (" + quxians + ")) a\n" +
+                "inner join \n" +
+                "(select eci," + indicators + " from pm_parse.pm_4g_" + ttype +
+                " where sdate>='" + startTime +
+                "' and sdate <= '" + endTime + "') b\n" +
+                "on a.eci=b.eci";
+
+        if (indicators.contains("eci")) {
+            sql = "select b.* from \n" +
+                    "(select eci from pm_parse.per_cfg_cell where quxian in (" + quxians + ")) a\n" +
+                    "inner join \n" +
+                    "(select " + indicators + " from pm_parse.pm_4g_" + ttype +
+                    " where sdate>='" + startTime +
+                    "' and sdate <= '" + endTime + "') b\n" +
+                    "on a.eci=b.eci";
+        }
+        List<Map<String, String>> datas = new ArrayList<>();
+        List<Col> cols = new ArrayList<>();
+        try {
+            PreparedStatement psmt = null;
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(60 * 10);
+            ResultSet rs = psmt.executeQuery();
+            ResultSetMetaData rsmd = rs.getMetaData();
+            List<String> heads = new ArrayList<>();
+
+            for (int i = 1; i <= rsmd.getColumnCount(); i++) {
+                String columnName = rsmd.getColumnName(i);
+                heads.add(columnName);
+                cols.add(new Col(columnName, columnName));
+            }
+            while (rs.next()) {
+                Map<String, String> m = new HashMap<>();
+                for (String head : heads) {
+                    String string = rs.getString(head);
+                    m.put(head, string);
+                }
+                datas.add(m);
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return new RetData(cols, datas);
+    }
+
+    public static List<TreeNode> initTreeCitys() {
+        String sql = "select distinct * from pm_parse.per_cfg_area order by city,quxian";
+        PreparedStatement psmt = null;
+        TreeNode allTree = new TreeNode("地市选择", "地市选择", new ArrayList<>());
+        // int i = 0;
+        try {
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(60 * 10);
+            ResultSet rs = psmt.executeQuery();
+            Map<String, List<TreeNode>> m = new HashMap<>();
+
+            while (rs.next()) {
+                String city = rs.getString("city");
+                String quxian = rs.getString("quxian");
+                String id = city + quxian;
+                TreeNode t = new TreeNode(quxian, id, null);
+                if (m.keySet().contains(city)) {
+                    m.get(city).add(t);
+                } else {
+                    List<TreeNode> l = new ArrayList<>();
+                    l.add(t);
+                    m.put(city, l);
+                }
+
+            }
+
+            for (String s : m.keySet()) {
+                allTree.getChildren().add(new TreeNode(s, s, m.get(s)));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        List<TreeNode> res = new ArrayList<>();
+        allTree.setSpread(true);
+        res.add(allTree);
+        log.debug("initTreeCitys: {}", res);
+        return res;
+    }
+
+    public static List<TreeNode> initTreeIndicator() {
+        // String sql = "select distinct * from pm_parse.per_cfg_indicator order by
+        // indicator_type,indicator_cn,indicator_en";
+        String sql = "select distinct * from pm_parse.per_cfg_indicator order by indicator_id,indicator_type,indicator_cn,indicator_en";
+        PreparedStatement psmt = null;
+        TreeNode allTree = new TreeNode("指标选择", "指标选择", new ArrayList<>());
+        try {
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(60 * 10);
+            ResultSet rs = psmt.executeQuery();
+            Map<String, List<TreeNode>> m = new HashMap<>();
+
+            while (rs.next()) {
+                String indicator_type = rs.getString("indicator_type");
+                String indicator_cn = rs.getString("indicator_cn");
+                String indicator_id = rs.getString("indicator_id");
+                TreeNode t = new TreeNode(indicator_cn, indicator_id, null);
+                if (m.keySet().contains(indicator_type)) {
+                    m.get(indicator_type).add(t);
+                } else {
+                    List<TreeNode> l = new ArrayList<>();
+                    l.add(t);
+                    m.put(indicator_type, l);
+                }
+
+            }
+            // int i = 0;
+            for (String s : m.keySet()) {
+                allTree.getChildren().add(new TreeNode(s, s, m.get(s)));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        List<TreeNode> res = new ArrayList<>();
+        allTree.setSpread(true);
+        res.add(allTree);
+        log.debug("initTreeIndicator: {}", res);
+        return res;
+    }
+
+    // public static Map<String, List<Object>> searchRate(String from, String t1,
+    // String t2, String ttype, String provinces, String citys) {
+    //
+    //
+    // HashMap<String, List<Object>> res = new HashMap<>();
+    // PreparedStatement psmt = null;
+    // String pn = "province_name";
+    // String cn = "city_name";
+    // if ("roaming".equals(from)) {
+    // pn = "roaming_province_name";
+    // cn = "roaming_city_name";
+    // }
+    // String sql = "select a.sdate as dt,round(a.openusers/b.users,4) as num from
+    // \n" +
+    // "(select sdate,sum(user_count) as openusers from
+    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
+    // stype='打开5G开关用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
+    // provinces + ") and " + cn + " in (" + citys + ") group by sdate ) a\n" +
+    // "inner join\n" +
+    // "(select sdate,sum(user_count) as users from
+    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
+    // stype='5G终端用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
+    // provinces + ") and " + cn + " in (" + citys + ") group by sdate) b\n" +
+    // "on a.sdate=b.sdate\n" +
+    // "order by a.sdate";
+    // if ("".equals(citys)) {
+    // sql = "select a.sdate as dt,round(a.openusers/b.users,4) as num from \n" +
+    // "(select sdate,sum(user_count) as openusers from
+    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
+    // stype='打开5G开关用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
+    // provinces + ") group by sdate ) a\n" +
+    // "inner join\n" +
+    // "(select sdate,sum(user_count) as users from
+    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
+    // stype='5G终端用户数' and size_type='" + ttype + "天' and " + pn + " in (" +
+    // provinces + ") group by sdate) b\n" +
+    // "on a.sdate=b.sdate\n" +
+    // "order by a.sdate";
+    // }
+    //
+    // List<Object> dtList = new ArrayList<>();
+    // List<Object> numList = new ArrayList<>();
+    // try {
+    // psmt = conn.prepareStatement(sql);
+    //
+    // psmt.setQueryTimeout(60 * 10);
+    // psmt.setLong(1, Integer.valueOf(t1));
+    // psmt.setLong(2, Integer.valueOf(t2));
+    // psmt.setLong(3, Integer.valueOf(t1));
+    // psmt.setLong(4, Integer.valueOf(t2));
+    //
+    //// psmt.setString(5,provinces);
+    //// psmt.setString(6,citys);
+    // ResultSet rs = psmt.executeQuery();
+    // while (rs.next()) {
+    // String dt = rs.getString("dt");
+    // Long num = rs.getLong("num");
+    // dtList.add(dt);
+    // numList.add(num);
+    // }
+    // res.put("dt", dtList);
+    // res.put("num", numList);
+    // } catch (SQLException e) {
+    // e.printStackTrace();
+    // }
+    // return res;
+    // }
+
+    // public static HashMap<String, List<Object>> search(String from, String t1,
+    // String t2, String stype, String ttype, String provinces, String citys) {
+    // HashMap<String, List<Object>> res = new HashMap<>();
+    // PreparedStatement psmt = null;
+    // String pn = "province_name";
+    // String cn = "city_name";
+    // if ("roaming".equals(from)) {
+    // pn = "roaming_province_name";
+    // cn = "roaming_city_name";
+    // }
+    //// String sql = "select sdate,sum(user_count) from
+    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between '20210720' and
+    // '20210727' and stype='5G终端用户数' and size_type='7天' and province_name in ('河北')
+    // and city_name in ('石家庄','唐山') group by sdate;";
+    // String sql = "select sdate as dt ,sum(user_count) as num from
+    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
+    // stype=? and size_type=? and " + pn + " in (" + provinces + ") and " + cn + "
+    // in (" + citys + ") group by sdate order by sdate;";
+    // if ("".equals(citys)) {
+    // sql = "select sdate as dt ,sum(user_count) as num from
+    // sqmdb_5g.user_terminal_status_5g_abstract where sdate between ? and ? and
+    // stype=? and size_type=? and " + pn + " in (" + provinces + ") group by sdate
+    // order by sdate;";
+    // }
+    //
+    // List<Object> dtList = new ArrayList<>();
+    // List<Object> numList = new ArrayList<>();
+    // try {
+    // psmt = conn.prepareStatement(sql);
+    //
+    // psmt.setQueryTimeout(60 * 10);
+    // psmt.setLong(1, Integer.valueOf(t1));
+    // psmt.setLong(2, Integer.valueOf(t2));
+    // psmt.setString(3, stype);
+    // psmt.setString(4, ttype + "天");
+    //// psmt.setString(5,provinces);
+    //// psmt.setString(6,citys);
+    // ResultSet rs = psmt.executeQuery();
+    // while (rs.next()) {
+    // String dt = rs.getString("dt");
+    // Long num = rs.getLong("num");
+    // dtList.add(dt);
+    // numList.add(num);
+    // }
+    // res.put("dt", dtList);
+    // res.put("num", numList);
+    // } catch (SQLException e) {
+    // e.printStackTrace();
+    // }
+    // return res;
+    // }
+
+    // public static String typeExport(String from, String provinces, String citys,
+    // String ttype, String t1, String t2) {
+    // String res = "";
+    // String pn = "province_name";
+    // String cn = "city_name";
+    // String guishu = "归属地";
+    // String area = citys;
+    // if ("roaming".equals(from)) {
+    // pn = "roaming_province_name";
+    // cn = "roaming_city_name";
+    // guishu = "拜访地";
+    // }
+    // String sql = "with tab as (\n" +
+    // "select distinct\n" +
+    // "stype,\n" +
+    // "'" + guishu + "' as 维度, \n" +
+    // "size_type as 粒度,\n" +
+    // "'" + area + "' as 区域, \n" +
+    // "sdate as 日期,\n" +
+    // "sum(user_count) over(partition by stype,sdate,size_type) as user_count\n" +
+    // "from sqmdb_5g.user_terminal_status_5g_abstract\n" +
+    // "where sdate between ? and ? \n" +
+    // "and " + pn + " in ('" + provinces + "') and " + cn + " in ('" + citys + "')
+    // \n" +
+    // "and size_type = '" + ttype + "天'\n" +
+    // ") \n" +
+    // "\n" +
+    // "select \n" +
+    // "a.维度,\n" +
+    // "a.粒度,\n" +
+    // "a.区域,\n" +
+    // "a.日期,\n" +
+    // "sum(a.user_count) as 终端用户数,\n" +
+    // "sum(b.user_count) as 打开5G开关用户数,\n" +
+    // "sum(c.user_count) as 关闭5G开关用户数,\n" +
+    // "round(sum(b.user_count)/sum(a.user_count),4) as 开关打开率\n" +
+    // "from tab a\n" +
+    // "join tab b on b.日期=a.日期 and b.stype = '打开5G开关用户数'\n" +
+    // "join tab c on c.日期=a.日期 and c.stype = '关闭5G开关用户数'\n" +
+    // "where a.stype = '5G终端用户数'\n" +
+    // "group by \n" +
+    // "a.维度,\n" +
+    // "a.粒度,\n" +
+    // "a.区域,\n" +
+    // "a.日期\n" +
+    // "order by 日期";
+    //
+    // if ("".equals(citys)) {
+    // area = provinces;
+    // sql = "with tab as (\n" +
+    // "select distinct\n" +
+    // "stype,\n" +
+    // "'" + guishu + "' as 维度, \n" +
+    // "size_type as 粒度,\n" +
+    // "'" + area + "' as 区域, \n" +
+    // "sdate as 日期,\n" +
+    // "sum(user_count) over(partition by stype,sdate,size_type) as user_count\n" +
+    // "from sqmdb_5g.user_terminal_status_5g_abstract\n" +
+    // "where sdate between ? and ? \n" +
+    // "and " + pn + " in ('" + provinces + "') \n" +
+    // "and size_type = '" + ttype + "天'\n" +
+    // ") \n" +
+    // "\n" +
+    // "select \n" +
+    // "a.维度,\n" +
+    // "a.粒度,\n" +
+    // "a.区域,\n" +
+    // "a.日期,\n" +
+    // "sum(a.user_count) as 终端用户数,\n" +
+    // "sum(b.user_count) as 打开5G开关用户数,\n" +
+    // "sum(c.user_count) as 关闭5G开关用户数,\n" +
+    // "round(sum(b.user_count)/sum(a.user_count),4) as 开关打开率\n" +
+    // "from tab a\n" +
+    // "join tab b on b.日期=a.日期 and b.stype = '打开5G开关用户数'\n" +
+    // "join tab c on c.日期=a.日期 and c.stype = '关闭5G开关用户数'\n" +
+    // "where a.stype = '5G终端用户数'\n" +
+    // "group by \n" +
+    // "a.维度,\n" +
+    // "a.粒度,\n" +
+    // "a.区域,\n" +
+    // "a.日期\n" +
+    // "order by 日期";
+    // }
+    //
+    //
+    // PreparedStatement psmt = null;
+    //
+    //
+    // try {
+    // psmt = conn.prepareStatement(sql);
+    // psmt.setQueryTimeout(60 * 10);
+    //
+    // psmt.setLong(1, Integer.valueOf(t1));
+    // psmt.setLong(2, Integer.valueOf(t2));
+    // ResultSet rs = psmt.executeQuery();
+    // res = rsprocess(rs);
+    // } catch (SQLException e) {
+    // e.printStackTrace();
+    // }
+    // return res;
+    // }
+
+    // public static String exportAll(String ttype, String sts, String ets, String
+    // smts, String emts) {
+    // String res = "";
+    // String range = smts + "-" + ets;
+    // PreparedStatement psmt = null;
+    // String sql = "select '" + ttype + "天' as \"粒度\",\n" +
+    // "'" + range + "' as \"开始(结束)时间\",\n" +
+    // "msisdn as \"号码\",\n" +
+    // "province_name as \"归属省\",\n" +
+    // "city_name as \"归属地市\",\n" +
+    // "roaming_province_name as \"拜访省\",\n" +
+    // "roaming_city_name as \"拜访地市\",\n" +
+    // "tml_brand as \"终端品牌\",\n" +
+    // "tml_name as \"终端型号\",\n" +
+    // "case when last_open_date >= ? then 1 else 0 end as \"开关是否打开\" \n" +
+    // "from sqmdb_5g.user_terminal_status_5g_agg\n" +
+    // "where sdate=? \n" +
+    // "and last_chg_date >= ? ";
+    //
+    // try {
+    // psmt = conn.prepareStatement(sql);
+    // psmt.setQueryTimeout(60 * 10);
+    //
+    // psmt.setLong(1, Integer.valueOf(emts));
+    // psmt.setLong(2, Integer.valueOf(ets));
+    // psmt.setLong(3, Integer.valueOf(emts));
+    //
+    // ResultSet rs = psmt.executeQuery();
+    // res = rsprocess(rs);
+    // } catch (SQLException e) {
+    // e.printStackTrace();
+    // }
+    // return res;
+    // }
+
+    // public static String exportClose(String ttype, String sts, String ets, String
+    // smts, String emts) {
+    // String res = "";
+    // String range = smts + "-" + ets;
+    // PreparedStatement psmt = null;
+    // String sql = "select '" + ttype + "天' as \"粒度\",\n" +
+    // "'" + range + "' as \"开始(结束)时间\",\n" +
+    // "msisdn as \"号码\",\n" +
+    // "province_name as \"归属省\",\n" +
+    // "city_name as \"归属地市\",\n" +
+    // "roaming_province_name as \"拜访省\",\n" +
+    // "roaming_city_name as \"拜访地市\",\n" +
+    // "tml_brand as \"终端品牌\",\n" +
+    // "tml_name as \"终端型号\",\n" +
+    // "0 as \"开关是否打开\"\n" +
+    // "from sqmdb_5g.user_terminal_status_5g_agg\n" +
+    // "where sdate=? \n" +
+    // "and last_chg_date >= ? \n" +
+    // "and (last_open_date < ? or last_open_date is null) ";
+    //
+    // try {
+    // psmt = conn.prepareStatement(sql);
+    // psmt.setQueryTimeout(60 * 10);
+    //
+    // psmt.setLong(1, Integer.valueOf(ets));
+    // psmt.setLong(2, Integer.valueOf(emts));
+    // psmt.setLong(3, Integer.valueOf(emts));
+    //
+    // ResultSet rs = psmt.executeQuery();
+    // res = rsprocess(rs);
+    // } catch (SQLException e) {
+    // e.printStackTrace();
+    // }
+    // return res;
+    // }
+
+    // public static String rsprocess(ResultSet rs) {
+    // List<String> heads = new ArrayList<>();
+    // String headStr = "";
+    // StringBuffer sb = new StringBuffer();
+    // try {
+    // ResultSetMetaData rsmd = rs.getMetaData();
+    // for (int i = 1; i <= rsmd.getColumnCount(); i++) {
+    // String columnName = rsmd.getColumnName(i);
+    // heads.add(columnName);
+    // headStr += columnName + ",";
+    //
+    // }
+    //
+    // headStr = headStr.substring(0, headStr.length() - 1);
+    // sb.append(headStr + "\n");
+    // while (rs.next()) {
+    // String line = "";
+    // for (String head : heads) {
+    // line += rs.getString(head) + ",";
+    //
+    // }
+    // line = line.substring(0, line.length() - 1);
+    // sb.append(line + "\n");
+    // }
+    //
+    // } catch (SQLException throwables) {
+    // throwables.printStackTrace();
+    // }
+    // return sb.toString();
+    // }
+
+    public static Object userLogin(String username, String password, HttpSession session) {
+        log.debug("username: {}, password: {}", username, password);
+        // 查询用户信息
+        String sql = "select * from pm_parse.user where username='" + username + "'";
+        PreparedStatement psmt;
+        try {
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(60 * 10);
+            ResultSet rs = psmt.executeQuery();
+            // 没有查到数据
+            if (!rs.next()) {
+                return "用户名或密码错误!";
+            }
+
+            String passwordStore = rs.getString("password");
+            log.debug("passwordStore: {}", passwordStore);
+            // 密码错误
+            if (!password.equals(passwordStore)) {
+                return "用户名或密码错误!";
+            }
+
+            // 查询地区权限
+            sql = "select area from pm_parse.user_area where username='" + username + "'";
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(60 * 10);
+            rs = psmt.executeQuery();
+            Map<String, String> map = new HashMap<>();
+            while (rs.next()) {
+                String area = rs.getString("area");
+                map.put(area, "");
+            }
+
+            log.debug("areas: {}", map.keySet());
+            // 保存session
+            session.setMaxInactiveInterval(30 * 60);
+            session.setAttribute("username", username);
+            session.setAttribute("areas", map);
+            return null;
+        } catch (SQLException e) {
+            e.printStackTrace();
+            return "数据库异常!";
+        }
+    }
+
+    public static Object addTemplate(String templateName, String indicators, HttpSession session) {
+        log.debug("templateName: {}", templateName);
+        log.debug("indicators: {}", indicators);
+        String username = (String) session.getAttribute("username");
+        long id = System.currentTimeMillis();
+        String sql = "insert into pm_parse.indicator_template (id, template_name, username) values (?, ?, ?)";
+        PreparedStatement psmt;
+        try {
+            conn.setAutoCommit(false);
+            psmt = conn.prepareStatement(sql);
+            psmt.setObject(1, id);
+            psmt.setObject(2, templateName);
+            psmt.setObject(3, username);
+            int rs = psmt.executeUpdate();
+            if (rs < 1) {
+                conn.rollback();
+                return "添加失败";
+            }
+
+            String[] indicatorArray = StringUtils.delete(indicators, "'").split(",");
+            sql = "insert into pm_parse.indicator_template_item (template_id, indicator_id) values (?, ?)";
+            psmt = conn.prepareStatement(sql);
+            for (String s : indicatorArray) {
+                psmt.setObject(1, id);
+                psmt.setObject(2, Integer.valueOf(s));
+                rs = psmt.executeUpdate();
+                if (rs < 1) {
+                    conn.rollback();
+                    return "添加失败";
+                }
+            }
+
+            conn.commit();
+        } catch (SQLException e) {
+            e.printStackTrace();
+            try {
+                conn.rollback();
+            } catch (SQLException ex) {
+                e.printStackTrace();
+                return "添加失败";
+            }
+            return "添加失败";
+        }
+
+        return null;
+    }
+
+    public static List<TreeNode> initTreeIndicatorTemplate(HttpSession session) {
+        // 查询用户指标模板
+        String username = (String) session.getAttribute("username");
+        String sql = "select id, template_name from pm_parse.indicator_template where username = ?";
+        PreparedStatement psmt = null;
+        TreeNode allTree = new TreeNode("指标模板选择", "指标模板选择", true, new ArrayList<>());
+        try {
+            psmt = conn.prepareStatement(sql);
+            psmt.setQueryTimeout(60 * 10);
+            psmt.setObject(1, username);
+            ResultSet rs = psmt.executeQuery();
+            while (rs.next()) {
+                String id = rs.getString("id");
+                String templateName = rs.getString("template_name");
+                TreeNode t = new TreeNode(templateName, id, new ArrayList<>());
+                allTree.getChildren().add(t);
+                // 查询模板下的指标
+                sql = "select x.indicator_cn, x.indicator_en from pm_parse.per_cfg_indicator x where x.indicator_id " +
+                        "in (select indicator_id from pm_parse.indicator_template_item where template_id = ?)";
+                psmt = conn.prepareStatement(sql);
+                psmt.setQueryTimeout(60 * 10);
+                psmt.setObject(1, Long.valueOf(id));
+                ResultSet r = psmt.executeQuery();
+                while (r.next()) {
+                    String indicatorCn = r.getString("indicator_cn");
+                    String indicatorEn = r.getString("indicator_en");
+                    t.getChildren().add(new TreeNode(indicatorCn, indicatorEn));
+                }
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        List<TreeNode> res = new ArrayList<>();
+        res.add(allTree);
+        log.debug("initTreeIndicatorTemplate: {}", res);
+        return res;
+    }
+
+    public static Object deleteTemplate(String ids) {
+        log.debug("ids: {}", ids);
+        String sql = "delete from pm_parse.indicator_template where id in (" + ids + ")";
+        PreparedStatement psmt;
+        try {
+            conn.setAutoCommit(false);
+            psmt = conn.prepareStatement(sql);
+            int rs = psmt.executeUpdate();
+            if (rs < 1) {
+                conn.rollback();
+                return "删除失败";
+            }
+
+            sql = "delete from pm_parse.indicator_template_item where template_id in (" + ids + ")";
+            psmt = conn.prepareStatement(sql);
+            rs = psmt.executeUpdate();
+            if (rs < 1) {
+                conn.rollback();
+                return "删除失败";
+            }
+
+            conn.commit();
+        } catch (SQLException e) {
+            e.printStackTrace();
+            try {
+                conn.rollback();
+            } catch (SQLException ex) {
+                e.printStackTrace();
+                return "删除失败";
+            }
+            return "删除失败";
+        }
+
+        return null;
+    }
+
+    // public static List<String> initCitys(String type, String province) {
+    // PreparedStatement psmt = null;
+    // if (type == null) {
+    // type = "roaming";
+    // }
+    //
+    // String sql = "select distinct roaming_city_name as city from
+    // sqmdb_5g.user_terminal_status_5g_abstract where roaming_province_name=? and
+    // roaming_city_name!='null' order by roaming_city_name";
+    //// Map<String,List<String>>res = new HashMap<>();
+    // List<String> res = new ArrayList<>();
+    // if ("roaming".equals(type)) {
+    // sql = "select distinct roaming_city_name as city from
+    // sqmdb_5g.user_terminal_status_5g_abstract where roaming_province_name=? and
+    // roaming_city_name!='null' order by roaming_city_name";
+    //// sql = "select distinct city from sqmdb_5g.roaming_area where province = ?
+    // order by city";
+    //
+    // } else {
+    // sql = "select distinct city_name as city from
+    // sqmdb_5g.user_terminal_status_5g_abstract where province_name=? and
+    // roaming_city_name!='null' order by city_name";
+    //// sql = "select distinct city from sqmdb_5g.local_area where province = ?
+    // order by city";
+    // }
+    // try {
+    // psmt = conn.prepareStatement(sql);
+    // psmt.setQueryTimeout(60 * 10);
+    // psmt.setString(1, province);
+    //
+    // ResultSet rs = psmt.executeQuery();
+    // while (rs.next()) {
+    // String city = rs.getString("city");
+    // res.add(city);
+    //// if(res.keySet().contains(province)){
+    //// List<String> ls = res.get(province);
+    //// ls.add(city);
+    //// }else {
+    //// List<String>as = new ArrayList<>();
+    //// as.add(city);
+    //// res.put(province,as);
+    //// }
+    // }
+    // } catch (SQLException e) {
+    // e.printStackTrace();
+    // }
+    // return res;
+    // }
+
+    // public static List<String> initProvince(String type) {
+    // PreparedStatement psmt = null;
+    // if (type == null) {
+    // type = "roaming";
+    // }
+    // String sql = "";
+    //// String sql = "select distinct roaming_province_name as province from
+    // sqmdb_5g.user_terminal_status_5g_abstract order by roaming_province_name";
+    ////// Map<String,List<String>>res = new HashMap<>();
+    // List<String> res = new ArrayList<>();
+    // if ("roaming".equals(type)) {
+    // sql = "select distinct roaming_province_name as province from
+    // sqmdb_5g.user_terminal_status_5g_abstract order by roaming_province_name";
+    //// sql = "select distinct province from sqmdb_5g.roaming_area order by
+    // province";
+    //
+    // } else {
+    // sql = "select distinct province_name as province from
+    // sqmdb_5g.user_terminal_status_5g_abstract order by province_name";
+    //// sql = "select distinct province from sqmdb_5g.local_area order by
+    // province";
+    // }
+    // try {
+    // psmt = conn.prepareStatement(sql);
+    // psmt.setQueryTimeout(60 * 10);
+    //
+    // ResultSet rs = psmt.executeQuery();
+    // while (rs.next()) {
+    // String province = rs.getString("province");
+    // res.add(province);
+    //// if(res.keySet().contains(province)){
+    //// List<String> ls = res.get(province);
+    //// ls.add(city);
+    //// }else {
+    //// List<String>as = new ArrayList<>();
+    //// as.add(city);
+    //// res.put(province,as);
+    //// }
+    // }
+    // } catch (SQLException e) {
+    // e.printStackTrace();
+    // }
+    // return res;
+    // }
+
+}

+ 50 - 50
src/main/resources/static/js/echarts.js

@@ -24,56 +24,56 @@
     (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.echarts = {}));
 }(this, (function (exports) { 'use strict';
 
-    /*! *****************************************************************************
-    Copyright (c) Microsoft Corporation.
-
-    Permission to use, copy, modify, and/or distribute this software for any
-    purpose with or without fee is hereby granted.
-
-    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-    PERFORMANCE OF THIS SOFTWARE.
-    ***************************************************************************** */
-    /* global Reflect, Promise */
-
-    var extendStatics = function(d, b) {
-        extendStatics = Object.setPrototypeOf ||
-            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
-        return extendStatics(d, b);
-    };
-
-    function __extends(d, b) {
-        if (typeof b !== "function" && b !== null)
-            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    }
-
-    var __assign = function() {
-        __assign = Object.assign || function __assign(t) {
-            for (var s, i = 1, n = arguments.length; i < n; i++) {
-                s = arguments[i];
-                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
-            }
-            return t;
-        };
-        return __assign.apply(this, arguments);
-    };
-
-    function __spreadArray(to, from, pack) {
-        if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
-            if (ar || !(i in from)) {
-                if (!ar) ar = Array.prototype.slice.call(from, 0, i);
-                ar[i] = from[i];
-            }
-        }
-        return to.concat(ar || from);
+    /*! *****************************************************************************
+    Copyright (c) Microsoft Corporation.
+
+    Permission to use, copy, modify, and/or distribute this software for any
+    purpose with or without fee is hereby granted.
+
+    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+    PERFORMANCE OF THIS SOFTWARE.
+    ***************************************************************************** */
+    /* global Reflect, Promise */
+
+    var extendStatics = function(d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+
+    function __extends(d, b) {
+        if (typeof b !== "function" && b !== null)
+            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    }
+
+    var __assign = function() {
+        __assign = Object.assign || function __assign(t) {
+            for (var s, i = 1, n = arguments.length; i < n; i++) {
+                s = arguments[i];
+                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+            }
+            return t;
+        };
+        return __assign.apply(this, arguments);
+    };
+
+    function __spreadArray(to, from, pack) {
+        if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
+            if (ar || !(i in from)) {
+                if (!ar) ar = Array.prototype.slice.call(from, 0, i);
+                ar[i] = from[i];
+            }
+        }
+        return to.concat(ar || from);
     }
 
     var Browser = (function () {

+ 11 - 11
src/main/resources/templates/error.html

@@ -1,12 +1,12 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Document</title>
-</head>
-<body>
-请联系管理员
-</body>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+请联系管理员
+</body>
 </html>

+ 581 - 581
src/main/resources/templates/template.html

@@ -1,582 +1,582 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="UTF-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Template</title>
-    <link rel="stylesheet" href="./js/layui/css/layui.css">
-    <style>
-        .all {
-            padding-top: 30px;
-            padding-left: 30px;
-            padding-right: 30px;
-
-        }
-
-        .c {
-            float: left;
-
-        }
-
-        .c1 {
-            margin: 10px;
-            float: left;
-
-
-        }
-
-        .t1 {
-            width: 15%;
-        }
-
-        .row {
-            height: 50px;
-        }
-
-        .t2 {
-            width: 10%;
-        }
-
-        .view {
-
-            width: 75%;
-        }
-
-        #timeType {
-            float: left;
-            width: 10%;
-        }
-
-        #time1 {
-            float: left;
-            width: 10%;
-        }
-
-        .btn {
-            float: left;
-            width: 10%;
-        }
-
-        .label {
-            height: 50px;
-            line-height: 32px;
-        }
-    </style>
-</head>
-
-<body>
-<div class="all">
-
-    <div class="c t1">
-        <button type="button" class="layui-btn layui-btn-sm" onclick="addTemplate()">添加指标模板</button>
-        <button type="button" class="layui-btn layui-btn-sm" onclick="deleteTemplate()">删除指标模板</button>
-        <div id="allArea"></div>
-        <div id="indicatorTemplate"></div>
-        <div id="add-template" style="display: none;">
-            <form class="layui-form" action="">
-                <div class="layui-form-item" style="margin-top: 20px">
-                    <label class="layui-form-label">模板名称</label>
-                    <div class="layui-input-block" style="width: 400px">
-                        <input id="templateName" type="text" name="templateName" required lay-verify="required"
-                               placeholder="请输入模板名称" autocomplete="off" class="layui-input">
-                    </div>
-                </div>
-            </form>
-            <div id="allIndicator"></div>
-        </div>
-    </div>
-    <div class="c t2">
-        <form class="layui-form" action="">
-            <div class="column" id="searchType">
-                <input type="radio" name="where" value="eci" title="按eci查询" lay-filter="where" checked>
-                <input type="radio" name="where" value="all" title="全网选择" lay-filter="where">
-            </div>
-            <textarea id="condition" cols="14" rows="19"
-                      style="border-width:1px;border-style: solid;border-color: #eee;"></textarea>
-        </form>
-    </div>
-    <div class="c view">
-        <div class="row layui-form">
-
-            <div class="c1 label"> 粒度:</div>
-
-            <div class="timeTypeDiv c1" style="width: 10%;">
-                <select name="timeType" id="timeType">
-                    <option value="quater">15分钟</option>
-                    <option value="hour">小时</option>
-                    <option value="day">天</option>
-                    <!--<option value="week">星期</option>-->
-                    <!--<option value="month">月</option>-->
-                </select>
-            </div>
-
-            <div class="c1 label" style="margin-left: 120px;">时间:</div>
-            <input type="text" class="layui-input c1" style="width: 300px;" id="time1">
-            <button class="layui-btn btn c1" style="margin-left: 20px;" onclick="search()">查询</button>
-            <button class="layui-btn btn c1" style="margin-left: 20px;" onclick="conditionSearch()">条件查询</button>
-        </div>
-        <div class="row">
-            <table id="demo" lay-filter="test" style="width: 200px;"></table>
-        </div>
-    </div>
-</div>
-<script src="./js/jquery-3.5.1.min.js"></script>
-<script src="./js/layui/layui.js"></script>
-<script>
-        var dataA;
-        var layer;
-        var tree;
-        var table;
-        layui.use(['layer', 'tree', 'form', 'laydate', 'table'], function () {
-            tree = layui.tree;
-            layer = layui.layer;
-            table = layui.table;
-            var form = layui.form,
-
-                laydate = layui.laydate;
-            // layer.msg('Hello Zhou')
-            table.render({
-                elem: '#demo',
-                height: 320,
-                // url: 'https://www.layui.com/demo/table/user/' , //数据接口
-                page: true, //开启分页
-                toolbar: true,
-                defaultToolbar: [{
-                    title: '导出' //标题
-                    ,
-                    layEvent: 'export' //事件名,用于 toolbar 事件中使用
-                    ,
-                    icon: 'layui-icon-export' //图标类名
-                }],
-                limit: 50,
-                limits: [50, 200, 500],
-                cols: [
-
-                ],
-                data: []
-            });
-
-            //工具条事件
-            table.on('toolbar(test)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
-                var data = obj.data; //获得当前行数据
-                var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
-                if (layEvent === 'export') {
-                    // layer.alert('Hi,头部工具栏扩展的右侧图标。');
-                    var tableData = table.cache['demo']
-                    obj.config.title = "地市指标"
-                    // console.log(JSON.stringify(dataA))
-                    table.exportFile(obj.config.id, dataA.datas, 'csv')
-                }
-            });
-            laydate.render({
-                elem: '#time1',
-                type: 'datetime',
-                range: true,
-            });
-
-            initTreeCity(tree)
-            initTreeIndicator(tree)
-            initTreeIndicatorTemplate(tree)
-        })
-
-        var treeCity;
-        function initTreeCity(tree) {
-            console.log('initTreeCity')
-            $.ajax({
-                type: "GET",
-                // url: './json/citys.json',
-                url: './initTreeCitys',
-                data: {
-                    "spread": false
-                },
-                success: function (r) {
-
-                    // console.log(r)
-                    let o = r instanceof Object
-                    if (!o) {
-                        r = JSON.parse(r)
-                    }
-
-                    treeCity = tree.render({
-                        elem: '#allArea',
-                        showCheckbox: true,
-                        accordion: true,
-                        id: 'Id1',
-                        data: r
-                    });
-
-
-                    return false;
-
-                }
-
-            });
-
-        }
-
-        var treeIn;
-        // 渲染指标模板
-        function initTreeIndicatorTemplate(tree) {
-            console.log('initTreeIndicatorTemplate')
-            $.ajax({
-                type: "GET",
-                url: './initTreeIndicatorTemplate',
-                data: {
-                    "spread": false
-                },
-                success: function (r) {
-                    let o = r instanceof Object
-                    if (!o) {
-                        r = JSON.parse(r)
-                    }
-
-                    treeIn = tree.render({
-                        elem: '#indicatorTemplate',
-                        showCheckbox: true,
-                        accordion: true,
-                        id: 'Id3',
-                        data: r
-                    });
-                    return false;
-                }
-            });
-        }
-
-        function initTreeIndicator(tree) {
-            console.log('initTreeIndicator')
-            $.ajax({
-                type: "GET",
-                url: './initTreeIndicator',
-                data: {
-                    "spread": false
-                },
-                success: function (r) {
-
-                    // console.log(r)
-                    let o = r instanceof Object
-                    if (!o) {
-                        r = JSON.parse(r)
-                    }
-
-                    treeIn = tree.render({
-                        elem: '#allIndicator',
-                        showCheckbox: true,
-                        accordion: true,
-                        id: 'Id2',
-                        data: r
-                    });
-
-
-                    return false;
-
-                }
-
-            });
-
-        }
-
-        function renderTable(table, citys, quxians, indicators, ttype, sdate) {
-            console.log('renderTable')
-
-            $.ajax({
-                type: "POST",
-                url: './renderTable',
-                async: false,
-                data: {
-                    "citys": citys,
-                    "quxians": quxians,
-                    "indicators": indicators,
-                    "ttype": ttype,
-                    "sdate": sdate
-                },
-                success: function (r) {
-                    dataA = r;
-                    // 没有权限提示
-                    if (r?.msg && r.msg.length > 0) {
-                        alert(r.msg);
-                        return;
-                    }
-
-                    let o = r instanceof Object
-                    if (!o) {
-                        r = JSON.parse(r)
-                    }
-
-                    table.render({
-                        elem: '#demo',
-                        height: 320,
-                        // url: 'https://www.layui.com/demo/table/user/' , //数据接口
-                        page: true, //开启分页
-                        toolbar: true,
-                        defaultToolbar: [{
-                            title: '提示' //标题
-                            ,
-                            layEvent: 'export' //事件名,用于 toolbar 事件中使用
-                            ,
-                            icon: 'layui-icon-export' //图标类名
-                        }],
-                        limit: 50,
-                        limits: [50, 200, 500],
-                        cols: [
-                            r.cols
-                        ],
-                        data: r.datas
-                    });
-
-
-                    return false;
-
-                }
-
-            });
-
-        }
-
-        function conditionRenderTable(table, condition, searchType, indicators, ttype, sdate) {
-            console.log('conditionRenderTable')
-
-            $.ajax({
-                type: "POST",
-                url: './conditionRenderTable',
-                async: false,
-                data: {
-                    "condition": condition,
-                    "searchType": searchType,
-                    "indicators": indicators,
-                    "ttype": ttype,
-                    "sdate": sdate
-                },
-                success: function (r) {
-                    dataA = r;
-                    // console.log(r)
-                    let o = r instanceof Object
-                    if (!o) {
-                        r = JSON.parse(r)
-                    }
-
-                    table.render({
-                        elem: '#demo',
-                        height: 320,
-                        // url: 'https://www.layui.com/demo/table/user/' , //数据接口
-                        page: true, //开启分页
-                        toolbar: true,
-                        defaultToolbar: [{
-                            title: '提示' //标题
-                            ,
-                            layEvent: 'export' //事件名,用于 toolbar 事件中使用
-                            ,
-                            icon: 'layui-icon-export' //图标类名
-                        }],
-                        limit: 50,
-                        limits: [50, 200, 500],
-                        cols: [
-                            r.cols
-                        ],
-                        data: r.datas
-                    });
-
-
-                    return false;
-
-                }
-
-            });
-
-        }
-
-        function search() {
-            // form.on('submit(formDemo)', function (data) {
-            if ($('#time1').val() == 0) {
-                alert('填选择时间')
-                return;
-            }
-            if (tree.getChecked('Id1').length == 0) {
-                alert('请选择地市')
-                return;
-            }
-            if (tree.getChecked('Id3').length == 0) {
-                alert('请选择指标')
-                return;
-            }
-
-           alert('开始查询')
-            // layer.msg(JSON.stringify(data.field));
-            console.log(JSON.stringify(tree.getChecked('Id1')))
-            let checkData1 = tree.getChecked('Id1')[0].children;
-            let checkData2 = tree.getChecked('Id3')[0].children;
-            console.log(checkData1)
-            console.log(checkData2)
-
-            const quxianA = new Set();
-            var citysA = [];
-            checkData1.forEach(eee => {
-                citysA.push("'" + eee.title + "'")
-                eee.children.forEach(ee => {
-                    quxianA.add("'" + ee.title + "'")
-                })
-            });
-
-            const quxians = Array.from(quxianA).join(',')
-            citys = citysA.join(',')
-            console.log(`citys: ${citys}`)
-            console.log(`quxians: ${quxians}`)
-            var indicatorsA = new Set();
-            checkData2.forEach(eee => {
-                eee.children.forEach(ee => {
-                    indicatorsA.add(ee.id)
-                })
-            });
-            const indicators = Array.from(indicatorsA).join(',')
-            console.log(`indicators: ${JSON.stringify(indicators)}`)
-            let ttype = $('#timeType').val()
-            let sdate = $('#time1').val()
-            console.log(`sdate: ${sdate}`)
-            renderTable(table, citys, quxians,indicators, ttype, sdate)
-
-            return false;
-        }
-
-
-
-        function conditionSearch() {
-            let sdate = $('#time1').val()
-            if (sdate.length == 0) {
-                alert('填选择时间')
-                return;
-            }
-
-            if (tree.getChecked('Id2').length == 0) {
-                alert('请选择指标')
-                return;
-            }
-
-            let condition = $('#condition').val();
-            let ttype = $('#timeType').val()
-            let searchType = $('#searchType').find('input:checked').val()
-            if (searchType === 'eci' && $('#condition').val().length == 0) {
-                alert('填写查询条件')
-                return;
-            }
-
-            console.log(`searchType: ${searchType}`)
-            console.log(`condition: ${condition}`)
-            // layer.msg(JSON.stringify(data.field));
-            // let checkData1 = tree.getChecked('Id1')[0].children;
-
-            let checkData2 = tree.getChecked('Id2')[0].children;
-
-
-            var indicatorsA = new Array();
-            checkData2.forEach(eee => {
-                eee.children.forEach(ee => {
-
-                    indicatorsA.push(ee.id)
-
-                })
-            });
-            indicators = indicatorsA.join(',')
-            // console.log(indicators)
-            conditionRenderTable(table, condition, searchType, indicators, ttype, sdate)
-
-            return false;
-        }
-
-        // 添加指标模板
-        function addTemplate() {
-            layer.open({
-                type: 1,
-                title:"添加指标模板",
-                content: $("#add-template"),
-                area: ['600px', '1000px'],
-                btn: ['确定'],
-                shadeClose: true,
-                yes: function(index, layero){
-                    const templateName = $('#templateName').val()
-                    if (!templateName || templateName.length <= 0) {
-                        alert('请输入模板名称!')
-                        return
-                    }
-
-                    const checkedData = tree?.getChecked('Id2')?.[0]?.children
-                    if (!checkedData || checkedData.length <= 0) {
-                        alert('请选择指标!')
-                        return
-                    }
-
-                    console.log(`templateName: ${templateName}`)
-                    console.log(`checkedData: ${JSON.stringify(checkedData)}`)
-                    const indicatorsA = []
-                    checkedData.forEach(eee => {
-                        eee.children.forEach(ee => {
-                            indicatorsA.push(ee.id)
-                        })
-                    });
-                    const indicators = indicatorsA.join(',')
-                    console.log(`indicators: ${indicators}`)
-                    $.ajax({
-                        type: "POST",
-                        url: './addTemplate',
-                        async: false,
-                        data: {
-                            "templateName": templateName,
-                            "indicators": indicators,
-                        },
-                        success: function (r) {
-                            console.log(`response: ${JSON.stringify(r)}`)
-
-                            if (r) {
-                                alert('添加失败!')
-                            } else {
-                                initTreeIndicatorTemplate(tree)
-                                layer.msg('添加成功')
-                                layer.close(index)
-                            }
-                        }
-                    });
-                },
-            });
-        }
-
-        // 删除指标模板
-        function deleteTemplate() {
-            const checkedData = tree?.getChecked('Id3')?.[0]?.children
-            const idArray = []
-            checkedData.forEach(t => {
-                idArray.push(t.id)
-            });
-
-            if (!checkedData || checkedData.length <= 0) {
-                alert('请选择要删除的指标模板!')
-                return
-            }
-
-            layer.confirm('确认删除?', {icon: 3, title:'删除模板'}, function(index){
-                const ids = idArray.join(',')
-                console.log(`deleteTemplate: ${JSON.stringify(idArray)}`)
-                $.ajax({
-                    type: "POST",
-                    url: './deleteTemplate',
-                    async: false,
-                    data: {
-                        "ids": ids,
-                    },
-                    success: function (r) {
-                        console.log(`response: ${JSON.stringify(r)}`)
-
-                        if (r) {
-                            alert('删除失败!')
-                        } else {
-                            initTreeIndicatorTemplate(tree)
-                            layer.msg('删除成功')
-                            layer.close(index)
-                        }
-                    }
-                });
-            });
-        }
-    </script>
-</body>
-
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Template</title>
+    <link rel="stylesheet" href="./js/layui/css/layui.css">
+    <style>
+        .all {
+            padding-top: 30px;
+            padding-left: 30px;
+            padding-right: 30px;
+
+        }
+
+        .c {
+            float: left;
+
+        }
+
+        .c1 {
+            margin: 10px;
+            float: left;
+
+
+        }
+
+        .t1 {
+            width: 15%;
+        }
+
+        .row {
+            height: 50px;
+        }
+
+        .t2 {
+            width: 10%;
+        }
+
+        .view {
+
+            width: 75%;
+        }
+
+        #timeType {
+            float: left;
+            width: 10%;
+        }
+
+        #time1 {
+            float: left;
+            width: 10%;
+        }
+
+        .btn {
+            float: left;
+            width: 10%;
+        }
+
+        .label {
+            height: 50px;
+            line-height: 32px;
+        }
+    </style>
+</head>
+
+<body>
+<div class="all">
+
+    <div class="c t1">
+        <button type="button" class="layui-btn layui-btn-sm" onclick="addTemplate()">添加指标模板</button>
+        <button type="button" class="layui-btn layui-btn-sm" onclick="deleteTemplate()">删除指标模板</button>
+        <div id="allArea"></div>
+        <div id="indicatorTemplate"></div>
+        <div id="add-template" style="display: none;">
+            <form class="layui-form" action="">
+                <div class="layui-form-item" style="margin-top: 20px">
+                    <label class="layui-form-label">模板名称</label>
+                    <div class="layui-input-block" style="width: 400px">
+                        <input id="templateName" type="text" name="templateName" required lay-verify="required"
+                               placeholder="请输入模板名称" autocomplete="off" class="layui-input">
+                    </div>
+                </div>
+            </form>
+            <div id="allIndicator"></div>
+        </div>
+    </div>
+    <div class="c t2">
+        <form class="layui-form" action="">
+            <div class="column" id="searchType">
+                <input type="radio" name="where" value="eci" title="按eci查询" lay-filter="where" checked>
+                <input type="radio" name="where" value="all" title="全网选择" lay-filter="where">
+            </div>
+            <textarea id="condition" cols="14" rows="19"
+                      style="border-width:1px;border-style: solid;border-color: #eee;"></textarea>
+        </form>
+    </div>
+    <div class="c view">
+        <div class="row layui-form">
+
+            <div class="c1 label"> 粒度:</div>
+
+            <div class="timeTypeDiv c1" style="width: 10%;">
+                <select name="timeType" id="timeType">
+                    <option value="quater">15分钟</option>
+                    <option value="hour">小时</option>
+                    <option value="day">天</option>
+                    <!--<option value="week">星期</option>-->
+                    <!--<option value="month">月</option>-->
+                </select>
+            </div>
+
+            <div class="c1 label" style="margin-left: 120px;">时间:</div>
+            <input type="text" class="layui-input c1" style="width: 300px;" id="time1">
+            <button class="layui-btn btn c1" style="margin-left: 20px;" onclick="search()">查询</button>
+            <button class="layui-btn btn c1" style="margin-left: 20px;" onclick="conditionSearch()">条件查询</button>
+        </div>
+        <div class="row">
+            <table id="demo" lay-filter="test" style="width: 200px;"></table>
+        </div>
+    </div>
+</div>
+<script src="./js/jquery-3.5.1.min.js"></script>
+<script src="./js/layui/layui.js"></script>
+<script>
+        var dataA;
+        var layer;
+        var tree;
+        var table;
+        layui.use(['layer', 'tree', 'form', 'laydate', 'table'], function () {
+            tree = layui.tree;
+            layer = layui.layer;
+            table = layui.table;
+            var form = layui.form,
+
+                laydate = layui.laydate;
+            // layer.msg('Hello Zhou')
+            table.render({
+                elem: '#demo',
+                height: 320,
+                // url: 'https://www.layui.com/demo/table/user/' , //数据接口
+                page: true, //开启分页
+                toolbar: true,
+                defaultToolbar: [{
+                    title: '导出' //标题
+                    ,
+                    layEvent: 'export' //事件名,用于 toolbar 事件中使用
+                    ,
+                    icon: 'layui-icon-export' //图标类名
+                }],
+                limit: 50,
+                limits: [50, 200, 500],
+                cols: [
+
+                ],
+                data: []
+            });
+
+            //工具条事件
+            table.on('toolbar(test)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
+                var data = obj.data; //获得当前行数据
+                var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
+                if (layEvent === 'export') {
+                    // layer.alert('Hi,头部工具栏扩展的右侧图标。');
+                    var tableData = table.cache['demo']
+                    obj.config.title = "地市指标"
+                    // console.log(JSON.stringify(dataA))
+                    table.exportFile(obj.config.id, dataA.datas, 'csv')
+                }
+            });
+            laydate.render({
+                elem: '#time1',
+                type: 'datetime',
+                range: true,
+            });
+
+            initTreeCity(tree)
+            initTreeIndicator(tree)
+            initTreeIndicatorTemplate(tree)
+        })
+
+        var treeCity;
+        function initTreeCity(tree) {
+            console.log('initTreeCity')
+            $.ajax({
+                type: "GET",
+                // url: './json/citys.json',
+                url: './initTreeCitys',
+                data: {
+                    "spread": false
+                },
+                success: function (r) {
+
+                    // console.log(r)
+                    let o = r instanceof Object
+                    if (!o) {
+                        r = JSON.parse(r)
+                    }
+
+                    treeCity = tree.render({
+                        elem: '#allArea',
+                        showCheckbox: true,
+                        accordion: true,
+                        id: 'Id1',
+                        data: r
+                    });
+
+
+                    return false;
+
+                }
+
+            });
+
+        }
+
+        var treeIn;
+        // 渲染指标模板
+        function initTreeIndicatorTemplate(tree) {
+            console.log('initTreeIndicatorTemplate')
+            $.ajax({
+                type: "GET",
+                url: './initTreeIndicatorTemplate',
+                data: {
+                    "spread": false
+                },
+                success: function (r) {
+                    let o = r instanceof Object
+                    if (!o) {
+                        r = JSON.parse(r)
+                    }
+
+                    treeIn = tree.render({
+                        elem: '#indicatorTemplate',
+                        showCheckbox: true,
+                        accordion: true,
+                        id: 'Id3',
+                        data: r
+                    });
+                    return false;
+                }
+            });
+        }
+
+        function initTreeIndicator(tree) {
+            console.log('initTreeIndicator')
+            $.ajax({
+                type: "GET",
+                url: './initTreeIndicator',
+                data: {
+                    "spread": false
+                },
+                success: function (r) {
+
+                    // console.log(r)
+                    let o = r instanceof Object
+                    if (!o) {
+                        r = JSON.parse(r)
+                    }
+
+                    treeIn = tree.render({
+                        elem: '#allIndicator',
+                        showCheckbox: true,
+                        accordion: true,
+                        id: 'Id2',
+                        data: r
+                    });
+
+
+                    return false;
+
+                }
+
+            });
+
+        }
+
+        function renderTable(table, citys, quxians, indicators, ttype, sdate) {
+            console.log('renderTable')
+
+            $.ajax({
+                type: "POST",
+                url: './renderTable',
+                async: false,
+                data: {
+                    "citys": citys,
+                    "quxians": quxians,
+                    "indicators": indicators,
+                    "ttype": ttype,
+                    "sdate": sdate
+                },
+                success: function (r) {
+                    dataA = r;
+                    // 没有权限提示
+                    if (r?.msg && r.msg.length > 0) {
+                        alert(r.msg);
+                        return;
+                    }
+
+                    let o = r instanceof Object
+                    if (!o) {
+                        r = JSON.parse(r)
+                    }
+
+                    table.render({
+                        elem: '#demo',
+                        height: 320,
+                        // url: 'https://www.layui.com/demo/table/user/' , //数据接口
+                        page: true, //开启分页
+                        toolbar: true,
+                        defaultToolbar: [{
+                            title: '提示' //标题
+                            ,
+                            layEvent: 'export' //事件名,用于 toolbar 事件中使用
+                            ,
+                            icon: 'layui-icon-export' //图标类名
+                        }],
+                        limit: 50,
+                        limits: [50, 200, 500],
+                        cols: [
+                            r.cols
+                        ],
+                        data: r.datas
+                    });
+
+
+                    return false;
+
+                }
+
+            });
+
+        }
+
+        function conditionRenderTable(table, condition, searchType, indicators, ttype, sdate) {
+            console.log('conditionRenderTable')
+
+            $.ajax({
+                type: "POST",
+                url: './conditionRenderTable',
+                async: false,
+                data: {
+                    "condition": condition,
+                    "searchType": searchType,
+                    "indicators": indicators,
+                    "ttype": ttype,
+                    "sdate": sdate
+                },
+                success: function (r) {
+                    dataA = r;
+                    // console.log(r)
+                    let o = r instanceof Object
+                    if (!o) {
+                        r = JSON.parse(r)
+                    }
+
+                    table.render({
+                        elem: '#demo',
+                        height: 320,
+                        // url: 'https://www.layui.com/demo/table/user/' , //数据接口
+                        page: true, //开启分页
+                        toolbar: true,
+                        defaultToolbar: [{
+                            title: '提示' //标题
+                            ,
+                            layEvent: 'export' //事件名,用于 toolbar 事件中使用
+                            ,
+                            icon: 'layui-icon-export' //图标类名
+                        }],
+                        limit: 50,
+                        limits: [50, 200, 500],
+                        cols: [
+                            r.cols
+                        ],
+                        data: r.datas
+                    });
+
+
+                    return false;
+
+                }
+
+            });
+
+        }
+
+        function search() {
+            // form.on('submit(formDemo)', function (data) {
+            if ($('#time1').val() == 0) {
+                alert('填选择时间')
+                return;
+            }
+            if (tree.getChecked('Id1').length == 0) {
+                alert('请选择地市')
+                return;
+            }
+            if (tree.getChecked('Id3').length == 0) {
+                alert('请选择指标')
+                return;
+            }
+
+           alert('开始查询')
+            // layer.msg(JSON.stringify(data.field));
+            console.log(JSON.stringify(tree.getChecked('Id1')))
+            let checkData1 = tree.getChecked('Id1')[0].children;
+            let checkData2 = tree.getChecked('Id3')[0].children;
+            console.log(checkData1)
+            console.log(checkData2)
+
+            const quxianA = new Set();
+            var citysA = [];
+            checkData1.forEach(eee => {
+                citysA.push("'" + eee.title + "'")
+                eee.children.forEach(ee => {
+                    quxianA.add("'" + ee.title + "'")
+                })
+            });
+
+            const quxians = Array.from(quxianA).join(',')
+            citys = citysA.join(',')
+            console.log(`citys: ${citys}`)
+            console.log(`quxians: ${quxians}`)
+            var indicatorsA = new Set();
+            checkData2.forEach(eee => {
+                eee.children.forEach(ee => {
+                    indicatorsA.add(ee.id)
+                })
+            });
+            const indicators = Array.from(indicatorsA).join(',')
+            console.log(`indicators: ${JSON.stringify(indicators)}`)
+            let ttype = $('#timeType').val()
+            let sdate = $('#time1').val()
+            console.log(`sdate: ${sdate}`)
+            renderTable(table, citys, quxians,indicators, ttype, sdate)
+
+            return false;
+        }
+
+
+
+        function conditionSearch() {
+            let sdate = $('#time1').val()
+            if (sdate.length == 0) {
+                alert('填选择时间')
+                return;
+            }
+
+            if (tree.getChecked('Id2').length == 0) {
+                alert('请选择指标')
+                return;
+            }
+
+            let condition = $('#condition').val();
+            let ttype = $('#timeType').val()
+            let searchType = $('#searchType').find('input:checked').val()
+            if (searchType === 'eci' && $('#condition').val().length == 0) {
+                alert('填写查询条件')
+                return;
+            }
+
+            console.log(`searchType: ${searchType}`)
+            console.log(`condition: ${condition}`)
+            // layer.msg(JSON.stringify(data.field));
+            // let checkData1 = tree.getChecked('Id1')[0].children;
+
+            let checkData2 = tree.getChecked('Id2')[0].children;
+
+
+            var indicatorsA = new Array();
+            checkData2.forEach(eee => {
+                eee.children.forEach(ee => {
+
+                    indicatorsA.push(ee.id)
+
+                })
+            });
+            indicators = indicatorsA.join(',')
+            // console.log(indicators)
+            conditionRenderTable(table, condition, searchType, indicators, ttype, sdate)
+
+            return false;
+        }
+
+        // 添加指标模板
+        function addTemplate() {
+            layer.open({
+                type: 1,
+                title:"添加指标模板",
+                content: $("#add-template"),
+                area: ['600px', '1000px'],
+                btn: ['确定'],
+                shadeClose: true,
+                yes: function(index, layero){
+                    const templateName = $('#templateName').val()
+                    if (!templateName || templateName.length <= 0) {
+                        alert('请输入模板名称!')
+                        return
+                    }
+
+                    const checkedData = tree?.getChecked('Id2')?.[0]?.children
+                    if (!checkedData || checkedData.length <= 0) {
+                        alert('请选择指标!')
+                        return
+                    }
+
+                    console.log(`templateName: ${templateName}`)
+                    console.log(`checkedData: ${JSON.stringify(checkedData)}`)
+                    const indicatorsA = []
+                    checkedData.forEach(eee => {
+                        eee.children.forEach(ee => {
+                            indicatorsA.push(ee.id)
+                        })
+                    });
+                    const indicators = indicatorsA.join(',')
+                    console.log(`indicators: ${indicators}`)
+                    $.ajax({
+                        type: "POST",
+                        url: './addTemplate',
+                        async: false,
+                        data: {
+                            "templateName": templateName,
+                            "indicators": indicators,
+                        },
+                        success: function (r) {
+                            console.log(`response: ${JSON.stringify(r)}`)
+
+                            if (r) {
+                                alert('添加失败!')
+                            } else {
+                                initTreeIndicatorTemplate(tree)
+                                layer.msg('添加成功')
+                                layer.close(index)
+                            }
+                        }
+                    });
+                },
+            });
+        }
+
+        // 删除指标模板
+        function deleteTemplate() {
+            const checkedData = tree?.getChecked('Id3')?.[0]?.children
+            const idArray = []
+            checkedData.forEach(t => {
+                idArray.push(t.id)
+            });
+
+            if (!checkedData || checkedData.length <= 0) {
+                alert('请选择要删除的指标模板!')
+                return
+            }
+
+            layer.confirm('确认删除?', {icon: 3, title:'删除模板'}, function(index){
+                const ids = idArray.join(',')
+                console.log(`deleteTemplate: ${JSON.stringify(idArray)}`)
+                $.ajax({
+                    type: "POST",
+                    url: './deleteTemplate',
+                    async: false,
+                    data: {
+                        "ids": ids,
+                    },
+                    success: function (r) {
+                        console.log(`response: ${JSON.stringify(r)}`)
+
+                        if (r) {
+                            alert('删除失败!')
+                        } else {
+                            initTreeIndicatorTemplate(tree)
+                            layer.msg('删除成功')
+                            layer.close(index)
+                        }
+                    }
+                });
+            });
+        }
+    </script>
+</body>
+
 </html>

+ 632 - 632
src/main/resources/templates/view.html

@@ -1,633 +1,633 @@
-<!--<!DOCTYPE html>-->
-<!--<html lang="en">-->
-
-<!--<head>-->
-<!--    <meta charset="UTF-8">-->
-<!--    <meta http-equiv="X-UA-Compatible" content="IE=edge">-->
-<!--    <meta name="viewport" content="width=device-width, initial-scale=1.0">-->
-<!--    <title>View</title>-->
-
-<!--    <style>-->
-<!--        * {-->
-<!--            box-sizing: border-box;-->
-<!--        }-->
-
-<!--        .header {-->
-<!--            text-align: center;-->
-<!--        }-->
-
-<!--        .column {-->
-<!--            text-align: center;-->
-<!--            float: left;-->
-<!--            padding: 10px;-->
-<!--        }-->
-
-<!--        /* 左右两侧宽度 */-->
-<!--        .column.left {-->
-<!--            width: 20%;-->
-<!--            /* padding-left: 10% */-->
-<!--        }-->
-
-<!--        .column.right {-->
-<!--            width: 25%;-->
-<!--            /* padding-top: 10%; */-->
-<!--            padding-right: 10%;-->
-<!--        }-->
-
-<!--        .column.right>button {-->
-<!--            margin-top: 25%;-->
-<!--        }-->
-
-<!--        /* 中间区域宽度 */-->
-<!--        .column.middle {-->
-<!--            width: 50%;-->
-<!--            text-align: center;-->
-<!--        }-->
-
-<!--        .row {-->
-<!--            margin-top: 20px;-->
-<!--        }-->
-
-<!--        /* 列后面清除浮动 */-->
-<!--        .row:after {-->
-<!--            content: "";-->
-<!--            display: table;-->
-<!--            clear: both;-->
-<!--        }-->
-
-<!--        .select {-->
-<!--            width: 80%;-->
-<!--            padding-left: 20%;-->
-<!--        }-->
-
-<!--        .test1 {-->
-<!--            position: relative;-->
-<!--            left: 100px;-->
-<!--            text-align: center;-->
-<!--            margin: 10px;-->
-<!--            padding: 0;-->
-<!--            height: 200px;-->
-<!--            /* overflow: hidden; */-->
-<!--            font-family: inherit;-->
-<!--            font-size: 180%;-->
-<!--            font-style: inherit;-->
-<!--            font-weight: inherit;-->
-<!--            /* outline: 0; */-->
-<!--            border-color: #eee;-->
-<!--            /* line-height: 2; */-->
-<!--            /* border-width: 1px; */-->
-<!--            border-style: solid;-->
-<!--            background-color: #fff;-->
-<!--            /* color: rgba(0, 0, 0, .85); */-->
-<!--            border-radius: 2px;-->
-<!--            display: block;-->
-<!--            width: 100%;-->
-<!--            /* padding-left: 10px; */-->
-<!--            /* padding-right: 30px; */-->
-<!--            cursor: pointer;-->
-<!--        }-->
-
-<!--        .test2 {-->
-<!--            position: relative;-->
-<!--            left: 100px;-->
-<!--            text-align: center;-->
-<!--            margin: 10px;-->
-<!--            padding: 0;-->
-<!--            height: 200px;-->
-<!--            /* overflow: hidden; */-->
-<!--            font-family: inherit;-->
-<!--            font-size: 180%;-->
-<!--            font-style: inherit;-->
-<!--            font-weight: inherit;-->
-<!--            /* outline: 0; */-->
-<!--            border-color: #eee;-->
-<!--            /* line-height: 2; */-->
-<!--            /* border-width: 1px; */-->
-<!--            border-style: solid;-->
-<!--            background-color: #fff;-->
-<!--            /* color: rgba(0, 0, 0, .85); */-->
-<!--            border-radius: 2px;-->
-<!--            display: block;-->
-<!--            width: 100%;-->
-<!--            /* padding-left: 10px; */-->
-<!--            /* padding-right: 30px; */-->
-<!--            cursor: pointer;-->
-<!--        }-->
-
-<!--        .one {-->
-<!--            padding-left: 25%;-->
-<!--        }-->
-
-<!--        .gis {-->
-<!--            padding-left: 20%;-->
-<!--        }-->
-<!--    </style>-->
-<!--    <link rel="stylesheet" href="./js/layui/css/layui.css">-->
-<!--</head>-->
-
-<!--<body>-->
-<!--<div class="header">-->
-<!--    &lt;!&ndash; 页面数据展示 &ndash;&gt;-->
-<!--</div>-->
-<!--<div class="row">-->
-<!--    <div class="one">-->
-<!--        <form class="layui-form" action="">-->
-<!--            <div class="column" id="guishudi">-->
-<!--                <input type="radio" name="where" value="local" title="归属地" lay-filter="where" checked>-->
-<!--                <input type="radio" name="where" value="roaming" title="拜访地" lay-filter="where">-->
-<!--            </div>-->
-<!--            <div class="column">-->
-<!--                <select name="timeType" id="timeTpye">-->
-<!--                    <option value="">天</option>-->
-<!--                    <option value="7">7天</option>-->
-<!--                    <option value="30" selected>30天</option>-->
-<!--                    <option value="60">60天</option>-->
-<!--                </select>-->
-<!--            </div>-->
-<!--            <div class="column">-->
-<!--                日期范围-->
-<!--                &lt;!&ndash; <div class="layui-inline" id="test6"> &ndash;&gt;-->
-<!--                <div class="layui-input-inline">-->
-<!--                    <input type="text" autocomplete="off" id="startDate" class="layui-input" placeholder="开始日期">-->
-<!--                </div>-->
-<!--                &lt;!&ndash; <div class="layui-form-mid">-</div>- &ndash;&gt;-->
-<!--                &lt;!&ndash; <div class="layui-input-inline">-->
-<!--                        <input type="text" autocomplete="off" id="endDate" class="layui-input" placeholder="结束日期">-->
-<!--                    </div> &ndash;&gt;-->
-<!--                &lt;!&ndash; </div> &ndash;&gt;-->
-<!--            </div>-->
-<!--        </form>-->
-<!--        <div class="column">-->
-<!--            &lt;!&ndash; <button class="layui-btn" lay-submit lay-filter="search">查询</button> &ndash;&gt;-->
-<!--            <button class="layui-btn" onclick="searchGrp()">查询</button>-->
-<!--            &lt;!&ndash; <button type="reset" class="layui-btn layui-btn-primary">重置</button> &ndash;&gt;-->
-<!--        </div>-->
-
-
-
-<!--    </div>-->
-<!--</div>-->
-<!--<div class="row">-->
-<!--    <div class="column left">-->
-<!--        &lt;!&ndash; <form class="layui-form" action="">-->
-<!--            <div class="select">-->
-<!--                <select multiple="multiple" name="city1" class="test">-->
-<!--                    <option value=""></option>-->
-<!--                    <option value="0">北京</option>-->
-<!--                    <option value="1">上海</option>-->
-<!--                    <option value="2">广州</option>-->
-<!--                    <option value="3">深圳</option>-->
-<!--                    <option value="4">杭州</option>-->
-<!--                </select>-->
-<!--            </div>-->
-
-
-<!--        </form> &ndash;&gt;-->
-<!--        <div class="select">-->
-<!--            <select multiple="multiple" name="province" class="test1" id="selectProvince"-->
-<!--                    onchange="provinceSelect()">-->
-<!--                <option value="0">北京</option>-->
-<!--                <option value="1">天津</option>-->
-<!--                <option value="2">河北</option>-->
-<!--                <option value="3">河南</option>-->
-
-<!--            </select>-->
-
-<!--        </div>-->
-
-<!--        <div class="select">-->
-<!--            <select multiple="multiple" name="city" class="test2" id="selectCity">-->
-<!--                <option value="0">石家庄</option>-->
-<!--                <option value="1">唐山</option>-->
-<!--                <option value="2">张家口</option>-->
-<!--                <option value="3">保定</option>-->
-<!--                <option value="4">秦皇岛</option>-->
-<!--                <option value="5">廊坊</option>-->
-<!--            </select>-->
-
-<!--        </div>-->
-
-
-<!--    </div>-->
-<!--    <div class="column middle">-->
-<!--        <div class="layui-form">-->
-<!--            <div class="layui-input-inline" id="cb">-->
-<!--                <input type="radio" name="searchType" lay-filter="cb" title="5G终端用户数" value="5G终端用户数" checked>-->
-<!--                <input type="radio" name="searchType" lay-filter="cb" title="打开5G开关用户数" value="打开5G开关用户数">-->
-<!--                <input type="radio" name="searchType" lay-filter="cb" title="关闭5G开关用户数" value="关闭5G开关用户数">-->
-<!--                <input type="radio" name="searchType" lay-filter="cb" title="5G开关打开率" value="5G开关打开率">-->
-<!--            </div>-->
-<!--        </div>-->
-<!--        <div class="gis">-->
-<!--            <div id="graph" style="width: 600px;height:400px;"></div>-->
-<!--        </div>-->
-<!--    </div>-->
-<!--    <div class="column right">-->
-
-<!--        <button class="layui-btn export" lay-submit lay-filter="export">导出指标</button>-->
-<!--        <br>-->
-<!--        <button class="layui-btn export" lay-submit lay-filter="exportAll">导出全量</button>-->
-<!--        <br>-->
-<!--        <button class="layui-btn export" lay-submit lay-filter="exportClose">导出未开</button>-->
-
-<!--    </div>-->
-<!--</div>-->
-<!--<script src="./js/jquery-3.5.1.min.js"></script>-->
-<!--<script src="./js/layui/layui.js"></script>-->
-<!--<script src="./js/echarts.js"></script>-->
-<!--<script>-->
-<!--        function initGrp() {-->
-<!--            console.log('initgrp')-->
-<!--            $.ajax({-->
-<!--                type: "GET",-->
-<!--                // url: './json/et.json',-->
-<!--                url: './search',-->
-<!--                data: {-->
-<!--                    "from":$('#guishudi').find('input:checked').val(),-->
-<!--                    "range": $('#startDate').val(),-->
-<!--                    // "range": '20210719 - 20210722',-->
-<!--                    "stype": $('#cb').find('input:checked').val(),-->
-<!--                    "ttype": $('#timeTpye').val(),-->
-<!--                    "provinces": '河北',-->
-<!--                    "citys": ''-->
-
-<!--                },-->
-<!--                success: function (r) {-->
-
-<!--                    console.log(r)-->
-<!--                    let o = r instanceof Object-->
-<!--                    if (!o) {-->
-<!--                        r = JSON.parse(r)-->
-<!--                    }-->
-<!--                    option.xAxis.data = r.dt;-->
-<!--                    option.series[0].data = r.num;-->
-<!--                    myChart.setOption(option);-->
-<!--                    return false;-->
-
-<!--                }-->
-
-<!--            });-->
-
-<!--        }-->
-<!--        function searchGrp() {-->
-
-<!--            let provinceSize = $('#selectProvince').find('option:selected').length;-->
-<!--            let cbSize = $("#cb").find('input:checked').length;-->
-
-<!--            if (provinceSize < 1) {-->
-<!--                alert('请选择省市')-->
-<!--                return;-->
-<!--            }-->
-
-<!--            if (cbSize < 1) {-->
-<!--                alert('请选择类型')-->
-<!--                return;-->
-<!--            }-->
-
-<!--            var ps = new Array();-->
-<!--            $('#selectProvince').find('option:selected').each(function (i, t) {-->
-<!--                ps.push($(t).val());-->
-<!--            });-->
-<!--            var cs = new Array();-->
-<!--            $('#selectCity').find('option:selected').each(function (i, t) {-->
-<!--                cs.push($(t).val());-->
-<!--            });-->
-<!--            let provinces = ps.join(',');-->
-<!--            let citys = cs.join(',');-->
-
-<!--            $.ajax({-->
-<!--                type: "GET",-->
-<!--                // url: './json/et.json',-->
-<!--                url: './search',-->
-<!--                data: {-->
-<!--                    "from":$('#guishudi').find('input:checked').val(),-->
-<!--                    "range": $('#startDate').val(),-->
-<!--                    "stype": $('#cb').find('input:checked').val(),-->
-<!--                    "ttype": $('#timeTpye').val(),-->
-<!--                    "provinces": provinces,-->
-<!--                    "citys": citys-->
-
-<!--                },-->
-<!--                success: function (r) {-->
-
-<!--                    console.log(r)-->
-<!--                    let o = r instanceof Object-->
-<!--                    if (!o) {-->
-<!--                        r = JSON.parse(r)-->
-<!--                    }-->
-<!--                    option.xAxis.data = r.dt;-->
-<!--                    option.series[0].data = r.num;-->
-<!--                    myChart.setOption(option);-->
-<!--                    return false;-->
-
-<!--                }-->
-
-<!--            });-->
-
-<!--        }-->
-<!--        function typeExportClose() {-->
-<!--            console.log("exportClose")-->
-<!--            this.location.href = "/exportClose?" + "ttype=" + $('#timeTpye').val() + "&range=" + $('#startDate').val()-->
-<!--        }-->
-<!--        function typeExportAll() {-->
-<!--            console.log("exportAll")-->
-<!--            this.location.href = "/exportAll?" + "ttype=" + $('#timeTpye').val() + "&range=" + $('#startDate').val()-->
-
-<!--        }-->
-
-<!--        function typeExport(guishu) {-->
-<!--            var ps = new Array();-->
-<!--            $('#selectProvince').find('option:selected').each(function (i, t) {-->
-<!--                ps.push($(t).val());-->
-<!--            });-->
-<!--            var cs = new Array();-->
-<!--            $('#selectCity').find('option:selected').each(function (i, t) {-->
-<!--                cs.push($(t).val());-->
-<!--            });-->
-<!--            let provinces = ps.join(',');-->
-<!--            let citys = cs.join(',');-->
-<!--            this.location.href = "/typeExport?" + "from=" + guishu + "&provinces="+provinces+"&citys="+citys+"&ttype=" + $('#timeTpye').val() + "&range=" + $('#startDate').val()-->
-<!--        }-->
-
-<!--        function provinceSelect() {-->
-<!--            console.log("province change")-->
-<!--            let selectSice = $('#selectProvince').find('option:selected').length-->
-<!--            if (selectSice < 1) {-->
-<!--                $('#selectCity').empty();-->
-<!--            } else if (selectSice == 1) {-->
-<!--                $('#selectCity').removeAttr("disabled"); $('#selectProvince').find-->
-<!--                changeProvince($('#guishudi').find('input:checked').val(), $('#selectProvince').find('option:selected')[0].text);-->
-<!--            } else {-->
-<!--                $('#selectCity').attr("disabled", "disabled");-->
-<!--            }-->
-<!--        }-->
-
-<!--        function changeProvince(type, province) {-->
-<!--            console.log('changeprovince')-->
-
-<!--            $.ajax({-->
-<!--                type: "GET",-->
-<!--                // url: './json/citys.json',-->
-<!--                url: './initCitys',-->
-<!--                async: false,-->
-<!--                data: {-->
-<!--                    "type": type,-->
-<!--                    "province": province-->
-<!--                },-->
-<!--                success: function (data) {-->
-<!--                    let o = data instanceof Object-->
-<!--                    console.log(o)-->
-<!--                    if (!o) {-->
-<!--                        data = JSON.parse(data)-->
-<!--                    }-->
-<!--                    $('#selectCity').empty();-->
-<!--                    var html = '';-->
-<!--                    $.each(data, function (commentIndex, comment) {-->
-<!--                        html += '<option value="' + comment + '">' + comment + '</option>';-->
-<!--                        // console.log(commentIndex,comment)-->
-<!--                    });-->
-
-<!--                    $('#selectCity').html(html);-->
-
-<!--                }-->
-<!--            });-->
-<!--        }-->
-
-<!--        function dateFormat(fmt, date, n) {-->
-<!--            if (n == undefined || n == '') {-->
-<!--                n = 0;-->
-<!--            }-->
-<!--            let ret;-->
-<!--            const opt = {-->
-<!--                "Y+": date.getFullYear().toString(), // 年-->
-<!--                "m+": (date.getMonth() + 1).toString(), // 月-->
-<!--                "d+": (date.getDate() + n).toString(), // 日-->
-<!--                "H+": date.getHours().toString(), // 时-->
-<!--                "M+": date.getMinutes().toString(), // 分-->
-<!--                "S+": date.getSeconds().toString() // 秒-->
-<!--                // 有其他格式化字符需求可以继续添加,必须转化成字符串-->
-<!--            };-->
-<!--            for (let k in opt) {-->
-<!--                ret = new RegExp("(" + k + ")").exec(fmt);-->
-<!--                if (ret) {-->
-<!--                    fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))-->
-<!--                };-->
-<!--            };-->
-<!--            return fmt;-->
-<!--        }-->
-
-<!--        // function searct(data) {-->
-
-<!--        // this.location.href="/cmcc/alert/cellAlertDownload"+"?start_time_o="+stime+"&end_time_o="+etime+"&type="+type+"&aType="+aType;-->
-
-<!--        // }-->
-
-<!--        function radioChange(t) {-->
-
-<!--            let type = $('#guishudi').find('input:checked').val();-->
-<!--            // let where = $("input[type='radio']:checked").val();-->
-
-<!--            $.ajax({-->
-<!--                type: "GET",-->
-<!--                // url: './json/' + where + '.json',-->
-<!--                url: './initProvince',-->
-<!--                async: false,-->
-<!--                data: {-->
-<!--                    "type": type-->
-<!--                },-->
-<!--                success: function (data) {-->
-<!--                    let o = data instanceof Object-->
-<!--                    console.log(o)-->
-<!--                    if (!o) {-->
-<!--                        data = JSON.parse(data)-->
-<!--                    }-->
-
-<!--                    // console.log(pc)-->
-<!--                    $('#selectProvince').empty();-->
-<!--                    var html = '';-->
-<!--                    $.each(data, function (commentIndex, comment) {-->
-<!--                        console.log(commentIndex, comment)-->
-<!--                        html += '<option value="' + comment + '">' + comment + '</option>';-->
-<!--                        // console.log(commentIndex,comment)-->
-
-<!--                    });-->
-
-<!--                    $('#selectProvince').html(html);-->
-<!--                    changeProvince($('#guishudi').find('input:checked').val(), $('#selectProvince').find('option')[0].text);-->
-<!--                }-->
-<!--            });-->
-<!--        }-->
-
-<!--        // function preTimeSelect() {-->
-
-<!--        //     $.ajax({-->
-<!--        //         type: "GET",-->
-<!--        //         url: './json/timeSelect.json',-->
-<!--        //         success: function (data) {-->
-
-<!--        //             $('#timeSelect').empty();-->
-<!--        //             var html = '';-->
-<!--        //             $.each(data, function (commentIndex, comment) {-->
-<!--        //                 html += '<option value="' + comment + '">' + comment + '</option>';-->
-<!--        //                 // console.log(commentIndex,comment)-->
-<!--        //             });-->
-
-<!--        //             $('#timeSelect').html(html);-->
-<!--        //             layui.use(['form'], function () {-->
-<!--        //                 var form = layui.form;-->
-
-<!--        //                 form.render('select')-->
-<!--        //             });-->
-
-<!--        //         }-->
-<!--        //     });-->
-<!--        // }-->
-
-<!--        // $('input[type=radio][name=where]').change(function () {-->
-<!--        //     console.log('change')-->
-<!--        //     alert(this.value)-->
-<!--        // })-->
-<!--    </script>-->
-
-<!--<script>-->
-<!--        var myChart = echarts.init(document.getElementById('graph'));-->
-<!--        option = {-->
-<!--            xAxis: {-->
-<!--                type: 'category',-->
-<!--                data: ['20210721', '20210722', '20210723', '20210724', '20210725', '20210726', '20210727']-->
-<!--            },-->
-<!--            yAxis: {-->
-<!--                type: 'value'-->
-<!--            },-->
-<!--            series: [{-->
-<!--                data: [150, 230, 224, 218, 135, 147, 260],-->
-<!--                type: 'line'-->
-<!--            }]-->
-<!--        };-->
-<!--        // myChart.setOption(option);-->
-<!--        layui.use(['layer', 'tree', 'form', 'laydate', 'table'], function () {-->
-<!--            var layer = layui.layer,-->
-<!--                tree = layui.tree,-->
-<!--                form = layui.form,-->
-<!--                table = layui.table,-->
-<!--                laydate = layui.laydate;-->
-<!--            let date = new Date();-->
-<!--            let date1 = dateFormat('YYYYmmdd', date, -7);-->
-<!--            let date2 = dateFormat('YYYYmmdd', date);-->
-<!--            let dateValue = date1 + ' - ' + date2;-->
-<!--            // console.log(dateValue)-->
-<!--            laydate.render({-->
-<!--                elem: '#startDate',-->
-<!--                type: 'date',-->
-<!--                format: 'yyyyMMdd',-->
-<!--                value: dateValue,-->
-<!--                isInitValue: true,-->
-<!--                range: '-',-->
-<!--                // range: ['#startDate', '#endDate']-->
-<!--            });-->
-
-
-<!--            form.render('select')-->
-<!--            form.on("radio(cb)", function (data) {-->
-<!--                // let stype = $('#cb').find('input:checked').val()-->
-<!--                // if (stype == '5G开关打开率') {-->
-<!--                //     $('.export').attr("disabled", "disabled");-->
-<!--                //     $(".export").addClass("layui-btn-disabled")-->
-
-<!--                // } else {-->
-<!--                //     $('.export').removeAttr("disabled");-->
-<!--                //     $(".export").removeClass("layui-btn-disabled")-->
-<!--                // }-->
-
-<!--            });-->
-<!--            //监听提交-->
-<!--            form.on("radio(where)", function (data) {-->
-<!--                radioChange(data.value);-->
-
-<!--            });-->
-<!--            // form.on('submit(search)', function (data) {-->
-<!--            //     // console.log(data.field);-->
-<!--            //     // let where = data.field.where;-->
-<!--            //     // let timeType = data.field.Type;-->
-<!--            //     let provinceSize = $('#selectProvince').find('option:selected').length;-->
-<!--            //     let cbSize = $("#cb").find('input:checked').length;-->
-<!--            //     console.log(cbSize);-->
-<!--            //     // console.log(provinceSize)-->
-<!--            //     if (provinceSize < 1) {-->
-<!--            //         alert('请选择省市')-->
-<!--            //         return false;-->
-<!--            //     }-->
-
-<!--            //     if (cbSize < 1) {-->
-<!--            //         alert('请选择类型')-->
-<!--            //         return false;-->
-<!--            //     }-->
-
-<!--            //     var ps = new Array();-->
-<!--            //     $('#selectProvince').find('option:selected').each(function (i, t) {-->
-<!--            //         ps.push($(t).val());-->
-<!--            //     });-->
-<!--            //     var cs = new Array();-->
-<!--            //     $('#selectCity').find('option:selected').each(function (i, t) {-->
-<!--            //         cs.push($(t).val());-->
-<!--            //     });-->
-<!--            //     let provinces = ps.join(',');-->
-<!--            //     let citys = cs.join(',');-->
-
-<!--            //     $.ajax({-->
-<!--            //         type: "GET",-->
-<!--            //         // url: './json/' + where + '.json',-->
-<!--            //         url: './typeExport',-->
-<!--            //         data: {-->
-<!--            //             "range": $('#startDate').val(),-->
-<!--            //             "stype": stype,-->
-<!--            //             "ttype": $('#timeTpye').val(),-->
-<!--            //             "provinces": provinces,-->
-<!--            //             "citys": citys-->
-
-<!--            //         },-->
-<!--            //         success: function (data) {-->
-<!--            //             let o = data instanceof Object-->
-<!--            //             if (!o) {-->
-<!--            //                 data = JSON.parse(data)-->
-<!--            //             }-->
-<!--            //             option.data = data.dt;-->
-<!--            //             option.series[0].data = date.num;-->
-<!--            //             myChart.setOption(option);-->
-
-<!--            //         }-->
-<!--            //     });-->
-<!--            //     // searchGrp()-->
-<!--            //     // layer.msg(JSON.stringify(data));-->
-<!--            //     return false;-->
-<!--            // });-->
-
-
-<!--            form.on('submit(export)', function () {-->
-<!--                let guishu = $('#guishudi').find('input:checked').val()-->
-<!--                typeExport(guishu)-->
-
-<!--            });-->
-<!--            form.on('submit(exportAll)', function () {-->
-<!--                // let stype=$('#cb').find('input:checked').val()-->
-<!--                typeExportAll()-->
-<!--            });-->
-<!--            form.on('submit(exportClose)', function () {-->
-<!--                // let stype=$('#cb').find('input:checked').val()-->
-<!--                typeExportClose()-->
-<!--            });-->
-
-<!--        });-->
-<!--    </script>-->
-<!--<script>-->
-<!--        $(function () {-->
-
-<!--            radioChange();-->
-<!--            changeProvince($('#guishudi').find('input:checked').val(), $('#selectProvince').find('option')[0].text);-->
-<!--            initGrp()-->
-<!--        })-->
-<!--    </script>-->
-
-<!--</body>-->
-
+<!--<!DOCTYPE html>-->
+<!--<html lang="en">-->
+
+<!--<head>-->
+<!--    <meta charset="UTF-8">-->
+<!--    <meta http-equiv="X-UA-Compatible" content="IE=edge">-->
+<!--    <meta name="viewport" content="width=device-width, initial-scale=1.0">-->
+<!--    <title>View</title>-->
+
+<!--    <style>-->
+<!--        * {-->
+<!--            box-sizing: border-box;-->
+<!--        }-->
+
+<!--        .header {-->
+<!--            text-align: center;-->
+<!--        }-->
+
+<!--        .column {-->
+<!--            text-align: center;-->
+<!--            float: left;-->
+<!--            padding: 10px;-->
+<!--        }-->
+
+<!--        /* 左右两侧宽度 */-->
+<!--        .column.left {-->
+<!--            width: 20%;-->
+<!--            /* padding-left: 10% */-->
+<!--        }-->
+
+<!--        .column.right {-->
+<!--            width: 25%;-->
+<!--            /* padding-top: 10%; */-->
+<!--            padding-right: 10%;-->
+<!--        }-->
+
+<!--        .column.right>button {-->
+<!--            margin-top: 25%;-->
+<!--        }-->
+
+<!--        /* 中间区域宽度 */-->
+<!--        .column.middle {-->
+<!--            width: 50%;-->
+<!--            text-align: center;-->
+<!--        }-->
+
+<!--        .row {-->
+<!--            margin-top: 20px;-->
+<!--        }-->
+
+<!--        /* 列后面清除浮动 */-->
+<!--        .row:after {-->
+<!--            content: "";-->
+<!--            display: table;-->
+<!--            clear: both;-->
+<!--        }-->
+
+<!--        .select {-->
+<!--            width: 80%;-->
+<!--            padding-left: 20%;-->
+<!--        }-->
+
+<!--        .test1 {-->
+<!--            position: relative;-->
+<!--            left: 100px;-->
+<!--            text-align: center;-->
+<!--            margin: 10px;-->
+<!--            padding: 0;-->
+<!--            height: 200px;-->
+<!--            /* overflow: hidden; */-->
+<!--            font-family: inherit;-->
+<!--            font-size: 180%;-->
+<!--            font-style: inherit;-->
+<!--            font-weight: inherit;-->
+<!--            /* outline: 0; */-->
+<!--            border-color: #eee;-->
+<!--            /* line-height: 2; */-->
+<!--            /* border-width: 1px; */-->
+<!--            border-style: solid;-->
+<!--            background-color: #fff;-->
+<!--            /* color: rgba(0, 0, 0, .85); */-->
+<!--            border-radius: 2px;-->
+<!--            display: block;-->
+<!--            width: 100%;-->
+<!--            /* padding-left: 10px; */-->
+<!--            /* padding-right: 30px; */-->
+<!--            cursor: pointer;-->
+<!--        }-->
+
+<!--        .test2 {-->
+<!--            position: relative;-->
+<!--            left: 100px;-->
+<!--            text-align: center;-->
+<!--            margin: 10px;-->
+<!--            padding: 0;-->
+<!--            height: 200px;-->
+<!--            /* overflow: hidden; */-->
+<!--            font-family: inherit;-->
+<!--            font-size: 180%;-->
+<!--            font-style: inherit;-->
+<!--            font-weight: inherit;-->
+<!--            /* outline: 0; */-->
+<!--            border-color: #eee;-->
+<!--            /* line-height: 2; */-->
+<!--            /* border-width: 1px; */-->
+<!--            border-style: solid;-->
+<!--            background-color: #fff;-->
+<!--            /* color: rgba(0, 0, 0, .85); */-->
+<!--            border-radius: 2px;-->
+<!--            display: block;-->
+<!--            width: 100%;-->
+<!--            /* padding-left: 10px; */-->
+<!--            /* padding-right: 30px; */-->
+<!--            cursor: pointer;-->
+<!--        }-->
+
+<!--        .one {-->
+<!--            padding-left: 25%;-->
+<!--        }-->
+
+<!--        .gis {-->
+<!--            padding-left: 20%;-->
+<!--        }-->
+<!--    </style>-->
+<!--    <link rel="stylesheet" href="./js/layui/css/layui.css">-->
+<!--</head>-->
+
+<!--<body>-->
+<!--<div class="header">-->
+<!--    &lt;!&ndash; 页面数据展示 &ndash;&gt;-->
+<!--</div>-->
+<!--<div class="row">-->
+<!--    <div class="one">-->
+<!--        <form class="layui-form" action="">-->
+<!--            <div class="column" id="guishudi">-->
+<!--                <input type="radio" name="where" value="local" title="归属地" lay-filter="where" checked>-->
+<!--                <input type="radio" name="where" value="roaming" title="拜访地" lay-filter="where">-->
+<!--            </div>-->
+<!--            <div class="column">-->
+<!--                <select name="timeType" id="timeTpye">-->
+<!--                    <option value="">天</option>-->
+<!--                    <option value="7">7天</option>-->
+<!--                    <option value="30" selected>30天</option>-->
+<!--                    <option value="60">60天</option>-->
+<!--                </select>-->
+<!--            </div>-->
+<!--            <div class="column">-->
+<!--                日期范围-->
+<!--                &lt;!&ndash; <div class="layui-inline" id="test6"> &ndash;&gt;-->
+<!--                <div class="layui-input-inline">-->
+<!--                    <input type="text" autocomplete="off" id="startDate" class="layui-input" placeholder="开始日期">-->
+<!--                </div>-->
+<!--                &lt;!&ndash; <div class="layui-form-mid">-</div>- &ndash;&gt;-->
+<!--                &lt;!&ndash; <div class="layui-input-inline">-->
+<!--                        <input type="text" autocomplete="off" id="endDate" class="layui-input" placeholder="结束日期">-->
+<!--                    </div> &ndash;&gt;-->
+<!--                &lt;!&ndash; </div> &ndash;&gt;-->
+<!--            </div>-->
+<!--        </form>-->
+<!--        <div class="column">-->
+<!--            &lt;!&ndash; <button class="layui-btn" lay-submit lay-filter="search">查询</button> &ndash;&gt;-->
+<!--            <button class="layui-btn" onclick="searchGrp()">查询</button>-->
+<!--            &lt;!&ndash; <button type="reset" class="layui-btn layui-btn-primary">重置</button> &ndash;&gt;-->
+<!--        </div>-->
+
+
+
+<!--    </div>-->
+<!--</div>-->
+<!--<div class="row">-->
+<!--    <div class="column left">-->
+<!--        &lt;!&ndash; <form class="layui-form" action="">-->
+<!--            <div class="select">-->
+<!--                <select multiple="multiple" name="city1" class="test">-->
+<!--                    <option value=""></option>-->
+<!--                    <option value="0">北京</option>-->
+<!--                    <option value="1">上海</option>-->
+<!--                    <option value="2">广州</option>-->
+<!--                    <option value="3">深圳</option>-->
+<!--                    <option value="4">杭州</option>-->
+<!--                </select>-->
+<!--            </div>-->
+
+
+<!--        </form> &ndash;&gt;-->
+<!--        <div class="select">-->
+<!--            <select multiple="multiple" name="province" class="test1" id="selectProvince"-->
+<!--                    onchange="provinceSelect()">-->
+<!--                <option value="0">北京</option>-->
+<!--                <option value="1">天津</option>-->
+<!--                <option value="2">河北</option>-->
+<!--                <option value="3">河南</option>-->
+
+<!--            </select>-->
+
+<!--        </div>-->
+
+<!--        <div class="select">-->
+<!--            <select multiple="multiple" name="city" class="test2" id="selectCity">-->
+<!--                <option value="0">石家庄</option>-->
+<!--                <option value="1">唐山</option>-->
+<!--                <option value="2">张家口</option>-->
+<!--                <option value="3">保定</option>-->
+<!--                <option value="4">秦皇岛</option>-->
+<!--                <option value="5">廊坊</option>-->
+<!--            </select>-->
+
+<!--        </div>-->
+
+
+<!--    </div>-->
+<!--    <div class="column middle">-->
+<!--        <div class="layui-form">-->
+<!--            <div class="layui-input-inline" id="cb">-->
+<!--                <input type="radio" name="searchType" lay-filter="cb" title="5G终端用户数" value="5G终端用户数" checked>-->
+<!--                <input type="radio" name="searchType" lay-filter="cb" title="打开5G开关用户数" value="打开5G开关用户数">-->
+<!--                <input type="radio" name="searchType" lay-filter="cb" title="关闭5G开关用户数" value="关闭5G开关用户数">-->
+<!--                <input type="radio" name="searchType" lay-filter="cb" title="5G开关打开率" value="5G开关打开率">-->
+<!--            </div>-->
+<!--        </div>-->
+<!--        <div class="gis">-->
+<!--            <div id="graph" style="width: 600px;height:400px;"></div>-->
+<!--        </div>-->
+<!--    </div>-->
+<!--    <div class="column right">-->
+
+<!--        <button class="layui-btn export" lay-submit lay-filter="export">导出指标</button>-->
+<!--        <br>-->
+<!--        <button class="layui-btn export" lay-submit lay-filter="exportAll">导出全量</button>-->
+<!--        <br>-->
+<!--        <button class="layui-btn export" lay-submit lay-filter="exportClose">导出未开</button>-->
+
+<!--    </div>-->
+<!--</div>-->
+<!--<script src="./js/jquery-3.5.1.min.js"></script>-->
+<!--<script src="./js/layui/layui.js"></script>-->
+<!--<script src="./js/echarts.js"></script>-->
+<!--<script>-->
+<!--        function initGrp() {-->
+<!--            console.log('initgrp')-->
+<!--            $.ajax({-->
+<!--                type: "GET",-->
+<!--                // url: './json/et.json',-->
+<!--                url: './search',-->
+<!--                data: {-->
+<!--                    "from":$('#guishudi').find('input:checked').val(),-->
+<!--                    "range": $('#startDate').val(),-->
+<!--                    // "range": '20210719 - 20210722',-->
+<!--                    "stype": $('#cb').find('input:checked').val(),-->
+<!--                    "ttype": $('#timeTpye').val(),-->
+<!--                    "provinces": '河北',-->
+<!--                    "citys": ''-->
+
+<!--                },-->
+<!--                success: function (r) {-->
+
+<!--                    console.log(r)-->
+<!--                    let o = r instanceof Object-->
+<!--                    if (!o) {-->
+<!--                        r = JSON.parse(r)-->
+<!--                    }-->
+<!--                    option.xAxis.data = r.dt;-->
+<!--                    option.series[0].data = r.num;-->
+<!--                    myChart.setOption(option);-->
+<!--                    return false;-->
+
+<!--                }-->
+
+<!--            });-->
+
+<!--        }-->
+<!--        function searchGrp() {-->
+
+<!--            let provinceSize = $('#selectProvince').find('option:selected').length;-->
+<!--            let cbSize = $("#cb").find('input:checked').length;-->
+
+<!--            if (provinceSize < 1) {-->
+<!--                alert('请选择省市')-->
+<!--                return;-->
+<!--            }-->
+
+<!--            if (cbSize < 1) {-->
+<!--                alert('请选择类型')-->
+<!--                return;-->
+<!--            }-->
+
+<!--            var ps = new Array();-->
+<!--            $('#selectProvince').find('option:selected').each(function (i, t) {-->
+<!--                ps.push($(t).val());-->
+<!--            });-->
+<!--            var cs = new Array();-->
+<!--            $('#selectCity').find('option:selected').each(function (i, t) {-->
+<!--                cs.push($(t).val());-->
+<!--            });-->
+<!--            let provinces = ps.join(',');-->
+<!--            let citys = cs.join(',');-->
+
+<!--            $.ajax({-->
+<!--                type: "GET",-->
+<!--                // url: './json/et.json',-->
+<!--                url: './search',-->
+<!--                data: {-->
+<!--                    "from":$('#guishudi').find('input:checked').val(),-->
+<!--                    "range": $('#startDate').val(),-->
+<!--                    "stype": $('#cb').find('input:checked').val(),-->
+<!--                    "ttype": $('#timeTpye').val(),-->
+<!--                    "provinces": provinces,-->
+<!--                    "citys": citys-->
+
+<!--                },-->
+<!--                success: function (r) {-->
+
+<!--                    console.log(r)-->
+<!--                    let o = r instanceof Object-->
+<!--                    if (!o) {-->
+<!--                        r = JSON.parse(r)-->
+<!--                    }-->
+<!--                    option.xAxis.data = r.dt;-->
+<!--                    option.series[0].data = r.num;-->
+<!--                    myChart.setOption(option);-->
+<!--                    return false;-->
+
+<!--                }-->
+
+<!--            });-->
+
+<!--        }-->
+<!--        function typeExportClose() {-->
+<!--            console.log("exportClose")-->
+<!--            this.location.href = "/exportClose?" + "ttype=" + $('#timeTpye').val() + "&range=" + $('#startDate').val()-->
+<!--        }-->
+<!--        function typeExportAll() {-->
+<!--            console.log("exportAll")-->
+<!--            this.location.href = "/exportAll?" + "ttype=" + $('#timeTpye').val() + "&range=" + $('#startDate').val()-->
+
+<!--        }-->
+
+<!--        function typeExport(guishu) {-->
+<!--            var ps = new Array();-->
+<!--            $('#selectProvince').find('option:selected').each(function (i, t) {-->
+<!--                ps.push($(t).val());-->
+<!--            });-->
+<!--            var cs = new Array();-->
+<!--            $('#selectCity').find('option:selected').each(function (i, t) {-->
+<!--                cs.push($(t).val());-->
+<!--            });-->
+<!--            let provinces = ps.join(',');-->
+<!--            let citys = cs.join(',');-->
+<!--            this.location.href = "/typeExport?" + "from=" + guishu + "&provinces="+provinces+"&citys="+citys+"&ttype=" + $('#timeTpye').val() + "&range=" + $('#startDate').val()-->
+<!--        }-->
+
+<!--        function provinceSelect() {-->
+<!--            console.log("province change")-->
+<!--            let selectSice = $('#selectProvince').find('option:selected').length-->
+<!--            if (selectSice < 1) {-->
+<!--                $('#selectCity').empty();-->
+<!--            } else if (selectSice == 1) {-->
+<!--                $('#selectCity').removeAttr("disabled"); $('#selectProvince').find-->
+<!--                changeProvince($('#guishudi').find('input:checked').val(), $('#selectProvince').find('option:selected')[0].text);-->
+<!--            } else {-->
+<!--                $('#selectCity').attr("disabled", "disabled");-->
+<!--            }-->
+<!--        }-->
+
+<!--        function changeProvince(type, province) {-->
+<!--            console.log('changeprovince')-->
+
+<!--            $.ajax({-->
+<!--                type: "GET",-->
+<!--                // url: './json/citys.json',-->
+<!--                url: './initCitys',-->
+<!--                async: false,-->
+<!--                data: {-->
+<!--                    "type": type,-->
+<!--                    "province": province-->
+<!--                },-->
+<!--                success: function (data) {-->
+<!--                    let o = data instanceof Object-->
+<!--                    console.log(o)-->
+<!--                    if (!o) {-->
+<!--                        data = JSON.parse(data)-->
+<!--                    }-->
+<!--                    $('#selectCity').empty();-->
+<!--                    var html = '';-->
+<!--                    $.each(data, function (commentIndex, comment) {-->
+<!--                        html += '<option value="' + comment + '">' + comment + '</option>';-->
+<!--                        // console.log(commentIndex,comment)-->
+<!--                    });-->
+
+<!--                    $('#selectCity').html(html);-->
+
+<!--                }-->
+<!--            });-->
+<!--        }-->
+
+<!--        function dateFormat(fmt, date, n) {-->
+<!--            if (n == undefined || n == '') {-->
+<!--                n = 0;-->
+<!--            }-->
+<!--            let ret;-->
+<!--            const opt = {-->
+<!--                "Y+": date.getFullYear().toString(), // 年-->
+<!--                "m+": (date.getMonth() + 1).toString(), // 月-->
+<!--                "d+": (date.getDate() + n).toString(), // 日-->
+<!--                "H+": date.getHours().toString(), // 时-->
+<!--                "M+": date.getMinutes().toString(), // 分-->
+<!--                "S+": date.getSeconds().toString() // 秒-->
+<!--                // 有其他格式化字符需求可以继续添加,必须转化成字符串-->
+<!--            };-->
+<!--            for (let k in opt) {-->
+<!--                ret = new RegExp("(" + k + ")").exec(fmt);-->
+<!--                if (ret) {-->
+<!--                    fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))-->
+<!--                };-->
+<!--            };-->
+<!--            return fmt;-->
+<!--        }-->
+
+<!--        // function searct(data) {-->
+
+<!--        // this.location.href="/cmcc/alert/cellAlertDownload"+"?start_time_o="+stime+"&end_time_o="+etime+"&type="+type+"&aType="+aType;-->
+
+<!--        // }-->
+
+<!--        function radioChange(t) {-->
+
+<!--            let type = $('#guishudi').find('input:checked').val();-->
+<!--            // let where = $("input[type='radio']:checked").val();-->
+
+<!--            $.ajax({-->
+<!--                type: "GET",-->
+<!--                // url: './json/' + where + '.json',-->
+<!--                url: './initProvince',-->
+<!--                async: false,-->
+<!--                data: {-->
+<!--                    "type": type-->
+<!--                },-->
+<!--                success: function (data) {-->
+<!--                    let o = data instanceof Object-->
+<!--                    console.log(o)-->
+<!--                    if (!o) {-->
+<!--                        data = JSON.parse(data)-->
+<!--                    }-->
+
+<!--                    // console.log(pc)-->
+<!--                    $('#selectProvince').empty();-->
+<!--                    var html = '';-->
+<!--                    $.each(data, function (commentIndex, comment) {-->
+<!--                        console.log(commentIndex, comment)-->
+<!--                        html += '<option value="' + comment + '">' + comment + '</option>';-->
+<!--                        // console.log(commentIndex,comment)-->
+
+<!--                    });-->
+
+<!--                    $('#selectProvince').html(html);-->
+<!--                    changeProvince($('#guishudi').find('input:checked').val(), $('#selectProvince').find('option')[0].text);-->
+<!--                }-->
+<!--            });-->
+<!--        }-->
+
+<!--        // function preTimeSelect() {-->
+
+<!--        //     $.ajax({-->
+<!--        //         type: "GET",-->
+<!--        //         url: './json/timeSelect.json',-->
+<!--        //         success: function (data) {-->
+
+<!--        //             $('#timeSelect').empty();-->
+<!--        //             var html = '';-->
+<!--        //             $.each(data, function (commentIndex, comment) {-->
+<!--        //                 html += '<option value="' + comment + '">' + comment + '</option>';-->
+<!--        //                 // console.log(commentIndex,comment)-->
+<!--        //             });-->
+
+<!--        //             $('#timeSelect').html(html);-->
+<!--        //             layui.use(['form'], function () {-->
+<!--        //                 var form = layui.form;-->
+
+<!--        //                 form.render('select')-->
+<!--        //             });-->
+
+<!--        //         }-->
+<!--        //     });-->
+<!--        // }-->
+
+<!--        // $('input[type=radio][name=where]').change(function () {-->
+<!--        //     console.log('change')-->
+<!--        //     alert(this.value)-->
+<!--        // })-->
+<!--    </script>-->
+
+<!--<script>-->
+<!--        var myChart = echarts.init(document.getElementById('graph'));-->
+<!--        option = {-->
+<!--            xAxis: {-->
+<!--                type: 'category',-->
+<!--                data: ['20210721', '20210722', '20210723', '20210724', '20210725', '20210726', '20210727']-->
+<!--            },-->
+<!--            yAxis: {-->
+<!--                type: 'value'-->
+<!--            },-->
+<!--            series: [{-->
+<!--                data: [150, 230, 224, 218, 135, 147, 260],-->
+<!--                type: 'line'-->
+<!--            }]-->
+<!--        };-->
+<!--        // myChart.setOption(option);-->
+<!--        layui.use(['layer', 'tree', 'form', 'laydate', 'table'], function () {-->
+<!--            var layer = layui.layer,-->
+<!--                tree = layui.tree,-->
+<!--                form = layui.form,-->
+<!--                table = layui.table,-->
+<!--                laydate = layui.laydate;-->
+<!--            let date = new Date();-->
+<!--            let date1 = dateFormat('YYYYmmdd', date, -7);-->
+<!--            let date2 = dateFormat('YYYYmmdd', date);-->
+<!--            let dateValue = date1 + ' - ' + date2;-->
+<!--            // console.log(dateValue)-->
+<!--            laydate.render({-->
+<!--                elem: '#startDate',-->
+<!--                type: 'date',-->
+<!--                format: 'yyyyMMdd',-->
+<!--                value: dateValue,-->
+<!--                isInitValue: true,-->
+<!--                range: '-',-->
+<!--                // range: ['#startDate', '#endDate']-->
+<!--            });-->
+
+
+<!--            form.render('select')-->
+<!--            form.on("radio(cb)", function (data) {-->
+<!--                // let stype = $('#cb').find('input:checked').val()-->
+<!--                // if (stype == '5G开关打开率') {-->
+<!--                //     $('.export').attr("disabled", "disabled");-->
+<!--                //     $(".export").addClass("layui-btn-disabled")-->
+
+<!--                // } else {-->
+<!--                //     $('.export').removeAttr("disabled");-->
+<!--                //     $(".export").removeClass("layui-btn-disabled")-->
+<!--                // }-->
+
+<!--            });-->
+<!--            //监听提交-->
+<!--            form.on("radio(where)", function (data) {-->
+<!--                radioChange(data.value);-->
+
+<!--            });-->
+<!--            // form.on('submit(search)', function (data) {-->
+<!--            //     // console.log(data.field);-->
+<!--            //     // let where = data.field.where;-->
+<!--            //     // let timeType = data.field.Type;-->
+<!--            //     let provinceSize = $('#selectProvince').find('option:selected').length;-->
+<!--            //     let cbSize = $("#cb").find('input:checked').length;-->
+<!--            //     console.log(cbSize);-->
+<!--            //     // console.log(provinceSize)-->
+<!--            //     if (provinceSize < 1) {-->
+<!--            //         alert('请选择省市')-->
+<!--            //         return false;-->
+<!--            //     }-->
+
+<!--            //     if (cbSize < 1) {-->
+<!--            //         alert('请选择类型')-->
+<!--            //         return false;-->
+<!--            //     }-->
+
+<!--            //     var ps = new Array();-->
+<!--            //     $('#selectProvince').find('option:selected').each(function (i, t) {-->
+<!--            //         ps.push($(t).val());-->
+<!--            //     });-->
+<!--            //     var cs = new Array();-->
+<!--            //     $('#selectCity').find('option:selected').each(function (i, t) {-->
+<!--            //         cs.push($(t).val());-->
+<!--            //     });-->
+<!--            //     let provinces = ps.join(',');-->
+<!--            //     let citys = cs.join(',');-->
+
+<!--            //     $.ajax({-->
+<!--            //         type: "GET",-->
+<!--            //         // url: './json/' + where + '.json',-->
+<!--            //         url: './typeExport',-->
+<!--            //         data: {-->
+<!--            //             "range": $('#startDate').val(),-->
+<!--            //             "stype": stype,-->
+<!--            //             "ttype": $('#timeTpye').val(),-->
+<!--            //             "provinces": provinces,-->
+<!--            //             "citys": citys-->
+
+<!--            //         },-->
+<!--            //         success: function (data) {-->
+<!--            //             let o = data instanceof Object-->
+<!--            //             if (!o) {-->
+<!--            //                 data = JSON.parse(data)-->
+<!--            //             }-->
+<!--            //             option.data = data.dt;-->
+<!--            //             option.series[0].data = date.num;-->
+<!--            //             myChart.setOption(option);-->
+
+<!--            //         }-->
+<!--            //     });-->
+<!--            //     // searchGrp()-->
+<!--            //     // layer.msg(JSON.stringify(data));-->
+<!--            //     return false;-->
+<!--            // });-->
+
+
+<!--            form.on('submit(export)', function () {-->
+<!--                let guishu = $('#guishudi').find('input:checked').val()-->
+<!--                typeExport(guishu)-->
+
+<!--            });-->
+<!--            form.on('submit(exportAll)', function () {-->
+<!--                // let stype=$('#cb').find('input:checked').val()-->
+<!--                typeExportAll()-->
+<!--            });-->
+<!--            form.on('submit(exportClose)', function () {-->
+<!--                // let stype=$('#cb').find('input:checked').val()-->
+<!--                typeExportClose()-->
+<!--            });-->
+
+<!--        });-->
+<!--    </script>-->
+<!--<script>-->
+<!--        $(function () {-->
+
+<!--            radioChange();-->
+<!--            changeProvince($('#guishudi').find('input:checked').val(), $('#selectProvince').find('option')[0].text);-->
+<!--            initGrp()-->
+<!--        })-->
+<!--    </script>-->
+
+<!--</body>-->
+
 <!--</html>-->

BIN
说明文档.docx