使用wrapper查询
Page<Note> page = new Page<>(noteVo.getCurrent(), noteVo.getSize());
page.addOrder(OrderItem.desc("gmt_modified"));
noteService.getBaseMapper().selectPage(page, new LambdaQueryWrapper<Note>()
.eq(StringUtils.isNoneBlank(netScope), Note::getNetScope, netScope)
.eq(null != createBy, Note::getCreateBy, createBy)
.in((null != noteType && 0 < noteType.length), Note::getNoteType, noteType)
.like(StringUtils.isNoneBlank(title), Note::getTitle, title));
in在xml中使用
使用foreach
<if test="List != null and List.size()!=0 ">
and list in
<foreach collection="List" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>