通用优化
This commit is contained in:
parent
0e4943de0e
commit
a0346043f6
|
|
@ -4,11 +4,11 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
|||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.base.BaseEntity;
|
||||
#foreach ($column in $columns)
|
||||
#if($column.attrType == 'Date')
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
#break
|
||||
#end
|
||||
#if($column.attrType == 'Date')
|
||||
import javax.persistence.Id;
|
||||
import java.util.Date;
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
|
||||
/**
|
||||
|
|
@ -19,14 +19,19 @@ import java.util.Date;
|
|||
*/
|
||||
public class ${className}
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
#foreach ($column in $columns)
|
||||
/** $column.columnComment */
|
||||
#if($column.columnName == $primaryKey.columnName)
|
||||
@Id
|
||||
private $column.attrType $column.attrname;
|
||||
#else
|
||||
private $column.attrType $column.attrname;
|
||||
#end
|
||||
#end
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#foreach ($column in $columns)
|
||||
/** 设置$column.columnComment */
|
||||
public void set${column.attrName}($column.attrType $column.attrname)
|
||||
{
|
||||
|
|
@ -38,13 +43,13 @@ public class ${className}
|
|||
{
|
||||
return $column.attrname;
|
||||
}
|
||||
#end
|
||||
#end
|
||||
|
||||
public String toString() {
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
#foreach ($column in $columns)
|
||||
#foreach ($column in $columns)
|
||||
.append("${column.attrname}", get${column.attrName}())
|
||||
#end
|
||||
#end
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue