4a5693b7dc6ba5df7f8cea409c1b2b886e40cee6.svn-base 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <#list subTables as subTab>
  2. #segment#${subTab.entityName}.java
  3. package ${bussiPackage}.${entityPackage}.entity;
  4. import java.io.Serializable;
  5. import com.baomidou.mybatisplus.annotation.IdType;
  6. import com.baomidou.mybatisplus.annotation.TableId;
  7. import com.baomidou.mybatisplus.annotation.TableName;
  8. import org.jeecg.common.aspect.annotation.Dict;
  9. import lombok.Data;
  10. import com.fasterxml.jackson.annotation.JsonFormat;
  11. import org.springframework.format.annotation.DateTimeFormat;
  12. import org.jeecgframework.poi.excel.annotation.Excel;
  13. import java.util.Date;
  14. import io.swagger.annotations.ApiModel;
  15. import io.swagger.annotations.ApiModelProperty;
  16. import java.io.UnsupportedEncodingException;
  17. /**
  18. * @Description: ${subTab.ftlDescription}
  19. * @Author: jeecg-boot
  20. * @Date: ${.now?string["yyyy-MM-dd"]}
  21. * @Version: V1.0
  22. */
  23. @Data
  24. @TableName("${subTab.tableName}")
  25. @ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
  26. public class ${subTab.entityName} implements Serializable {
  27. private static final long serialVersionUID = 1L;
  28. <#assign excel_ignore_arr=['createBy','createTime','updateBy','updateTime','sysOrgCode']>
  29. <#list subTab.originalColumns as po>
  30. /**${po.filedComment}*/
  31. <#if po.fieldName == primaryKeyField>
  32. @TableId(type = IdType.ASSIGN_ID)
  33. <#else>
  34. <#if po.fieldDbType =='Date'>
  35. <#if po.classType=='date'>
  36. <#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
  37. @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd")
  38. </#if>
  39. @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  40. @DateTimeFormat(pattern="yyyy-MM-dd")
  41. <#else>
  42. <#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
  43. @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss")
  44. </#if>
  45. @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
  46. @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  47. </#if>
  48. <#elseif !subTab.foreignKeys?seq_contains(po.fieldName?cap_first)>
  49. <#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
  50. @Excel(name = "${po.filedComment}", width = 15)
  51. </#if>
  52. </#if>
  53. </#if>
  54. <#if po.classType =='list' || po.classType =='radio' || po.classType =='list_multi' || po.classType =='checkbox' || po.classType =='sel_search'>
  55. <#if po.dictTable?default("")?trim?length gt 1>
  56. @Dict(dicCode = "${po.dictField}",dicText = "${po.dictText}",dictTable = "${po.dictTable}")
  57. <#elseif po.dictField?default("")?trim?length gt 1>
  58. @Dict(dicCode = "${po.dictField}")
  59. </#if>
  60. </#if>
  61. <#if po.classType =='cat_tree'>
  62. @Dict(dicCode = "id",dicText = "name",dictTable = "sys_category")
  63. </#if>
  64. <#if po.classType =='sel_depart'>
  65. @Dict(dicCode = "id",dicText = "depart_name",dictTable = "sys_depart")
  66. </#if>
  67. <#-- 大字段转换 -->
  68. <#include "/common/blob.ftl">
  69. </#list>
  70. }
  71. </#list>