|
@@ -201,12 +201,9 @@ public class BatteryServiceImpl extends ServiceImpl<BatteryMapper, Battery> impl
|
|
|
//周均能耗 能耗排名
|
|
|
try {
|
|
|
conn = PhoenixUtils.getConnection();
|
|
|
- psSelect = conn.prepareStatement(" use " + database + " ");
|
|
|
- psSelect.setFetchSize(1000);
|
|
|
- psSelect.close();
|
|
|
- String sql = "select energy,eg_rank from " + energyTable + " where sn ='" + vo.getSn() + "' order by id desc limit 1";
|
|
|
- psSelect = conn.prepareStatement(sql);
|
|
|
- ResultSet resultSet = psSelect.executeQuery();
|
|
|
+ String sql = "select energy,eg_rank from " + database+"."+energyTable + " where sn ='" + vo.getSn() + "' order by id desc limit 1";
|
|
|
+ Statement sta = conn.createStatement();
|
|
|
+ ResultSet resultSet = sta.executeQuery(sql);
|
|
|
|
|
|
List<Map<String, Object>> mapList = ResultSetToJson.toListMap(resultSet, false);
|
|
|
if (mapList.size() > 0) {
|
|
@@ -324,12 +321,9 @@ public class BatteryServiceImpl extends ServiceImpl<BatteryMapper, Battery> impl
|
|
|
//周均能耗 能耗排名
|
|
|
try {
|
|
|
conn = PhoenixUtils.getConnection();
|
|
|
- psSelect = conn.prepareStatement(" use " + database + " ");
|
|
|
- psSelect.setFetchSize(1000);
|
|
|
- psSelect.close();
|
|
|
- String sql = "select energy,eg_rank from " + energyTable + " where sn ='" + vo.getSn() + "' order by id desc limit 1";
|
|
|
- psSelect = conn.prepareStatement(sql);
|
|
|
- ResultSet resultSet = psSelect.executeQuery();
|
|
|
+ String sql = "select energy,eg_rank from " + database+"."+energyTable + " where sn ='" + vo.getSn() + "' order by id desc limit 1";
|
|
|
+ Statement sta = conn.createStatement();
|
|
|
+ ResultSet resultSet = sta.executeQuery(sql);
|
|
|
|
|
|
List<Map<String, Object>> mapList = ResultSetToJson.toListMap(resultSet, false);
|
|
|
if (mapList.size() > 0) {
|
|
@@ -2346,7 +2340,7 @@ public class BatteryServiceImpl extends ServiceImpl<BatteryMapper, Battery> impl
|
|
|
|
|
|
// CellMaxVol,CellMinVol,CellMaxTemp,CellMinTemp,BmsCellVoltDiff,VehSpd
|
|
|
builder.append("select SN,Time,PackVoltage,PackCrnt,PackSoc,CellVoltage,CellTemp,InsulationRss,Info from ")
|
|
|
- .append(tableName).append(" where ");
|
|
|
+ .append(database+"."+tableName).append(" where ");
|
|
|
|
|
|
|
|
|
if (param.getStartTime() == null && param.getEndTime() == null) {
|
|
@@ -2378,12 +2372,8 @@ public class BatteryServiceImpl extends ServiceImpl<BatteryMapper, Battery> impl
|
|
|
PreparedStatement psSelect = null;
|
|
|
try {
|
|
|
conn = PhoenixUtils.getConnection();
|
|
|
- psSelect = conn.prepareStatement(" use " + database + " ");
|
|
|
- psSelect.setFetchSize(1000);
|
|
|
- psSelect.execute();
|
|
|
- psSelect.close();
|
|
|
- psSelect = conn.prepareStatement(builder.toString());
|
|
|
- ResultSet resultSet = psSelect.executeQuery();
|
|
|
+ Statement sta = conn.createStatement();
|
|
|
+ ResultSet resultSet = sta.executeQuery(builder.toString());
|
|
|
flinkDataList = convertList(resultSet);
|
|
|
} catch (Exception e) {
|
|
|
} finally {
|
|
@@ -3751,18 +3741,13 @@ public class BatteryServiceImpl extends ServiceImpl<BatteryMapper, Battery> impl
|
|
|
String snKeyMin = snKey + "0";
|
|
|
String snKeyMax = snKey + "a";
|
|
|
|
|
|
- builder.append("select * from ").append(behaviorTable)
|
|
|
+ builder.append("select * from ").append(database+"."+behaviorTable)
|
|
|
.append(" where id >= '").append(snKeyMin)
|
|
|
.append("' and id <= '").append(snKeyMax).append("' order by id");
|
|
|
|
|
|
conn = PhoenixUtils.getConnection();
|
|
|
- psSelect = conn.prepareStatement(" use " + database + " ");
|
|
|
- psSelect.setFetchSize(1000);
|
|
|
- psSelect.execute();
|
|
|
- psSelect.close();
|
|
|
- psSelect = conn.prepareStatement(builder.toString());
|
|
|
- ResultSet resultSet = psSelect.executeQuery();
|
|
|
-
|
|
|
+ Statement sta = conn.createStatement();
|
|
|
+ ResultSet resultSet = sta.executeQuery(builder.toString());
|
|
|
carPowerVoList = convertCarPowerVoList(resultSet);
|
|
|
} catch (Exception e) {
|
|
|
} finally {
|