|
@@ -54,69 +54,65 @@ public class DbUtil {
|
|
|
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];
|
|
|
- condition = condition.replace(",", "','");
|
|
|
- log.debug("condition: {}", condition);
|
|
|
- // eci
|
|
|
- String sql = "select a.cellname,a.city,a.quxian,a.vendor,b.*"
|
|
|
- + " from (select eci, cellname, city, quxian, vendor"
|
|
|
- + " from pm_parse.per_cfg_cell"
|
|
|
- + " where eci in (" + condition + ")) a"
|
|
|
- + " inner join (select " + indicators + " from pm_parse.pm_4g_" + ttype
|
|
|
- + " where sdate >= '" + startTime
|
|
|
- + "' and sdate <= '" + endTime + "') b"
|
|
|
- + " 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"
|
|
|
- + " inner join (select " + indicators + " from pm_parse.pm_4g_" + ttype
|
|
|
- + " where sdate >= '" + startTime
|
|
|
- + "' and sdate <= '" + endTime + "') b"
|
|
|
- + " on a.eci = b.eci";
|
|
|
- }
|
|
|
-
|
|
|
- log.debug("sql: {}", sql);
|
|
|
- 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 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];
|
|
|
+// condition = condition.replace(",", "','");
|
|
|
+// log.debug("condition: {}", condition);
|
|
|
+// // eci
|
|
|
+// String sql = "select a.cellname,a.city,a.quxian,a.vendor,b.*"
|
|
|
+// + " from (select eci, cellname, city, quxian, vendor"
|
|
|
+// + " from pm_parse.per_cfg_cell"
|
|
|
+// + " where eci in (" + condition + ")) a"
|
|
|
+// + " inner join (select " + indicators + " from pm_parse.pm_4g_" + ttype
|
|
|
+// + " where sdate >= '" + startTime
|
|
|
+// + "' and sdate <= '" + endTime + "') b"
|
|
|
+// + " 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"
|
|
|
+// + " inner join (select " + indicators + " from pm_parse.pm_4g_" + ttype
|
|
|
+// + " where sdate >= '" + startTime
|
|
|
+// + "' and sdate <= '" + endTime + "') b"
|
|
|
+// + " on a.eci = b.eci";
|
|
|
+// }
|
|
|
+//
|
|
|
+// log.debug("sql: {}", sql);
|
|
|
+// 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, 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 condition, String searchType, HttpSession session) {
|
|
|
+ Map<String, String> ezMap = initZnEnMap();
|
|
|
// 获取城市数组
|
|
|
String[] cityArray = StringUtils.delete(citys, "'").split(",");
|
|
|
// 获取拥有的城市权限
|
|
@@ -134,12 +130,27 @@ public class DbUtil {
|
|
|
String[] timeArray = sdate.split(" - ");
|
|
|
String startTime = timeArray[0];
|
|
|
String endTime = timeArray[1];
|
|
|
-
|
|
|
- String sql = "select b.* from (select eci from pm_parse.per_cfg_cell where quxian in (" + quxians + ")) a"
|
|
|
+ String sql = "select a.cellname, a.city, a.quxian, a.vendor, b.*"
|
|
|
+ + " from (select eci, cellname, city, quxian, vendor from pm_parse.per_cfg_cell"
|
|
|
+ + " where quxian in (" + quxians + ")) a"
|
|
|
+ " inner join (select " + indicators + " from pm_parse.pm_4g_" + ttype
|
|
|
+ " where sdate >= '" + startTime
|
|
|
+ "' and sdate <= '" + endTime + "') b"
|
|
|
+ " on a.eci = b.eci";
|
|
|
+ // eci
|
|
|
+ if ("eci".equals(searchType)) {
|
|
|
+ condition = "'" + condition.replace(",", "','") + "'";
|
|
|
+ log.debug("condition: {}", condition);
|
|
|
+ sql = "select a.cellname,a.city,a.quxian,a.vendor,b.*"
|
|
|
+ + " from (select eci, cellname, city, quxian, vendor"
|
|
|
+ + " from pm_parse.per_cfg_cell"
|
|
|
+ + " where eci in (" + condition + ")) a"
|
|
|
+ + " inner join (select " + indicators + " from pm_parse.pm_4g_" + ttype
|
|
|
+ + " where sdate >= '" + startTime
|
|
|
+ + "' and sdate <= '" + endTime + "') b"
|
|
|
+ + " on a.eci = b.eci";
|
|
|
+ }
|
|
|
+
|
|
|
log.debug("sql: {}", sql);
|
|
|
List<Map<String, String>> datas = new ArrayList<>();
|
|
|
List<Col> cols = new ArrayList<>();
|
|
@@ -154,7 +165,7 @@ public class DbUtil {
|
|
|
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
|
|
|
String columnName = rsmd.getColumnName(i);
|
|
|
heads.add(columnName);
|
|
|
- cols.add(new Col(columnName, columnName));
|
|
|
+ cols.add(new Col(columnName, ezMap.get(columnName)));
|
|
|
}
|
|
|
while (rs.next()) {
|
|
|
Map<String, String> m = new HashMap<>();
|