Excel.java.ftl 948 B

1234567891011121314151617181920212223242526272829303132333435
  1. package ${package}.modules.${moduleName}.excel<#if subModuleName??>.${subModuleName}</#if>;
  2. import com.alibaba.excel.annotation.ExcelProperty;
  3. import com.alibaba.excel.annotation.write.style.ColumnWidth;
  4. import com.alibaba.excel.annotation.write.style.ContentRowHeight;
  5. import com.alibaba.excel.annotation.write.style.HeadRowHeight;
  6. import lombok.Data;
  7. <#list imports as i>
  8. import ${i!};
  9. </#list>
  10. /**
  11. * ${tableComment}
  12. *
  13. * @author ${author} ${email}
  14. * @since ${version} ${date}
  15. */
  16. @Data
  17. @ContentRowHeight(20)
  18. @HeadRowHeight(20)
  19. @ColumnWidth(25)
  20. public class ${ClassName}Excel {
  21. <#assign index = 0>
  22. <#list columnList as column>
  23. <#if column.list>
  24. <#if column.comment!?length gt 0>
  25. @ExcelProperty(value = "${column.comment}", index = ${index})
  26. <#else>
  27. @ExcelProperty(value = "${column.attrType}", index = ${index})
  28. </#if>
  29. private ${column.attrType} ${column.attrName};
  30. <#assign index = index+1>
  31. </#if>
  32. </#list>
  33. }