package cn.lihongjie.coal.acDeviceSupplier.entity;

import cn.lihongjie.coal.base.entity.OrgCommonEntity;

import jakarta.persistence.Entity;

import lombok.Data;

import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;

@Data
@Entity
public class AcDeviceSupplierEntity extends OrgCommonEntity {
    private String contact;

    private String contactPhone;

    private String address;
    
    @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;
}
