mybatisPlus使用new QueryWapper进行查询(使用java8 lambda)


//单个数据使用selectOne,多条数据使用selectList   Entity放置你的实体   eq中放置你的查询条件
mapper.selectOne(new QueryWrapper<Entity>().lambda().eq(Entity::getId, id).eq(Entity::getCustomerId, customerId));
//查询用in的情况:   ids为你的id集合,后面可以继续使用.eq添加查询条件
mapper.selectList(new QueryWrapper<Entity>().lambda().in(Entity:: getId,ids).eq(Entity:: getCustomerId,customerId));

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM