通用Mapper 枚举类型处理办法
在application.properties中添加配置
枚举按简单类型处理,如果有枚举字段则需要加上该配置才会做映射
mapper.enum-as-simple-type = true
或者
mapper:
enumAsSimpleType: true
在实体类的枚举字段加注解@ColumnType
/**
* 性别 男:MALE 女:FEMALE
*/
@ColumnType(jdbcType = JdbcType.VARCHAR)
private SexStatusEnum sex;
认真可以把事情做对,而用心却可以做到完美