template.Entity.vm Maven / Gradle / Ivy
package ${package}.modules.${moduleName}.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nb6868.onex.common.pojo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.Alias;
#if(${hasBigDecimal})
import java.math.BigDecimal;
#end
#if(${hasJson})
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
#end
import java.util.Date;
/**
* ${comments}
*
* @author ${author} ${email}
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "${tableName}", autoResultMap = ${hasJson})
@Alias("${tableName}")
public class ${className}Entity extends BaseEntity {
#foreach ($column in $columns)
#if($column.columnName != 'id' && $column.columnName != 'creator' && $column.columnName != 'create_id' && $column.columnName != 'create_date' && $column.columnName != 'create_time' && $column.columnName != 'updater' && $column.columnName != 'update_id' && $column.columnName != 'update_date' && $column.columnName != 'update_time' && $column.columnName != 'del_flag' && $column.columnName != 'deleted')
/**
* $column.comments
*/
#if($column.attrType == 'JSONObject')
@TableField(typeHandler = JacksonTypeHandler.class)
#end
private $column.attrType $column.attrname;
#end
#end
}