@TableLogic
在实体类上的对应字段上使用这个注解
然后配置文件中使用:
mybatis-plus: global-config: db-config: logic-not-delete-value: 1 logic-delete-value: 0
加上配置文件()
/** * 3.1.1以后,就不需要使用这个配置.逻辑删除 * @return */ @Bean public ISqlInjector iSqlInjector(){ return new LogicSqlInjector(); }
原文:https://www.cnblogs.com/qingmuchuanqi48/p/11932212.html