Mapper
##导入宏定义 $!{define.vm} ##设置表后缀(宏定义) #setTableSuffix("Mapper") ##保存文件(宏定义) #save("/mapper", "Mapper.java") ##包路径(宏定义) #setPackageSuffix("mapper") import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.million.tools.axe.backend.model.$!tableInfo.name; ##表注释(宏定义) #tableComment("表数据库访问层") public interface $!{tableName} extends BaseMapper<$!tableInfo.name> { }
Entity
##导入宏定义 $!{define.vm} ##保存文件(宏定义) #save("/model", ".java") ##包路径(宏定义) #setPackageSuffix("model") ##自动导入包(全局变量) $!{autoImport.vm} import com.baomidou.mybatisplus.extension.activerecord.Model; import java.io.Serializable; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import io.swagger.annotations.ApiModel; import lombok.experimental.Accessors; import com.baomidou.mybatisplus.annotation.TableName; ##表注释(宏定义) #tableComment("表实体类") @SuppressWarnings("serial") @Data @Accessors(chain = true) @ApiModel(value = "$!{tableInfo.comment}") @TableName("$tableInfo.obj.name") public class $!{tableInfo.name} extends Model<$!{tableInfo.name}> { #foreach($column in $tableInfo.fullColumn) #if(${column.comment})//${column.comment}#end #if(${column.comment})@ApiModelProperty(value="${column.comment}", required = true)#end private $!{tool.getClsNameByFullName($column.type)} $!{column.name}; #end #foreach($column in $tableInfo.pkColumn) /** * 获取主键值 * * @return 主键值 */ @Override public Serializable pkVal() { return this.$!column.name; } #break #end }
live tmpl
* * @description: * @param: $param$ * @return: $return$ * @author Kolt * @date $date$ $time$ */
标签:tmpl,定义,EasyCode,##,column,Live,tableInfo,import,name From: https://www.cnblogs.com/xyzxy/p/17176988.html