SysDictData.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.ruoyi.system.domain;
  2. import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
  3. import com.alibaba.excel.annotation.ExcelProperty;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import com.ruoyi.common.annotation.ExcelDictFormat;
  7. import com.ruoyi.common.constant.UserConstants;
  8. import com.ruoyi.common.convert.ExcelDictConvert;
  9. import com.ruoyi.common.core.domain.BaseEntity;
  10. import lombok.Data;
  11. import lombok.EqualsAndHashCode;
  12. import jakarta.validation.constraints.NotBlank;
  13. import jakarta.validation.constraints.Size;
  14. /**
  15. * 字典数据表 sys_dict_data
  16. *
  17. * @author Lion Li
  18. */
  19. @Data
  20. @EqualsAndHashCode(callSuper = true)
  21. @TableName("sys_dict_data")
  22. @ExcelIgnoreUnannotated
  23. public class SysDictData extends BaseEntity {
  24. /**
  25. * 字典编码
  26. */
  27. @ExcelProperty(value = "字典编码")
  28. @TableId(value = "dict_code")
  29. private Long dictCode;
  30. /**
  31. * 字典排序
  32. */
  33. @ExcelProperty(value = "字典排序")
  34. private Integer dictSort;
  35. /**
  36. * 字典标签
  37. */
  38. @ExcelProperty(value = "字典标签")
  39. @NotBlank(message = "字典标签不能为空")
  40. @Size(min = 0, max = 100, message = "字典标签长度不能超过{max}个字符")
  41. private String dictLabel;
  42. /**
  43. * 字典键值
  44. */
  45. @ExcelProperty(value = "字典键值")
  46. @NotBlank(message = "字典键值不能为空")
  47. @Size(min = 0, max = 100, message = "字典键值长度不能超过{max}个字符")
  48. private String dictValue;
  49. /**
  50. * 字典类型
  51. */
  52. @ExcelProperty(value = "字典类型")
  53. @NotBlank(message = "字典类型不能为空")
  54. @Size(min = 0, max = 100, message = "字典类型长度不能超过{max}个字符")
  55. private String dictType;
  56. /**
  57. * 样式属性(其他样式扩展)
  58. */
  59. @Size(min = 0, max = 100, message = "样式属性长度不能超过{max}个字符")
  60. private String cssClass;
  61. /**
  62. * 表格字典样式
  63. */
  64. private String listClass;
  65. /**
  66. * 是否默认(Y是 N否)
  67. */
  68. @ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class)
  69. @ExcelDictFormat(dictType = "sys_yes_no")
  70. private String isDefault;
  71. /**
  72. * 状态(0正常 1停用)
  73. */
  74. @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
  75. @ExcelDictFormat(dictType = "sys_normal_disable")
  76. private String status;
  77. /**
  78. * 备注
  79. */
  80. private String remark;
  81. public boolean getDefault() {
  82. return UserConstants.YES.equals(this.isDefault);
  83. }
  84. }