[测评系统]--测评系统核心代码库
林致杰
2022-03-16 c65be70c3998e2d2d2908f6e370992e206b50c87
1
2
3
4
5
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package com.ots.project.tool.gen.domain;
import com.ots.common.utils.StringUtils;
import com.ots.framework.web.domain.BaseEntity;
import javax.validation.constraints.NotBlank;
 
public class GenTableColumn extends BaseEntity {
    private static final long serialVersionUID = 1L;
    
    private Long columnId;
    
    private Long tableId;
    
    private String columnName;
    
    private String columnComment;
    
    private String columnType;
    
    private String javaType;
    
    @NotBlank(message = "Java属性不能为空")
    private String javaField;
    
    private String isPk;
    
    private String isIncrement;
    
    private String isRequired;
    
    private String isInsert;
    
    private String isEdit;
    
    private String isList;
    
    private String isQuery;
    
    private String queryType;
    
    private String htmlType;
    
    private String dictType;
    
    private Integer sort;
    public void setColumnId(Long columnId) {
        this.columnId = columnId;
    }
    public Long getColumnId() {
        return columnId;
    }
    public void setTableId(Long tableId) {
        this.tableId = tableId;
    }
    public Long getTableId() {
        return tableId;
    }
    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }
    public String getColumnName() {
        return columnName;
    }
    public void setColumnComment(String columnComment) {
        this.columnComment = columnComment;
    }
    public String getColumnComment() {
        return columnComment;
    }
    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }
    public String getColumnType() {
        return columnType;
    }
    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }
    public String getJavaType() {
        return javaType;
    }
    public void setJavaField(String javaField) {
        this.javaField = javaField;
    }
    public String getJavaField() {
        return javaField;
    }
    public void setIsPk(String isPk) {
        this.isPk = isPk;
    }
    public String getIsPk() {
        return isPk;
    }
    public boolean isPk() {
        return isPk(this.isPk);
    }
    public boolean isPk(String isPk) {
        return isPk != null && StringUtils.equals("1", isPk);
    }
    public String getIsIncrement() {
        return isIncrement;
    }
    public void setIsIncrement(String isIncrement) {
        this.isIncrement = isIncrement;
    }
    public boolean isIncrement() {
        return isIncrement(this.isIncrement);
    }
    public boolean isIncrement(String isIncrement) {
        return isIncrement != null && StringUtils.equals("1", isIncrement);
    }
    public void setIsRequired(String isRequired) {
        this.isRequired = isRequired;
    }
    public String getIsRequired() {
        return isRequired;
    }
    public boolean isRequired() {
        return isRequired(this.isRequired);
    }
    public boolean isRequired(String isRequired) {
        return isRequired != null && StringUtils.equals("1", isRequired);
    }
    public void setIsInsert(String isInsert) {
        this.isInsert = isInsert;
    }
    public String getIsInsert() {
        return isInsert;
    }
    public boolean isInsert() {
        return isInsert(this.isInsert);
    }
    public boolean isInsert(String isInsert) {
        return isInsert != null && StringUtils.equals("1", isInsert);
    }
    public void setIsEdit(String isEdit) {
        this.isEdit = isEdit;
    }
    public String getIsEdit() {
        return isEdit;
    }
    public boolean isEdit() {
        return isInsert(this.isEdit);
    }
    public boolean isEdit(String isEdit) {
        return isEdit != null && StringUtils.equals("1", isEdit);
    }
    public void setIsList(String isList) {
        this.isList = isList;
    }
    public String getIsList() {
        return isList;
    }
    public boolean isList() {
        return isList(this.isList);
    }
    public boolean isList(String isList) {
        return isList != null && StringUtils.equals("1", isList);
    }
    public void setIsQuery(String isQuery) {
        this.isQuery = isQuery;
    }
    public String getIsQuery() {
        return isQuery;
    }
    public boolean isQuery() {
        return isQuery(this.isQuery);
    }
    public boolean isQuery(String isQuery) {
        return isQuery != null && StringUtils.equals("1", isQuery);
    }
    public void setQueryType(String queryType) {
        this.queryType = queryType;
    }
    public String getQueryType() {
        return queryType;
    }
    public String getHtmlType() {
        return htmlType;
    }
    public void setHtmlType(String htmlType) {
        this.htmlType = htmlType;
    }
    public void setDictType(String dictType) {
        this.dictType = dictType;
    }
    public String getDictType() {
        return dictType;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getSort() {
        return sort;
    }
    public boolean isSuperColumn() {
        return isSuperColumn(this.javaField);
    }
    public static boolean isSuperColumn(String javaField) {
        return StringUtils.equalsAnyIgnoreCase(javaField, "createBy", "createTime", "updateBy", "updateTime", "remark");
    }
    public String readConverterExp() {
        String remarks = StringUtils.substringBetween(this.columnComment, "(", ")");
        StringBuffer sb = new StringBuffer();
        if (StringUtils.isNotEmpty(remarks)) {
            for (String value : remarks.split(" ")) {
                if (StringUtils.isNotEmpty(value)) {
                    Object startStr = value.subSequence(0, 1);
                    String endStr = value.substring(1);
                    sb.append("").append(startStr).append("=").append(endStr).append(",");
                }
            }
            return sb.deleteCharAt(sb.length() - 1).toString();
        } else {
            return this.columnComment;
        }
    }
}