sub-domain.java.vm 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package ${packageName}.domain;
  2. #foreach ($import in $subImportList)
  3. import ${import};
  4. #end
  5. import org.apache.commons.lang3.builder.ToStringBuilder;
  6. import org.apache.commons.lang3.builder.ToStringStyle;
  7. import com.ruoyi.common.annotation.Excel;
  8. import com.ruoyi.common.core.domain.BaseEntity;
  9. /**
  10. * ${subTable.functionName}对象 ${subTableName}
  11. *
  12. * @author ${author}
  13. * @date ${datetime}
  14. */
  15. public class ${subClassName} extends BaseEntity
  16. {
  17. private static final long serialVersionUID = 1L;
  18. #foreach ($column in $subTable.columns)
  19. #if(!$table.isSuperColumn($column.javaField))
  20. /** $column.columnComment */
  21. #if($column.list)
  22. #set($parentheseIndex=$column.columnComment.indexOf("("))
  23. #if($parentheseIndex != -1)
  24. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  25. #else
  26. #set($comment=$column.columnComment)
  27. #end
  28. #if($parentheseIndex != -1)
  29. @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
  30. #elseif($column.javaType == 'Date')
  31. @JsonFormat(pattern = "yyyy-MM-dd")
  32. @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
  33. #else
  34. @Excel(name = "${comment}")
  35. #end
  36. #end
  37. private $column.javaType $column.javaField;
  38. #end
  39. #end
  40. #foreach ($column in $subTable.columns)
  41. #if(!$table.isSuperColumn($column.javaField))
  42. #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
  43. #set($AttrName=$column.javaField)
  44. #else
  45. #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
  46. #end
  47. public void set${AttrName}($column.javaType $column.javaField)
  48. {
  49. this.$column.javaField = $column.javaField;
  50. }
  51. public $column.javaType get${AttrName}()
  52. {
  53. return $column.javaField;
  54. }
  55. #end
  56. #end
  57. @Override
  58. public String toString() {
  59. return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  60. #foreach ($column in $subTable.columns)
  61. #if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
  62. #set($AttrName=$column.javaField)
  63. #else
  64. #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
  65. #end
  66. .append("${column.javaField}", get${AttrName}())
  67. #end
  68. .toString();
  69. }
  70. }