chenhj
5 天以前 8ed2d18ee769db2c9b1553bef16e2b2f8e996a83
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
package ${package.Entity};
 
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
<#if superEntityClass?? && superEntityClass != "">
    import ${superEntityClass};
</#if>
<#list table.fields as field>
    <#if field.propertyType == "LocalDateTime">
        import java.time.LocalDateTime;
        <#break>
    </#if>
</#list>
 
/**
* ${table.comment!} 实体类
*
* @author ${author!"admin"}
* @date ${.now?string("yyyy-MM-dd")}
*/
@Data
@TableName("${table.name}")
public class ${entity} <#if superEntityClass?? && superEntityClass != "">extends ${superEntityClass?substring(superEntityClass?last_index_of(".") + 1)}</#if> {
 
private static final long serialVersionUID = 1L;
 
<#list table.fields as field>
<#-- 修复:添加 superEntityColumns 存在性检查 -->
    <#if superEntityColumns?? && !superEntityColumns?seq_contains(field.name)>
        /**
        * ${field.comment!}
        */
        <#if field.keyFlag>
            @TableId(value = "${field.name}", type = IdType.${idType!"AUTO"})
        <#else>
            @TableField(value = "${field.name}"<#if field.fill?? && field.fill != "">, fill = FieldFill.${field.fill?upper_case}</#if>)
        </#if>
        <#if field.logicDeleteField>
            @TableLogic
        </#if>
        private ${field.propertyType} ${field.propertyName};
    </#if>
</#list>
}