提交 48a8a2db 编写于 作者: Z zyyang

change

上级 a91d886b
......@@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class SqlSpeller {
......@@ -64,10 +65,18 @@ public class SqlSpeller {
//f1, f2, f3
private static String fieldValues(List<FieldValue> fields) {
return fields.stream()
.filter(Objects::nonNull)
.map(fieldValue -> "'" + fieldValue.getValue() + "'")
.collect(Collectors.joining(",", "(", ")"));
return IntStream.range(0, fields.size()).mapToObj(i -> {
if (i == 0) {
return "" + fields.get(i).getName() + "";
} else {
return "'" + fields.get(i).getValue() + "'";
}
}).collect(Collectors.joining(",", "(", ")"));
// return fields.stream()
// .filter(Objects::nonNull)
// .map(fieldValue -> "'" + fieldValue.getValue() + "'")
// .collect(Collectors.joining(",", "(", ")"));
}
//(f1, f2, f3),(f1, f2, f3)
......
......@@ -17,9 +17,6 @@ public class TimeStampUtilTest {
@Test
public void longToDatetime() {
System.out.println(TimeStampUtil.longToDatetime(1293244920052l));
String datetime = TimeStampUtil.longToDatetime(1510000000000L);
assertEquals("2017-11-07 04:26:40.000", datetime);
long timestamp = TimeStampUtil.datetimeToLong(datetime);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册