75 lines
2.0 KiB
Plaintext
75 lines
2.0 KiB
Plaintext
package ${packageName}.domain;
|
||
|
||
#foreach ($import in $importList)
|
||
import ${import};
|
||
#end
|
||
import com.baomidou.mybatisplus.annotation.TableId;
|
||
import com.baomidou.mybatisplus.annotation.TableName;
|
||
import lombok.Data;
|
||
import lombok.EqualsAndHashCode;
|
||
import lombok.NoArgsConstructor;
|
||
import lombok.AllArgsConstructor;
|
||
import lombok.experimental.SuperBuilder;
|
||
import io.swagger.annotations.*;
|
||
import com.ruoyi.common.annotation.Excel;
|
||
#if($table.crud || $table.sub)
|
||
import com.ruoyi.common.core.domain.BaseEntity;
|
||
#elseif($table.tree)
|
||
import com.ruoyi.common.core.domain.TreeEntity;
|
||
#end
|
||
|
||
/**
|
||
* ${functionName}对象 ${tableName}
|
||
*
|
||
* @author ${author}
|
||
* @date ${datetime}
|
||
*/
|
||
#if($table.crud || $table.sub)
|
||
#set($Entity="BaseEntity")
|
||
#elseif($table.tree)
|
||
#set($Entity="TreeEntity")
|
||
#end
|
||
@Data
|
||
@SuperBuilder
|
||
@NoArgsConstructor
|
||
@AllArgsConstructor
|
||
@TableName("${tableName}")
|
||
@EqualsAndHashCode(callSuper = true)
|
||
@ApiModel(value = "${ClassName}", description = "${functionName}")
|
||
public class ${ClassName} extends ${Entity} {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
#foreach ($column in $columns)
|
||
#if(!$table.isSuperColumn($column.javaField))
|
||
/** $column.columnComment */
|
||
#if($column.list)
|
||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||
#if($parentheseIndex != -1)
|
||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||
#else
|
||
#set($comment=$column.columnComment)
|
||
#end
|
||
#if($parentheseIndex != -1)
|
||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||
#elseif($column.javaType == 'Date')
|
||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
|
||
#else
|
||
@Excel(name = "${comment}")
|
||
#end
|
||
#end
|
||
#if($column.javaField == $pkColumn.javaField)
|
||
@TableId(value = "${pkColumn.javaField}",type = IdType.AUTO)
|
||
#end
|
||
#set($comment='')
|
||
#if($column.isRequired == '1')
|
||
#set($comment=', required = true')
|
||
#end
|
||
@ApiModelProperty(name = "${column.columnComment}", value = "${column.columnComment}"$comment)
|
||
private $column.javaType $column.javaField;
|
||
|
||
#end
|
||
#end
|
||
}
|