实体.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package ${package}.${moduleName}.entity;
  2. import com.baomidou.mybatisplus.annotation.*;
  3. import com.baomidou.mybatisplus.extension.activerecord.Model;
  4. import io.swagger.v3.oas.annotations.media.Schema;
  5. import lombok.Data;
  6. import lombok.EqualsAndHashCode;
  7. #if($isTenant)
  8. import com.pig4cloud.pigx.common.core.util.TenantTable;
  9. #end
  10. #foreach($import in $importList)
  11. import $import;
  12. #end
  13. /**
  14. * ${tableComment}
  15. *
  16. * @author ${author}
  17. * @date ${datetime}
  18. */
  19. @Data
  20. #if($isTenant)
  21. @TenantTable
  22. #end
  23. @TableName("${tableName}")
  24. @EqualsAndHashCode(callSuper = true)
  25. @Schema(description = "${tableComment}")
  26. public class ${ClassName}Entity extends Model<${ClassName}Entity> {
  27. #foreach ($field in $fieldList)
  28. #if(${field.fieldComment})#set($comment=${field.fieldComment})#else #set($comment=${field.attrName})#end
  29. /**
  30. * $comment
  31. */
  32. #if($field.primaryPk == '1')
  33. @TableId(type = IdType.ASSIGN_ID)
  34. #end
  35. #if($field.autoFill == 'INSERT')
  36. @TableField(fill = FieldFill.INSERT)
  37. #elseif($field.autoFill == 'INSERT_UPDATE')
  38. @TableField(fill = FieldFill.INSERT_UPDATE)
  39. #elseif($field.autoFill == 'UPDATE')
  40. @TableField(fill = FieldFill.UPDATE)
  41. #end
  42. #if($field.fieldName == 'del_flag')
  43. @TableLogic
  44. @TableField(fill = FieldFill.INSERT)
  45. #end
  46. @Schema(description="$comment"#if($field.hidden),hidden=$field.hidden#end)
  47. #if($field.formType == 'checkbox')
  48. private ${field.attrType}[] $field.attrName;
  49. #else
  50. private $field.attrType $field.attrName;
  51. #end
  52. #end
  53. }