This commit is contained in:
2024-04-18 16:14:33 +08:00
parent a7aed30ea7
commit 8ec3c40b6a
2 changed files with 4 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
package cn.lihongjie.coal.meter.dto;
import cn.lihongjie.coal.base.dto.OrgCommonDto;
import cn.lihongjie.coal.common.DictCode;
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
import lombok.Data;
@@ -12,6 +14,7 @@ public class MeterDto extends OrgCommonDto {
private String type;
@Comment("初始值")
private Double initValue;
@DictTranslate(dictKey = DictCode.METER_TYPE)
private String typeName;
@Comment("安装位置")

View File

@@ -7,7 +7,6 @@ import jakarta.persistence.Entity;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;
@Data
@Entity
@@ -19,14 +18,7 @@ public class MeterEntity extends OrgCommonEntity {
@Comment("初始值")
private Double initValue;
@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 = 'meter.type'\n"
+ " and i.code = type)")
private String typeName;
@Comment("安装位置")
private String location;