2024-04-22 08:45:46 +08:00
|
|
|
|
package ${packageName}.domain;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.annotation.JSONField;
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.IdType;
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
|
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.Builder;
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ${functionName}对象 ${tableName}
|
|
|
|
|
*
|
|
|
|
|
* @author ${author}
|
|
|
|
|
* @date ${datetime}
|
|
|
|
|
*/
|
|
|
|
|
@Data
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
@AllArgsConstructor
|
|
|
|
|
@Builder
|
2024-04-22 09:08:44 +08:00
|
|
|
|
@ApiModel("${functionName}表")
|
2024-04-22 08:58:46 +08:00
|
|
|
|
@TableName("${tableName}")
|
2024-04-22 08:45:46 +08:00
|
|
|
|
public class ${ClassName}{
|
|
|
|
|
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
|
|
|
|
|
#end
|
|
|
|
|
#if($column.isPk == 1)
|
2024-04-23 13:18:21 +08:00
|
|
|
|
@JsonSerialize(using = ToStringSerializer.class)
|
2024-04-22 08:45:46 +08:00
|
|
|
|
@ApiModelProperty("$column.columnComment")
|
|
|
|
|
@TableId(value = "$column.columnName" , type = IdType.ASSIGN_ID)
|
|
|
|
|
private $column.javaType $column.javaField;
|
|
|
|
|
#else
|
|
|
|
|
@ApiModelProperty("$column.columnComment")
|
|
|
|
|
@TableField("$column.columnName")
|
|
|
|
|
private $column.javaType $column.javaField;
|
|
|
|
|
#end
|
|
|
|
|
#else
|
|
|
|
|
#if($column.javaType == 'Date')
|
2024-04-22 09:08:44 +08:00
|
|
|
|
/** $column.columnComment */
|
2024-04-23 08:39:01 +08:00
|
|
|
|
@ApiModelProperty(value = "$column.columnComment",hidden = true)
|
2024-04-22 08:45:46 +08:00
|
|
|
|
@TableField("$column.columnName")
|
2024-04-23 13:18:21 +08:00
|
|
|
|
@JsonSerialize(using = ToStringSerializer.class)
|
2024-04-22 08:45:46 +08:00
|
|
|
|
private String $column.javaField;
|
|
|
|
|
#end
|
|
|
|
|
#end
|
|
|
|
|
#end
|
|
|
|
|
}
|