Mybatis在插入自增字段时,会对当前对象未赋值的自增字段进行赋值

            OrderItem orderItem = new OrderItem();

            System.out.println("==========");
            System.out.println(orderItem);//此时输出OrderItem{id=null, pid=null, oid=null, uid=null, number=null, product=null}

            orderItem.setPid(pid);
            orderItem.setUid(user.getId());
            orderItem.setNumber(num);
            System.out.println("==========");
            System.out.println(orderItem);//此时输出OrderItem{id=null, pid=91, oid=null, uid=1, number=1, product=null}


            orderItemService.add(orderItem);


            System.out.println("==========");
            System.out.println(orderItem);//此时输出OrderItem{id=6, pid=91, oid=null, uid=1, number=1, product=null}