From 895d5d24f80fb6985e3bbc1a45ab3d0ea560d031 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Thu, 18 Apr 2024 15:20:07 +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 --- .../coal/coalParameterDef/dto/CoalParameterDefDto.java | 3 +++ .../entity/CoalParameterDefEntity.java | 10 +--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/coalParameterDef/dto/CoalParameterDefDto.java b/src/main/java/cn/lihongjie/coal/coalParameterDef/dto/CoalParameterDefDto.java index 76cdfa0a..0743edea 100644 --- a/src/main/java/cn/lihongjie/coal/coalParameterDef/dto/CoalParameterDefDto.java +++ b/src/main/java/cn/lihongjie/coal/coalParameterDef/dto/CoalParameterDefDto.java @@ -1,6 +1,8 @@ package cn.lihongjie.coal.coalParameterDef.dto; import cn.lihongjie.coal.base.dto.OrgCommonDto; +import cn.lihongjie.coal.common.DictCode; +import cn.lihongjie.coal.pojoProcessor.DictTranslate; import lombok.Data; @@ -15,6 +17,7 @@ public class CoalParameterDefDto extends OrgCommonDto { @Comment("类型 0 手动输入 1 自动计算") private String inputType; + @DictTranslate(dictKey = DictCode.COALPARAMETER_INPUTTYPE) private String inputTypeName; @Comment("计算公式") diff --git a/src/main/java/cn/lihongjie/coal/coalParameterDef/entity/CoalParameterDefEntity.java b/src/main/java/cn/lihongjie/coal/coalParameterDef/entity/CoalParameterDefEntity.java index 0be33620..ccdeb028 100644 --- a/src/main/java/cn/lihongjie/coal/coalParameterDef/entity/CoalParameterDefEntity.java +++ b/src/main/java/cn/lihongjie/coal/coalParameterDef/entity/CoalParameterDefEntity.java @@ -7,7 +7,6 @@ import jakarta.persistence.Entity; import lombok.Data; import org.hibernate.annotations.Comment; -import org.hibernate.annotations.Formula; @Entity @Data @@ -19,14 +18,7 @@ public class CoalParameterDefEntity extends OrgCommonEntity { @Comment("类型 0 手动输入 1 自动计算") private String inputType; - @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 = 'coalParameter.inputType'\n" - + " and i.code = input_type)") - private String inputTypeName; + @Comment("计算公式") private String formula;