POTemplate.ftl
2.41 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<#--包名 -->
package ${packages}
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
/**
<#if version?exists>
* @version ${version}
</#if>
*/
public class ${name}PO implements Serializable {
<#--变量 ,get,set方法-->
<#if tablemodel.columnlist?exists>
<#list tablemodel.columnlist as clist>
private ${clist.columnJAVAType} ${clist.columnName};
<#if clist.columnRemarks?exists>
/**
* ${clist.columnRemarks}
*/
<#else>
</#if>
<#if clist.columnJAVAType = "java.sql.Timestamp" >
@org.codehaus.jackson.map.annotate.JsonSerialize(using = com.taover.tools.DateTimeSerializer.class)
</#if>
<#if clist.columnJAVAType = "java.util.Date" >
@org.codehaus.jackson.map.annotate.JsonSerialize(using = com.taover.tools.DateSerializer.class)
</#if>
public ${clist.columnJAVAType} get${clist.columnMethodName}(){
return ${clist.columnName};
}
public void set${clist.columnMethodName}(${clist.columnJAVAType} ${clist.columnName}){
this.${clist.columnName} = ${clist.columnName};
}
<#if clist.columnJAVAType = "Long" || clist.columnJAVAType = "java.math.BigDecimal" || clist.columnJAVAType = "Integer" || clist.columnJAVAType = "Short" || clist.columnJAVAType = "Float" || clist.columnJAVAType = "Double">
<#if clist.columnJAVAType = "Long">
private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0L;
</#if>
<#if clist.columnJAVAType = "java.math.BigDecimal">
private ${clist.columnJAVAType} variation${clist.columnMethodName} = new java.math.BigDecimal(0.0);
</#if>
<#if clist.columnJAVAType = "Integer">
private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0;
</#if>
<#if clist.columnJAVAType = "Short">
private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0;
</#if>
<#if clist.columnJAVAType = "Double">
private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0d;
</#if>
<#if clist.columnJAVAType = "Float">
private ${clist.columnJAVAType} variation${clist.columnMethodName} = 0f;
</#if>
public ${clist.columnJAVAType} getVariation${clist.columnMethodName}(){
return variation${clist.columnMethodName};
}
public void setVariation${clist.columnMethodName}(${clist.columnJAVAType} variation${clist.columnName}){
this.variation${clist.columnMethodName} = variation${clist.columnName};
}
</#if>
</#list>
</#if>
@Override
public String toString() {
return "${name}PO: ${toStringMethodBody};
}
}