ColumnInfo.java 1.7 KB
Newer Older
D
dqjdda 已提交
1 2 3 4
package me.zhengjie.domain;

import lombok.Data;
import lombok.NoArgsConstructor;
5
import me.zhengjie.utils.GenUtil;
D
dqjdda 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
import javax.persistence.*;

/**
 * 列的数据信息
 * @author Zheng Jie
 * @date 2019-01-02
 */
@Data
@Entity
@NoArgsConstructor
@Table(name = "column_config")
public class ColumnInfo {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    private String tableName;

    // 数据库字段名称
    private String columnName;

    // 数据库字段类型
    private String columnType;

    // 数据库字段键类型
    private String keyType;

    // 字段额外的参数
    private String extra;

    // 数据库字段描述
    private String remark;

    // 必填
    private Boolean notNull;

    // 是否在列表显示
    private Boolean listShow;

    // 是否表单显示
    private Boolean formShow;

    // 表单类型
    private String formType;

    // 查询 1:模糊 2:精确
    private String queryType;

    // 字典名称
    private String dictName;

    // 关联表名
    private String joinName;

62 63 64
    // 日期注解
    private String dateAnnotation;

D
dqjdda 已提交
65 66 67 68 69 70 71
    public ColumnInfo(String tableName, String columnName, Boolean notNull, String columnType, String remark, String keyType, String extra) {
        this.tableName = tableName;
        this.columnName = columnName;
        this.columnType = columnType;
        this.keyType = keyType;
        this.extra = extra;
        this.notNull = notNull;
72 73 74 75
        if(GenUtil.PK.equalsIgnoreCase(keyType) && GenUtil.EXTRA.equalsIgnoreCase(extra)){
            this.notNull = false;
        }
        this.remark = remark;
D
dqjdda 已提交
76 77 78 79
        this.listShow = true;
        this.formShow = true;
    }
}