使用MPselectOne且查部分字段时,一定要有一个字段不为null,否则查出来的对象为null
Shop shop = shopMapper.selectOne(Wrappers.lambdaQuery(Shop.class).select(Shop::getName, Shop::getDistrict).eq(Shop::getId, shopId));
因此至少需要一个非null字段,才能保证这个对象一定存在,否则就需要判断对象是否为null
Shop shop = shopMapper.selectOne(Wrappers.lambdaQuery(Shop.class).select(Shop::getId, Shop::getName, Shop::getDistrict).eq(Shop::getId, shopId));