1. 配置全局删除值

    mybatis-plus.global-config.db-config.logic-delete-value=1mybatis-plus.global-config.db-config.logic-not-delete-value=0

    1. 使用@TableLogic指定逻辑删除的字段

    package com.itheima.mp.pojo;import com.baomidou.mybatisplus.annotation.;import lombok.Data;/**
    @author liqp
    @version 1.0
    @date 2021/5/2
    */@TableName(“tb_user”)@Datapublic class User {@TableId(type = IdType.AUTO)private Long id;//@TableField(“user_name”)
    private String userName;private String password;private String name;private Integer age;private String email;@TableLogic
    private Integer deleted;