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