java8中LambdaQueryWrapper对象使用

版权声明:本文为CSDN博主「殷桃小狗子」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Aurora_____/article/details/111182375
————————————————

idea新建一个spring boot 项目,然后在pom.xml文件中引入mybatis plus 的依赖:

<!--mybatis plus extension,包含了mybatis plus core-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>


1.QueryWrapper的方法


2.demo
使用的关键的代码

使用的关键的代码
QueryWrapper<PbListBlack> sectionQueryWrapper = new QueryWrapper<>();
sectionQueryWrapper.eq("OPTYPE", 1);
sectionQueryWrapper.eq("BLTYPE", 1);
List<PbListBlack> pbListBlacks = iPbListBlackMapper.selectList(sectionQueryWrapper);

上面这段代码的意思就是,首先新建一个QueryWrapper对象,类型为PbListBlack对象,也就是你需要查询的实体数据,

sectionQueryWrapper.eq(“OPTYPE”, 1);

sectionQueryWrapper.eq(“BLTYPE”, 1);

这两句的意思是PbListBlack对象对应的数据库表中的OPTYPE,BLTYPE字段值要为1

原文地址:https://www.cnblogs.com/zouhao/p/14721693.html