提交 | 用户 | 时间
|
e7c126
|
1 |
package ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}; |
H |
2 |
|
|
3 |
import lombok.*; |
|
4 |
import java.util.*; |
|
5 |
#foreach ($column in $columns) |
|
6 |
#if (${column.javaType} == "BigDecimal") |
|
7 |
import java.math.BigDecimal; |
|
8 |
#end |
|
9 |
#if (${column.javaType} == "LocalDateTime") |
|
10 |
import java.time.LocalDateTime; |
|
11 |
#end |
|
12 |
#end |
|
13 |
import com.baomidou.mybatisplus.annotation.*; |
|
14 |
import ${BaseDOClassName}; |
|
15 |
|
|
16 |
/** |
|
17 |
* ${table.classComment} DO |
|
18 |
* |
|
19 |
* @author ${table.author} |
|
20 |
*/ |
|
21 |
@TableName("${table.tableName.toLowerCase()}") |
|
22 |
@KeySequence("${table.tableName.toLowerCase()}_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 |
|
23 |
@Data |
|
24 |
@EqualsAndHashCode(callSuper = true) |
|
25 |
@ToString(callSuper = true) |
|
26 |
@Builder |
|
27 |
@NoArgsConstructor |
|
28 |
@AllArgsConstructor |
|
29 |
public class ${table.className}DO extends BaseDO { |
|
30 |
|
|
31 |
## 特殊:树表专属逻辑 |
|
32 |
#if ( $table.templateType == 2 ) |
|
33 |
public static final Long ${treeParentColumn_javaField_underlineCase.toUpperCase()}_ROOT = 0L; |
|
34 |
|
|
35 |
#end |
|
36 |
#foreach ($column in $columns) |
|
37 |
#if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段 |
|
38 |
/** |
|
39 |
* ${column.columnComment} |
|
40 |
#if ("$!column.dictType" != "")##处理枚举值 |
|
41 |
* |
|
42 |
* 枚举 {@link TODO ${column.dictType} 对应的类} |
|
43 |
#end |
|
44 |
*/ |
|
45 |
#if (${column.primaryKey})##处理主键 |
|
46 |
@TableId#if (${column.javaType} == 'String')(type = IdType.INPUT)#end |
|
47 |
#end |
|
48 |
private ${column.javaType} ${column.javaField}; |
|
49 |
#end |
|
50 |
#end |
|
51 |
|
|
52 |
} |