do.vm
1019 Bytes
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
package ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName};
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import ${BaseDOClassName};
/**
* ${table.classComment} DO
*
* @author ${table.author}
*/
@TableName("${table.tableName}")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ${table.className}DO extends BaseDO {
#foreach ($column in $columns)
#if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段
/**
* ${column.columnComment}
*/
#if ("$!column.dictType" != "")##处理枚举值
// TODO 枚举 ${column.dictType}
#end
#if (${column.primaryKey} && ${column.javaType} != 'String')##处理主键 + 非 String 的情况
@TableId
#end
#if (${column.primaryKey} && ${column.javaType} == 'String')##处理主键 + String 的情况
@TableId(type = IdType.INPUT)
#end
private ${column.javaType} ${column.javaField};
#end
#end
}