package ${package.Entity};

<#list table.importPackages as pkg>
import ${pkg};
</#list>
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;

/**
 * ${table.comment!} 数据访问对象
 *
 * @author ${author}
 * @since ${date}
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("${table.name}")
public class ${entity}DO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

<#-- 遍历字段 -->
<#list table.fields as field>
    <#if field.keyFlag>
    /**
     * ${field.comment}
     */
    @TableId(value = "${field.annotationColumnName}", type = IdType.ASSIGN_ID)
    private ${field.propertyType} ${field.propertyName};

    <#elseif field.propertyName == "delFlag">
    /**
     * ${field.comment}
     */
    @TableLogic
    @TableField("${field.annotationColumnName}")
    private ${field.propertyType} ${field.propertyName};

    <#elseif field.propertyName == "createTime">
    /**
     * ${field.comment}
     */
    @TableField(value = "${field.annotationColumnName}", fill = FieldFill.INSERT)
    private ${field.propertyType} ${field.propertyName};

    <#elseif field.propertyName == "updateTime">
    /**
     * ${field.comment}
     */
    @TableField(value = "${field.annotationColumnName}", fill = FieldFill.INSERT_UPDATE)
    private ${field.propertyType} ${field.propertyName};

    <#else>
    /**
     * ${field.comment}
     */
    @TableField("${field.annotationColumnName}")
    private ${field.propertyType} ${field.propertyName};

    </#if>
</#list>
}
