From 48a92aefa3010fbe8f92170932df2ffd5204bd8b Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Thu, 18 Apr 2024 15:22:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/CoalWashingDailyAnalysisDto.java | 14 +++++--------- .../entity/CoalWashingDailyAnalysisEntity.java | 11 ----------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisDto.java b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisDto.java index c1533b63..e2aa0205 100644 --- a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisDto.java +++ b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/dto/CoalWashingDailyAnalysisDto.java @@ -4,6 +4,8 @@ import cn.lihongjie.coal.base.dto.OrgCommonDto; import cn.lihongjie.coal.coalWashingDailyAnalysis.entity.CoalWashingDailyAnalysisItemVo; import cn.lihongjie.coal.coalWashingDailyAnalysis.entity.CoalWashingDailyAnalysisKFItemVo; import cn.lihongjie.coal.coalWashingDailyAnalysis.entity.CoalWashingDailyAnalysisParamVo; +import cn.lihongjie.coal.common.DictCode; +import cn.lihongjie.coal.pojoProcessor.DictTranslate; import jakarta.persistence.CollectionTable; import jakarta.persistence.ConstraintMode; @@ -13,7 +15,6 @@ import jakarta.persistence.ForeignKey; import lombok.Data; import org.hibernate.annotations.Comment; -import org.hibernate.annotations.Formula; import java.time.LocalDate; import java.util.List; @@ -28,16 +29,11 @@ public class CoalWashingDailyAnalysisDto extends OrgCommonDto { @Comment("归档状态") private String archiveStatus; - - @Formula( - "(select i.name\n" - + "from t_dictionary d,\n" - + " t_dictionary_item i\n" - + "where d.id = i.dictionary_id\n" - + " and d.code = 'archiveStatus'\n" - + " and i.code = archive_status)") + @DictTranslate(dictKey = DictCode.ARCHIVESTATUS) private String archiveStatusName; + + @ElementCollection @CollectionTable(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) private List inputItems; diff --git a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/entity/CoalWashingDailyAnalysisEntity.java b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/entity/CoalWashingDailyAnalysisEntity.java index 44ae1d41..0dcf31eb 100644 --- a/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/entity/CoalWashingDailyAnalysisEntity.java +++ b/src/main/java/cn/lihongjie/coal/coalWashingDailyAnalysis/entity/CoalWashingDailyAnalysisEntity.java @@ -12,9 +12,7 @@ import lombok.Data; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.Comment; -import org.hibernate.annotations.Formula; import java.time.LocalDate; import java.time.LocalTime; @@ -31,15 +29,6 @@ public class CoalWashingDailyAnalysisEntity extends OrgCommonEntity { @Comment("归档状态") private String archiveStatus = "0"; - @Formula( - "(select i.name\n" - + "from t_dictionary d,\n" - + " t_dictionary_item i\n" - + "where d.id = i.dictionary_id\n" - + " and d.code = 'archiveStatus'\n" - + " and i.code = archive_status)") - @ColumnDefault("'0'") - private String archiveStatusName; @Comment("日期") private LocalDate date;