懒羊羊
2024-01-31 e57a8990ae56f657a59c435a0613c5f7a8728003
提交 | 用户 | 时间
e57a89 1 package ${packageName}.domain;
2
3 #foreach ($import in $importList)
4 import ${import};
5 #end
6 import org.apache.commons.lang3.builder.ToStringBuilder;
7 import org.apache.commons.lang3.builder.ToStringStyle;
8 import com.jcdm.common.annotation.Excel;
9 #if($table.crud || $table.sub)
10 import com.jcdm.common.core.domain.BaseEntity;
11 #elseif($table.tree)
12 import com.jcdm.common.core.domain.TreeEntity;
13 #end
14
15 /**
16  * ${functionName}对象 ${tableName}
17  * 
18  * @author ${author}
19  * @date ${datetime}
20  */
21 #if($table.crud || $table.sub)
22 #set($Entity="BaseEntity")
23 #elseif($table.tree)
24 #set($Entity="TreeEntity")
25 #end
26 public class ${ClassName} extends ${Entity}
27 {
28     private static final long serialVersionUID = 1L;
29
30 #foreach ($column in $columns)
31 #if(!$table.isSuperColumn($column.javaField))
32     /** $column.columnComment */
33 #if($column.list)
34 #set($parentheseIndex=$column.columnComment.indexOf("("))
35 #if($parentheseIndex != -1)
36 #set($comment=$column.columnComment.substring(0, $parentheseIndex))
37 #else
38 #set($comment=$column.columnComment)
39 #end
40 #if($parentheseIndex != -1)
41     @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
42 #elseif($column.javaType == 'Date')
43     @JsonFormat(pattern = "yyyy-MM-dd")
44     @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
45 #else
46     @Excel(name = "${comment}")
47 #end
48 #end
49     private $column.javaType $column.javaField;
50
51 #end
52 #end
53 #if($table.sub)
54     /** $table.subTable.functionName信息 */
55     private List<${subClassName}> ${subclassName}List;
56
57 #end
58 #foreach ($column in $columns)
59 #if(!$table.isSuperColumn($column.javaField))
60 #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
61 #set($AttrName=$column.javaField)
62 #else
63 #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
64 #end
65     public void set${AttrName}($column.javaType $column.javaField) 
66     {
67         this.$column.javaField = $column.javaField;
68     }
69
70     public $column.javaType get${AttrName}() 
71     {
72         return $column.javaField;
73     }
74 #end
75 #end
76
77 #if($table.sub)
78     public List<${subClassName}> get${subClassName}List()
79     {
80         return ${subclassName}List;
81     }
82
83     public void set${subClassName}List(List<${subClassName}> ${subclassName}List)
84     {
85         this.${subclassName}List = ${subclassName}List;
86     }
87
88 #end
89     @Override
90     public String toString() {
91         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
92 #foreach ($column in $columns)
93 #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
94 #set($AttrName=$column.javaField)
95 #else
96 #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
97 #end
98             .append("${column.javaField}", get${AttrName}())
99 #end
100 #if($table.sub)
101             .append("${subclassName}List", get${subClassName}List())
102 #end
103             .toString();
104     }
105 }