mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
优化
This commit is contained in:
@@ -2,14 +2,15 @@ package cn.lihongjie.coal.acDevice.dto;
|
||||
|
||||
import cn.lihongjie.coal.acDeviceSupplier.dto.AcDeviceSupplierDto;
|
||||
import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.common.DictCode;
|
||||
import cn.lihongjie.coal.dataCollector.dto.DataCollectorDto;
|
||||
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
|
||||
|
||||
import jakarta.persistence.ManyToOne;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Formula;
|
||||
|
||||
@Data
|
||||
public class AcDeviceDto extends OrgCommonDto {
|
||||
@@ -23,13 +24,7 @@ public class AcDeviceDto extends OrgCommonDto {
|
||||
@Comment("设备类型")
|
||||
private String deviceType;
|
||||
|
||||
@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 = 'ac.device.type'\n"
|
||||
+ " and i.code = device_type)")
|
||||
@DictTranslate(dictKey = DictCode.AC_DEVICE_TYPE)
|
||||
private String deviceTypeName;
|
||||
|
||||
private String location;
|
||||
@@ -37,5 +32,6 @@ public class AcDeviceDto extends OrgCommonDto {
|
||||
|
||||
private String archiveStatus;
|
||||
|
||||
@DictTranslate(dictKey = DictCode.ARCHIVESTATUS)
|
||||
private String archiveStatusName;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Formula;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@@ -25,26 +24,12 @@ public class AcDeviceEntity extends OrgCommonEntity {
|
||||
@Comment("设备类型")
|
||||
private String deviceType;
|
||||
|
||||
@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 = 'ac.device.type'\n"
|
||||
+ " and i.code = device_type)")
|
||||
private String deviceTypeName;
|
||||
|
||||
|
||||
private String location;
|
||||
@Comment("归档状态")
|
||||
@ColumnDefault("'0'")
|
||||
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)")
|
||||
private String archiveStatusName;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user