新版
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.github.yulichang.base.mapper.MPJJoinMapper;
|
||||
import com.github.yulichang.toolkit.MPJWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.dao.BookDao;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
@@ -25,6 +30,8 @@ public class UserEbookBuyController {
|
||||
private UserEbookBuyService userEbookBuyService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
@Autowired
|
||||
private BookDao bookDao;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
@@ -38,8 +45,26 @@ public class UserEbookBuyController {
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* 获取用户打开书列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getUserClockBookList")
|
||||
public R getUserClockBookList(@RequestParam("userId") Integer userId){
|
||||
MPJLambdaWrapper<BookEntity> wrapper = new MPJLambdaWrapper<BookEntity>();
|
||||
wrapper.selectAll(BookEntity.class);
|
||||
wrapper.leftJoin(UserEbookBuyEntity.class,UserEbookBuyEntity::getBookId,BookEntity::getId);
|
||||
wrapper.eq(UserEbookBuyEntity::getUserId,userId);
|
||||
wrapper.eq(BookEntity::getClockIn,1);
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
List<BookEntity> bookEntities = bookDao.selectJoinList(BookEntity.class, wrapper);
|
||||
return R.ok().put("books",bookEntities).put("tatol",bookEntities.size());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户打卡书列表
|
||||
*/
|
||||
@RequestMapping("/appbooklist")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user