domain.java.vm 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package ${packageName}.domain;
  2. import org.apache.commons.lang3.builder.ToStringBuilder;
  3. import org.apache.commons.lang3.builder.ToStringStyle;
  4. import com.ruoyi.framework.aspectj.lang.annotation.Excel;
  5. import com.ruoyi.framework.web.domain.BaseEntity;
  6. #foreach ($import in $importList)
  7. import ${import};
  8. #end
  9. /**
  10. * ${functionName}对象 ${tableName}
  11. *
  12. * @author ${author}
  13. * @date ${datetime}
  14. */
  15. #set($Entity="BaseEntity")
  16. public class ${ClassName} extends ${Entity}
  17. {
  18. private static final long serialVersionUID = 1L;
  19. #foreach ($column in $columns)
  20. #if(!$table.isSuperColumn($column.javaField))
  21. /** $column.columnComment */
  22. #if($column.list)
  23. #set($parentheseIndex=$column.columnComment.indexOf("("))
  24. #if($parentheseIndex != -1)
  25. #set($comment=$column.columnComment.substring(0, $parentheseIndex))
  26. #else
  27. #set($comment=$column.columnComment)
  28. #end
  29. #if($parentheseIndex != -1)
  30. @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
  31. #elseif($column.javaType == 'Date')
  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 $columns)
  41. #if(!$table.isSuperColumn($column.javaField))
  42. #if($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 $columns)
  61. #if($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. }