xuefei
2020-12-10 eeeb7233935ea9b10e99043bdbf740ef86c9bf20
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package ${entity.entityPackage};
 
import BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
<%
if(entity.isTree){
%>
import org.springframework.data.annotation.Transient;
import com.baomidou.mybatisplus.annotation.TableField;
 
import javax.persistence.Column;
import java.math.BigDecimal;
<%
}
%>
import javax.persistence.Entity;
import javax.persistence.Table;
 
/**
 * @author ${entity.author}
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "${entity.tableName}")
@TableName("${entity.tableName}")
@ApiModel(value = "${entity.description}")
public class ${entity.className} extends BaseEntity {
 
    private static final long serialVersionUID = 1L;
 
    <%
    if(entity.isTree){
    %>
    @ApiModelProperty(value = "分类名称")
    private String title;
 
    @ApiModelProperty(value = "父id")
    private String parentId;
 
    @ApiModelProperty(value = "是否为父节点(含子节点) 默认false")
    private Boolean isParent = false;
 
    @ApiModelProperty(value = "排序值")
    @Column(precision = 10, scale = 2)
    private BigDecimal sortOrder;
 
    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "父节点名称")
    private String parentTitle;
    <%
    }
    %>
}