MyBatisPlus 扩展->逻辑删除

 

 

2、实体类中添加对应属性

  1. @TableLogic//逻辑删除注解
  2. private Integer deleted;
  3.  

     

3、配置!

  1. //逻辑删除组件
  2. @Bean
  3. public ISqlInjector sqlInjector(){
  4. return new LogicSqlInjector();
  5. }
  1. #配置逻辑删除 没删除的为0 删除的为1
  2. mybatis-plus.global-config.db-config.logic-delete-value=1
  3. mybatis-plus.global-config.db-config.logic-not-delete-value=0

 

 

4、测试一下删除

posted @ 2022-07-08 14:40  黄河远15  阅读(37)  评论(0编辑  收藏  举报