d59c6bfc0ab5308458fcb44e6aff74f50adaeb6c.svn-base 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package ${bussiPackage}.${entityPackage}.entity;
  2. import java.io.Serializable;
  3. import java.util.Date;
  4. import com.baomidou.mybatisplus.annotation.IdType;
  5. import com.baomidou.mybatisplus.annotation.TableId;
  6. import com.baomidou.mybatisplus.annotation.TableName;
  7. import com.baomidou.mybatisplus.annotation.TableField;
  8. import io.swagger.annotations.ApiModel;
  9. import io.swagger.annotations.ApiModelProperty;
  10. import lombok.Data;
  11. import lombok.EqualsAndHashCode;
  12. import lombok.experimental.Accessors;
  13. import com.fasterxml.jackson.annotation.JsonFormat;
  14. import org.springframework.format.annotation.DateTimeFormat;
  15. import org.jeecgframework.poi.excel.annotation.Excel;
  16. /**
  17. * @Description: ${tableVo.ftlDescription}
  18. * @Author: jeecg-boot
  19. * @Date: ${.now?string["yyyy-MM-dd"]}
  20. * @Version: V1.0
  21. */
  22. @Data
  23. @TableName("${tableName}")
  24. @EqualsAndHashCode(callSuper = false)
  25. @Accessors(chain = true)
  26. @ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}")
  27. public class ${entityName} {
  28. <#list originalColumns as po>
  29. /**${po.filedComment}*/
  30. <#if po.fieldName == primaryKeyField>
  31. @TableId(type = IdType.ASSIGN_ID)
  32. <#else>
  33. <#if po.fieldType =='java.util.Date'>
  34. <#if po.fieldDbType =='date'>
  35. @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd")
  36. @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  37. @DateTimeFormat(pattern="yyyy-MM-dd")
  38. <#elseif po.fieldDbType =='datetime'>
  39. @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss")
  40. @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
  41. @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  42. </#if>
  43. <#else>
  44. @Excel(name = "${po.filedComment}", width = 15)
  45. </#if>
  46. </#if>
  47. @ApiModelProperty(value = "${po.filedComment}")
  48. private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
  49. </#list>
  50. }