|
@@ -201,10 +201,10 @@ 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 " + database + "." + energyTable + " where sn ='" + vo.getSn() + "' order by id desc limit 1";
|
|
|
+ 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();
|
|
|
|
|
@@ -324,10 +324,10 @@ public class BatteryServiceImpl extends ServiceImpl<BatteryMapper, Battery> impl
|
|
|
//周均能耗 能耗排名
|
|
|
try {
|
|
|
conn = PhoenixUtils.getConnection();
|
|
|
- /*psSelect = conn.prepareStatement(" use " + database + " ");
|
|
|
+ psSelect = conn.prepareStatement(" use " + database + " ");
|
|
|
psSelect.setFetchSize(1000);
|
|
|
- psSelect.close();*/
|
|
|
- String sql = "select energy,eg_rank from " + database + "." + energyTable + " where sn ='" + vo.getSn() + "' order by id desc limit 1";
|
|
|
+ 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();
|
|
|
|
|
@@ -2378,10 +2378,10 @@ 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(" use " + database + " ");
|
|
|
+ psSelect.setFetchSize(1000);
|
|
|
+ psSelect.execute();
|
|
|
+ psSelect.close();
|
|
|
psSelect = conn.prepareStatement(builder.toString());
|
|
|
ResultSet resultSet = psSelect.executeQuery();
|
|
|
flinkDataList = convertList(resultSet);
|