Browse Source

字典值转换

zdm 6 years ago
parent
commit
dd8c76fc4e

+ 13 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/model/facility/Facility.java

@ -2,6 +2,7 @@ package com.yihu.jw.healthyhouse.model.facility;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import org.hibernate.annotations.Formula;
import javax.persistence.*;
import java.util.List;
@ -83,6 +84,7 @@ public class Facility extends UuidIdentityEntityWithOperator {
    private String imgPath;
    private String statusName;
    private String  categoryValue ;
    private List<FacilityServerRelation> facilityServerRelation;
    public String getCode() {
@ -261,7 +263,8 @@ public class Facility extends UuidIdentityEntityWithOperator {
        this.userName = userName;
    }
    @Transient
    @Formula("( SELECT a.value FROM system_dict_entries a WHERE a.dict_id = 5 AND a.code = status )")
    public String getStatusName() {
        return statusName;
    }
@ -277,4 +280,13 @@ public class Facility extends UuidIdentityEntityWithOperator {
    public void setFacilityServerRelation(List<FacilityServerRelation> facilityServerRelation) {
        this.facilityServerRelation = facilityServerRelation;
    }
    @Formula("( SELECT a.value FROM system_dict_entries a WHERE a.dict_id = 3 AND a.code = category )")
    public String getCategoryValue() {
        return categoryValue;
    }
    public void setCategoryValue(String categoryValue) {
        this.categoryValue = categoryValue;
    }
}

+ 11 - 0
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/model/facility/FacilityServer.java

@ -2,6 +2,7 @@ package com.yihu.jw.healthyhouse.model.facility;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import org.hibernate.annotations.Formula;
import javax.persistence.*;
@ -26,6 +27,8 @@ public class FacilityServer extends UuidIdentityEntityWithOperator {
    //设施服务提供量:多少设施提供此服务
    @Column(name = "num")
    private String num;
    //设施类型字典值
    private String typeValue ;
    public String getCode() {
        return code;
@ -58,4 +61,12 @@ public class FacilityServer extends UuidIdentityEntityWithOperator {
    public void setNum(String num) {
        this.num = num;
    }
    @Formula("( SELECT a.value FROM system_dict_entries a WHERE a.dict_id = 7 AND a.code = type )")
    public String getTypeValue() {
        return typeValue;
    }
    public void setTypeValue(String typeValue) {
        this.typeValue = typeValue;
    }
}

+ 14 - 13
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/model/user/FeedBack.java

@ -2,6 +2,7 @@ package com.yihu.jw.healthyhouse.model.user;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import org.hibernate.annotations.Formula;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -30,26 +31,26 @@ public class FeedBack extends UuidIdentityEntityWithOperator {
    @Column(name = "flag", nullable = false)
    private Integer  flag;
    //回复内容
    @Column(name = "replyContent", nullable = false)
    @Column(name = "reply_content", nullable = false)
    private String  replyContent;
    //是否有附件,0无,1有
    @Column(name = "enclosureFlag", nullable = false)
    @Column(name = "enclosure_flag", nullable = false)
    private String  enclosureFlag;
    //设施编号
    @Column(name = "facilitieCode", nullable = false)
    @Column(name = "facilitie_code", nullable = false)
    private String  facilitieCode;
    //设施经度
    @Column(name = "facilitieLongitude", nullable = false)
    @Column(name = "facilitie_longitude", nullable = false)
    private double  facilitieLongitude;
    //设施维度
    @Column(name = "facilitieLatitude", nullable = false)
    @Column(name = "facilitie_latitude", nullable = false)
    private double  facilitieLatitude;
    //上传附件地址(多张图片地址,用逗号隔开)
    @Column(name = "pig_path", nullable = false)
    private String  pigPath;
    //反馈类型,1建议、2投诉、3报修、4其他
    private String  feedTypeName;
    private String  feedTypeValue;
    //反馈的处理状态:0未阅,1待处理,2已处理
    private String  flagValue;
    //是否有附件,0无,1有
@ -134,15 +135,15 @@ public class FeedBack extends UuidIdentityEntityWithOperator {
    public void setPigPath(String pigPath) {
        this.pigPath = pigPath;
    }
    @Transient
    public String getFeedTypeName() {
        return feedTypeName;
    @Formula("( SELECT a.value FROM system_dict_entries a WHERE a.dict_id = 4 AND a.code = feed_type )")
    public String getFeedTypeValue() {
        return feedTypeValue;
    }
    public void setFeedTypeName(String feedTypeName) {
        this.feedTypeName = feedTypeName;
    public void setFeedTypeValue(String feedTypeValue) {
        this.feedTypeValue = feedTypeValue;
    }
    @Transient
    @Formula("( SELECT a.value FROM system_dict_entries a WHERE a.dict_id = 6 AND a.code = flag )")
    public String getFlagValue() {
        return flagValue;
    }
@ -150,7 +151,7 @@ public class FeedBack extends UuidIdentityEntityWithOperator {
    public void setFlagValue(String flagValue) {
        this.flagValue = flagValue;
    }
    @Transient
    @Formula("( SELECT a.value FROM system_dict_entries a WHERE a.dict_id = 8 AND a.code = enclosure_flag )")
    public String getEnclosureFlagValue() {
        return enclosureFlagValue;
    }