|
@@ -2,8 +2,10 @@ package com.hz;
|
|
|
|
|
|
import com.hz.business.util.LindormUtil;
|
|
|
import com.hz.business.util.PhoenixUtils;
|
|
|
+import com.hz.common.utils.ResultSetToJson;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.sql.Connection;
|
|
|
import java.sql.ResultSet;
|
|
@@ -11,6 +13,8 @@ import java.sql.Statement;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
|
public class TestLindorm {
|
|
@@ -25,11 +29,11 @@ public class TestLindorm {
|
|
|
try {
|
|
|
Connection conn = PhoenixUtils.getConnection();
|
|
|
Statement sta = conn.createStatement();
|
|
|
- String sql = "select Time,CellVoltage,Info from vehicle_analysis.ods_signal_base where SnKey<='1959277593_09SPE010DM0111C5S0000174_9223370353984375807' and SnKey>='1959277593_09SPE010DM0111C5S0000174_9223370351305976807' order by SnKey desc limit 10000";
|
|
|
- ResultSet rs = sta.executeQuery(sql.toUpperCase());
|
|
|
- while (rs.next()) {
|
|
|
- System.out.println(rs.getString("SN"));
|
|
|
- System.out.println(rs.getString("TIME"));
|
|
|
+ String sql = "select Time,Info,PackVoltage from vehicle_analysis.ods_signal_base where SnKey<='2016423021_04QPE1201H951JC950000025_9223370351305975807' and SnKey>='2016423021_04QPE1201H951JC950000025_9223370351046776807' order by SnKey desc limit 10000 ";
|
|
|
+ ResultSet rs = sta.executeQuery(sql);
|
|
|
+ List<Map<String, Object>> mapList = ResultSetToJson.toListMap(rs, false);
|
|
|
+ if (!CollectionUtils.isEmpty(mapList)) {
|
|
|
+ System.out.println(rs.getString("PackVoltage"));
|
|
|
}
|
|
|
conn.close();
|
|
|
sta.close();
|