设置 在pojo类的id上添加注解@TableId(type = IdType.x) 源码 TableId.class package com.baomidou.mybatisplus.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.anno