自定义sql使用枚举值
type = '${@xxxxxxx@TYPE1.getValue}'xxxxxxx为枚举类完整路径
JSON注解
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
只反序列化
(ex.实体的某个属性只用于后端处理不返回给前端时使用该注解)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
只序列化
easyexcel
导入时,字段type使用转换器converter,如果父类也有同名字段且不注解转换器,为因为转换失败导致导入失败(即使使用@ExcelIgnoreUnannotated或@ExcelIgnore都不行),要不就都注解转换器,要不子类属性重命名
导出样式使用自定义rgb颜色,必须使用xlsx XSSFCellStyle,由于easyexcel有默认导出样式WriteCellStyle,直接设置XSSFCellStyle后样式无法生效
1、清空单元格默认样式
WriteCellData<?> cellData = context.getFirstCellData(); if (cellData != null) { cellData.setWriteCellStyle(null); }2、设置优先级大于默认样式
@Override public int order() { //DefaultStyle order是50000 return 50001; }