Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ private static void buildDelete(QueryWrapper<?> wrapper, boolean camelToUndersco
private static void buildSort(
String sortField, String sortValue, QueryWrapper<?> wrapper, boolean camelToUnderscore) {
if (sortField != null && sortValue != null) {
// 过滤无效的排序字段
if ("undefined".equalsIgnoreCase(sortField) || "null".equalsIgnoreCase(sortField) || sortField.trim().isEmpty()) {
return;
}
if (camelToUnderscore) {
sortField = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortField);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ public String convertToDB(ColumnType columnType) {
return "varchar";
}
switch (columnType.getValue()) {
case DECIMAL:
case DECIMAL:
if (columnType.getLogicalType() instanceof org.dinky.data.types.DecimalType) {
org.dinky.data.types.DecimalType decimalType =
(org.dinky.data.types.DecimalType) columnType.getLogicalType();
return String.format("decimal(%d,%d)", decimalType.getPrecision(), decimalType.getScale());
}
return "decimal";
case BIGINT:
return "bigint";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public String convertToDB(ColumnType columnType) {
}
switch (columnType.getValue()) {
case DECIMAL:
if (columnType.getLogicalType() instanceof org.dinky.data.types.DecimalType) {
org.dinky.data.types.DecimalType decimalType =
(org.dinky.data.types.DecimalType) columnType.getLogicalType();
return String.format("decimal(%d,%d)", decimalType.getPrecision(), decimalType.getScale());
}
return "decimal";
case BIGINT:
return "bigint";
Expand Down
Loading