diff --git a/src/main/java/cn/lihongjie/coal/coalBlend/dto/CoalBlendDto.java b/src/main/java/cn/lihongjie/coal/coalBlend/dto/CoalBlendDto.java index 020c09f0..bc360472 100644 --- a/src/main/java/cn/lihongjie/coal/coalBlend/dto/CoalBlendDto.java +++ b/src/main/java/cn/lihongjie/coal/coalBlend/dto/CoalBlendDto.java @@ -3,6 +3,8 @@ package cn.lihongjie.coal.coalBlend.dto; import cn.lihongjie.coal.base.dto.OrgCommonDto; import cn.lihongjie.coal.coalBlend.entity.CoalBlendConstrainVo; import cn.lihongjie.coal.coalBlend.entity.CoalParameterDefVo; +import cn.lihongjie.coal.common.DictCode; +import cn.lihongjie.coal.pojoProcessor.DictTranslate; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; @@ -11,7 +13,6 @@ import jakarta.validation.constraints.Size; import lombok.Data; import org.hibernate.annotations.Comment; -import org.hibernate.annotations.Formula; import java.util.List; @@ -31,19 +32,14 @@ public class CoalBlendDto extends OrgCommonDto { private List results; + @DictTranslate(dictKey = DictCode.COAL_BLENDTYPE) private String blendTypeName; private String blendType; @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 = 'coalBlend.coalType'\n" - + " and i.code = coal_type)") + @DictTranslate(dictKey = DictCode.COALBLEND_COALTYPE) private String coalTypeName; diff --git a/src/main/java/cn/lihongjie/coal/coalBlend/entity/CoalBlendEntity.java b/src/main/java/cn/lihongjie/coal/coalBlend/entity/CoalBlendEntity.java index b4058c6e..5719d113 100644 --- a/src/main/java/cn/lihongjie/coal/coalBlend/entity/CoalBlendEntity.java +++ b/src/main/java/cn/lihongjie/coal/coalBlend/entity/CoalBlendEntity.java @@ -18,7 +18,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.hibernate.annotations.Comment; -import org.hibernate.annotations.Formula; import org.springframework.util.StopWatch; import java.math.BigDecimal; @@ -53,26 +52,12 @@ public class CoalBlendEntity 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 = 'coalBlend.coalType'\n" - + " and i.code = coal_type)") - private String coalTypeName; + @Comment("配煤类型") private String blendType; - @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.blendType'\n" - + " and i.code = blend_type)") - private String blendTypeName; + @Comment("结果个数") private Integer count = 20;