1. 调整代码生成器模板的目录

2. 调整代码的方法
This commit is contained in:
YunaiV
2021-02-10 14:52:28 +08:00
parent 305090b7dc
commit ea631ee42b
14 changed files with 50 additions and 18 deletions

View File

@ -0,0 +1,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
}