This commit is contained in:
2025-10-15 12:33:26 +08:00
parent 707a0decd5
commit 20d849d74c
4 changed files with 438 additions and 24 deletions

View File

@@ -0,0 +1,48 @@
##导入宏定义
$!{define.vm}
##保存文件(宏定义)
#save("/entity", ".java")
##包路径(宏定义)
#setPackageSuffix("entity")
##实现列进行排除
#set($temp = $tool.newHashSet("id", "createDept", "createTime", "updateTime", "createTime", "updateUser", "createUser", "status", "isDeleted"))
#set($newList = $tool.newArrayList())
#foreach($column in $tableInfo.fullColumn)
##默认不包含
#set($contant = true)
#foreach($item in $temp)
#if($column.name==$item)
#set($contant = false)
#end
#end
#if($contant)
##带有反回值的方法调用时使用$tool.call来消除返回值
$tool.call($newList.add($column))
#end
#end
##重新保存
$tableInfo.setFullColumn($newList)
##自动导入包(全局变量)
$!{autoImport.vm}
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.mp.base.BaseEntity;
##表注释(宏定义)
#tableComment("实体类")
@Data
@TableName("$!{tableInfo.obj.name}")
@ApiModel(value = "$!{tableInfo.name}对象", description = "$!{tableInfo.comment}")
public class $!{tableInfo.name} extends BaseEntity {
#foreach($column in $tableInfo.fullColumn)
#if(${column.comment})@ApiModelProperty("${column.comment}")
#end
@TableField("$column.obj.name")
private $!{tool.getClsNameByFullName($column.type)} $!{column.name};
#end
}

View File

@@ -0,0 +1,25 @@
##导入宏定义
$!{define.vm}
##设置表后缀(宏定义)
#setTableSuffix("VO")
##保存文件(宏定义)
#save("/vo", "VO.java")
##包路径(宏定义)
#setPackageSuffix("vo")
import lombok.Data;
import lombok.EqualsAndHashCode;
import $!{tableInfo.savePackageName}.entity.$!tableInfo.name;
##表注释(宏定义)
#tableComment("实体封装类")
@Data
@EqualsAndHashCode(callSuper = true)
public class $!{tableName} extends $!tableInfo.name {
private static final long serialVersionUID = 1L;
}