Blame view

src/main/resources/codegen/dal/do.vm 1022 Bytes
528d2a9b   YunaiV   完成 do 模板的生成
1
2
  package ${basePackage}.${table.moduleName}.dal.mysql.dataobject.${table.businessName};
  
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
3
  import com.baomidou.mybatisplus.annotation.*;
528d2a9b   YunaiV   完成 do 模板的生成
4
  import ${baseDOClassName};
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
5
6
7
8
  import lombok.*;
  import java.util.*;
  
  /**
528d2a9b   YunaiV   完成 do 模板的生成
9
10
11
  * ${table.classComment} DO
  *
  * @author ${table.author}
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
12
13
14
15
16
17
18
19
  */
  @TableName("${table.tableName}")
  @Data
  @EqualsAndHashCode(callSuper = true)
  @ToString(callSuper = true)
  @Builder
  @NoArgsConstructor
  @AllArgsConstructor
528d2a9b   YunaiV   完成 do 模板的生成
20
  public class ${table.className}DO extends BaseDO {
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
21
22
  
  #foreach ($column in $columns)
528d2a9b   YunaiV   完成 do 模板的生成
23
  #if (!${baseDOFields.contains(${column.javaField})})##排除 BaseDO 的字段
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
24
25
26
      /**
      * ${column.columnComment}
      */
528d2a9b   YunaiV   完成 do 模板的生成
27
28
29
30
  #if ($column.dictType != "")##处理枚举值
      // TODO 枚举 ${column.dictType}
  #end
  #if (${column.primaryKey} && ${column.javaType} != 'String')##处理主键 + 非 String 的情况
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
31
32
      @TableId
  #end
528d2a9b   YunaiV   完成 do 模板的生成
33
  #if (${column.primaryKey} && ${column.javaType} == 'String')##处理主键 + String 的情况
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
34
35
36
37
      @TableId(type = IdType.INPUT)
  #end
      private ${column.javaType} ${column.javaField};
  #end
528d2a9b   YunaiV   完成 do 模板的生成
38
  #end
1bea2ea7   YunaiV   引入 Velocity 模板引擎,...
39
40
  
  }