我的图书-修复已购图书显示所有
This commit is contained in:
@@ -733,17 +733,18 @@ public class BookController {
|
||||
wrapper.eq(UserEbookBuyEntity::getUserId,userId);
|
||||
wrapper.groupBy(UserEbookBuyEntity::getBookId);
|
||||
List<Integer> bookIds = userEbookBuyService.getBaseMapper().selectList(wrapper).stream().map(UserEbookBuyEntity::getBookId).collect(Collectors.toList());
|
||||
MPJLambdaWrapper<BookEntity> wrapper1 = new MPJLambdaWrapper<>();
|
||||
wrapper1.eq(BookEntity::getDelFlag,0);
|
||||
Page<BookEntity> bookEntityPage = null;
|
||||
if(bookIds.size()>0){
|
||||
MPJLambdaWrapper<BookEntity> wrapper1 = new MPJLambdaWrapper<>();
|
||||
wrapper1.eq(BookEntity::getDelFlag,0);
|
||||
wrapper1.in(BookEntity::getId,bookIds);
|
||||
if (type!=null){
|
||||
wrapper1.selectAll(BookEntity.class);
|
||||
wrapper1.leftJoin(MedicaldesBook.class,MedicaldesBook::getBookId,BookEntity::getId);
|
||||
wrapper1.eq(MedicaldesBook::getTypeId,type);
|
||||
}
|
||||
bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
||||
}
|
||||
if (type!=null){
|
||||
wrapper1.selectAll(BookEntity.class);
|
||||
wrapper1.leftJoin(MedicaldesBook.class,MedicaldesBook::getBookId,BookEntity::getId);
|
||||
wrapper1.eq(MedicaldesBook::getTypeId,type);
|
||||
}
|
||||
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
||||
|
||||
return R.ok().put("page",bookEntityPage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user