This commit is contained in:
2024-04-20 14:41:58 +08:00
parent 701b706f12
commit 495a360c52
2 changed files with 19 additions and 1 deletions

View File

@@ -761,7 +761,17 @@ public class CommonQuery {
return new ArrayList<>();
}
return orders.stream().map(x -> new Sort.Order(x.direction, x.property)).toList();
return orders.stream()
.map(
x ->
new Sort.Order(x.direction, x.property)
.with(
Sort.NullHandling.valueOf(
StringUtils.defaultIfBlank(
x.nullHandling,
Sort.NullHandling.NULLS_LAST
.name()))))
.toList();
}
public Specification specification(ConversionService conversionService) {
@@ -1111,6 +1121,7 @@ public class CommonQuery {
private final Sort.Direction direction;
private final String property;
private final String nullHandling;
}
@Data

View File

@@ -3,6 +3,7 @@ package cn.lihongjie.coal.weightDeviceData.entity;
import cn.lihongjie.coal.base.entity.OrgCommonEntity;
import cn.lihongjie.coal.weightDevice.entity.WeightDeviceEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
@@ -460,4 +461,10 @@ public class WeightDeviceDataEntity extends OrgCommonEntity {
private String archiveStatus = "0";
@Comment("最小时间, 用于排序")
@Column(insertable = false, updatable = false, columnDefinition = " timestamp(6) generated always as ( least(mz_time, pz_time, ycgbtime, ecgb_time) ) stored ")
private LocalDateTime minTime;
}