From 0669cf83eb300c82aa2236e3a54d1da50688c820 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Thu, 18 Apr 2024 15:18:43 +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 --- .../cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java | 3 +++ .../lihongjie/coal/coalInfo/entity/CoalInfoEntity.java | 10 +--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java b/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java index 0714b467..83e7fdcd 100644 --- a/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java +++ b/src/main/java/cn/lihongjie/coal/coalInfo/dto/CoalInfoDto.java @@ -1,6 +1,8 @@ package cn.lihongjie.coal.coalInfo.dto; import cn.lihongjie.coal.base.dto.OrgCommonDto; +import cn.lihongjie.coal.common.DictCode; +import cn.lihongjie.coal.pojoProcessor.DictTranslate; import lombok.Data; @@ -14,6 +16,7 @@ public class CoalInfoDto extends OrgCommonDto { private String supplierName; + @DictTranslate(dictKey = DictCode.COAL_TYPE) private String coalTypeName; private String coalType; diff --git a/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java b/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java index 9565b063..f55cdd9e 100644 --- a/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java +++ b/src/main/java/cn/lihongjie/coal/coalInfo/entity/CoalInfoEntity.java @@ -9,7 +9,6 @@ import jakarta.persistence.ManyToOne; import lombok.Data; import org.hibernate.annotations.Comment; -import org.hibernate.annotations.Formula; @Data @Entity @@ -22,14 +21,7 @@ public class CoalInfoEntity extends OrgCommonEntity { @Comment("煤源类型") private String coalType; - @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 = 'coal.type'\n" - + " and i.code = coal_type)") - private String coalTypeName; + @Comment("初始报价") private Double initPrice;