原因分析:

selectByExample()方法传递的参数错误,应该传example类型,而不是实体类。

错误代码如下:

@Override
    public PlantGrow selectPlantGrow(PlantGrow plantGrow1) {
        List<PlantGrow> plantGrows = plantGrowMapper.selectByExample(plantGrow1);
        if (!CollectionUtils.isEmpty(plantGrows)) {
            return plantGrows.get(0);
        }
        return null;
    }

解决:改为select

posted on 2022-05-16 20:37  周文豪  阅读(279)  评论(0编辑  收藏  举报